From 55c44def6f327dcbebe0c2d3951d3df90954e13e Mon Sep 17 00:00:00 2001 From: lonkaars Date: Sat, 7 Aug 2021 10:02:52 +0200 Subject: more small fixes --- package.json | 2 +- plugin.ts | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index f07323d..8137379 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "displayName": "Beken LED Homebridge plugin", "name": "homebridge-beken", - "version": "0.1.4", + "version": "0.1.5", "description": "homebridge beken led plugin", "author": "lonkaars ", "license": "MIT", diff --git a/plugin.ts b/plugin.ts index 70d250c..9b2fa10 100644 --- a/plugin.ts +++ b/plugin.ts @@ -49,6 +49,7 @@ export default class BekenBridge implements AccessoryPlugin { registerWhiteBulbServices() { var done = () => { + this.RGBBulbService.getCharacteristic(this.api.hap.Characteristic.On).updateValue(false); this.state.lamp = 'white'; this.updateLamp(); }; @@ -59,7 +60,7 @@ export default class BekenBridge implements AccessoryPlugin { done(); }); this.whiteBulbService.getCharacteristic(this.api.hap.Characteristic.Brightness) - .onGet(() => this.state.brightness && this.state.lamp == 'white') + .onGet(() => this.state.brightness) .onSet((brt: number) => { this.state.brightness = brt; done(); @@ -68,6 +69,7 @@ export default class BekenBridge implements AccessoryPlugin { registerRGBBulbServices() { var done = () => { + this.whiteBulbService.getCharacteristic(this.api.hap.Characteristic.On).updateValue(false); this.state.lamp = 'rgb'; this.updateLamp(); }; @@ -78,7 +80,7 @@ export default class BekenBridge implements AccessoryPlugin { done(); }); this.RGBBulbService.getCharacteristic(this.api.hap.Characteristic.Brightness) - .onGet(() => this.state.brightness && this.state.lamp == 'rgb') + .onGet(() => this.state.brightness) .onSet((brt: number) => { this.state.brightness = brt; done(); -- cgit v1.2.3