Fix PowerSwitch Dimmable bug
This commit is contained in:
@@ -66,7 +66,7 @@ export class powerSwitchAccessory extends accessory {
|
||||
.onSet(this.setOn.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)
|
||||
.onSet(this.setBrightness.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)
|
||||
|
||||
if (device.dimmable != 'false') { // WTF?
|
||||
if (device.dimmable == "true") {
|
||||
this.state.Brightness = device.dimlevel;
|
||||
this.service.updateCharacteristic(this.platform.Characteristic.Brightness, this.state.Brightness)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user