Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add sequence support to dashboard action #22303

Closed
wants to merge 2 commits into from
Closed

Conversation

piitaya
Copy link
Member

@piitaya piitaya commented Oct 9, 2024

Proposed change

Adds sequence support to dashboard actions.
It will allow calling a full sequence of action.
It will unlock multiple features like :

  • perform multiple action in sequence or parallel
  • use template in actions
  • use variables

You can also consider migrating the perform action to this one.

This PR is still draft because it needs #22300 to be merged, otherwise drag and drop will not work.

CleanShot 2024-10-09 at 19 11 04

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New feature (thank you!)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Example configuration

Additional information

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue or discussion:
  • Link to documentation pull request:

Checklist

  • The code change is tested and works locally.
  • There is no commented out code in this PR.
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

@@ -174,6 +174,7 @@ export class HaServiceControl extends LitElement {
if (this._value && serviceData) {
const loadDefaults = this.value && !("data" in this.value);
// Set mandatory bools without a default value to false
this._value = { ...this._value };
Copy link
Member Author

@piitaya piitaya Oct 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is needed to avoid the modification on the source value.

@piitaya piitaya added the Do Not Review PR is not ready for any kind of review label Oct 9, 2024
Comment on lines +104 to +116
private _entitiesContext = new ContextProvider(this, {
context: fullEntitiesContext,
initialValue: [],
});

public hassSubscribe(): UnsubscribeFunc[] {
return [
subscribeEntityRegistry(this.hass!.connection!, (entities) => {
this._entitiesContext.setValue(entities);
}),
];
}

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not like this 😢

@bramkragten
Copy link
Member

You can do the same by running a script, we dont want to this to dashboards.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed Do Not Review PR is not ready for any kind of review hacktoberfest
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants