Эх сурвалжийг харах

Fix PowerSwitch Dimmable bug

JDierkse 9 сар өмнө
parent
commit
e8ea7533b4

+ 2 - 2
powerSwitchAccessory.ts

@@ -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)
 							}