Fix PowerSwitch Dimmable bug

This commit is contained in:
2025-03-03 21:35:49 +01:00
parent d233b5a9cd
commit e8ea7533b4
+2 -2
View File
@@ -66,7 +66,7 @@ export class powerSwitchAccessory extends accessory {
.onSet(this.setOn.bind(this)) .onSet(this.setOn.bind(this))
.onGet(this.getOn.bind(this)) .onGet(this.getOn.bind(this))
if (accessory.context.device.dimmable != "false") { // WTF? if (accessory.context.device.dimmable == "true") {
this.service.getCharacteristic(this.platform.Characteristic.Brightness) this.service.getCharacteristic(this.platform.Characteristic.Brightness)
.onSet(this.setBrightness.bind(this)) .onSet(this.setBrightness.bind(this))
.onGet(this.getBrightness.bind(this)) .onGet(this.getBrightness.bind(this))
@@ -110,7 +110,7 @@ export class powerSwitchAccessory extends accessory {
} }
this.service.updateCharacteristic(this.platform.Characteristic.On, this.state.On) this.service.updateCharacteristic(this.platform.Characteristic.On, this.state.On)
if (device.dimmable != 'false') { // WTF? if (device.dimmable == "true") {
this.state.Brightness = device.dimlevel; this.state.Brightness = device.dimlevel;
this.service.updateCharacteristic(this.platform.Characteristic.Brightness, this.state.Brightness) this.service.updateCharacteristic(this.platform.Characteristic.Brightness, this.state.Brightness)
} }