AdyRock / com.ady.button_plus

GNU General Public License v3.0
2 stars 3 forks source link

Button value does not get updated with capability #75

Closed Joolee closed 8 months ago

Joolee commented 8 months ago

Homey

Describe the bug When configuring a button as 'bound' to an on/off capability, the state of the button only gets updated when the state is changed by pushing the button. Funnily enough, it doesn't matter which button you press when you configure multiple buttons for the same device, all buttons get their state changed. When changing the capability value (for example, by turning on a light using Homey), the button state does not get updated.

To Reproduce Steps to reproduce the behaviour:

  1. Configure one or more buttons, bound to the on/off capability of a lamp
  2. Trigger a change in the lamp through Homey: No change in the button state
  3. Trigger a change by pushing the button: Button state changes (all of them when there is more then one bound button to that specific capability) and the lamp also switches on/off

Expected behaviour A clear and concise description of what you expected to happen.

Screenshots If applicable, add screenshots to help explain your problem.

Additional context Logs for a single change from Off to On performed by switching on a device in Homey. Note: Two buttons are bound to the capability during the test.

* 2024-01-04T18:41:49.998Z
MQTTclient.on message: 23.956

* 2024-01-04T18:41:53.431Z
Capability changed: Ceiling Light, onoff, true

* 2024-01-04T18:41:53.436Z
_handleStateChange: parameters is not defined

* 2024-01-04T18:41:53.443Z
Capability changed: Ceiling Light, onoff, true, same as previous value

* 2024-01-04T18:41:53.447Z
Capability changed: Ceiling Light, onoff, true, same as previous value

* 2024-01-04T18:41:53.452Z
Capability changed: Ceiling Light, onoff, true, same as previous value

* 2024-01-04T18:41:53.457Z
Capability changed: Ceiling Light, onoff, true, same as previous value

* 2024-01-04T18:41:53.463Z
Capability changed: Ceiling Light, onoff, true, same as previous value

* 2024-01-04T18:41:53.475Z
Capability changed: Ceiling Light, onoff, true, same as previous value

* 2024-01-04T18:41:53.480Z
Capability changed: Ceiling Light, onoff, true, same as previous value

* 2024-01-04T18:41:53.486Z
Capability changed: Ceiling Light, onoff, true, same as previous value

* 2024-01-04T18:41:53.491Z
Capability changed: Ceiling Light, onoff, true, same as previous value