Setting button state correctly for stateful buttons
This commit is contained in:
parent
b004e3a966
commit
3759d91d1f
@ -104,8 +104,8 @@ export class DeviceButton implements IAccessory {
|
|||||||
await this._dataProvider.sendCommand(this._deviceCommand);
|
await this._dataProvider.sendCommand(this._deviceCommand);
|
||||||
|
|
||||||
//change state if stateful
|
//change state if stateful
|
||||||
if (this._buttonInfo.IsStateful) {
|
if (this._buttonInfo.IsStateful && this._buttonState != activeState) {
|
||||||
this._buttonState = !this._buttonState
|
this._buttonState = activeState
|
||||||
} else {
|
} else {
|
||||||
this._switchService.getCharacteristic(Characteristic.On).updateValue(false);
|
this._switchService.getCharacteristic(Characteristic.On).updateValue(false);
|
||||||
return callback(new Error("Normal Response"));
|
return callback(new Error("Normal Response"));
|
||||||
|
Loading…
Reference in New Issue
Block a user