Blackymas / NSPanel_HA_Blueprint

This allows you to configure your complete NSPanel via Blueprint with UI and without changing anything in the code
1.26k stars 234 forks source link

`Enhancement` make "_hw_button_state" service set one hw-button state instead of both #1934

Closed MichaelHeimann closed 3 months ago

MichaelHeimann commented 3 months ago

Enhancement Summary

the _hw_button_state service needs both states as parameters but in most cases only one button state needs an update

Detailed Description

The two hardware buttons are Independent from each other and I use them for completely unrelated entities.

One example: the left button triggers an automation for a light-group and the right button is connected to a light-entity directly. I do not need to set the state of the right button since it's managed by the state of the entity - fine.

The left button triggers an automation so to indicate the state of the switched light-group I need to set it's state.

Now I'd prefer to only set the state of the left button. Right now I cannot and the service refuses to run when both attributes are not set. This means the automation to set the state for the left button needs to set the right one, too. To not break that one, the automaton needs to check the state of the right button entity and then can "update" both buttons accordingly - actually only the left is changed.

Benefit: simplicity, less error prone, shorter automations, less unnecessary action.

Additional Context

still love the _hw_button_state service more than using nextion commands etc. - great work!

edwardtfn commented 3 months ago

I believe this is solved in DEV and will be included in a new release soon.