rkokkelk / com.jreenen.homeyharmonyhub

Harmony hub support for Homey
GNU General Public License v2.0
8 stars 9 forks source link

Update onoff capability listener to parse value #74

Closed rkokkelk closed 3 years ago

rkokkelk commented 3 years ago

The onoff capability listener now takes the expected onoff value, as given by Homey, into account of whether to turn devices on or off. Previously the onCapabilityOnoff function switches the device state, which in turn results in devices turning on when askes to turn off twice.

Now the expected value is taken into account whether to turn the devices on or off.

Fix #73

rkokkelk commented 3 years ago

Add additional functionality to ensure that devices which use toggle mode to turn on or off, is not executed when device is already in desired state.

I've encountered in practice that a device that is turned off is asked to turn off again (turn off al devices in living room when I leave the house) results in the device being turned on. This is because this device is turned on/off via Toggle mode and the toggle mode is automatically executed. The latest commit should resolve this.