aboutsummaryrefslogtreecommitdiff
path: root/plugin.ts
diff options
context:
space:
mode:
authorlonkaars <loek@pipeframe.xyz>2021-08-07 10:02:52 +0200
committerlonkaars <loek@pipeframe.xyz>2021-08-07 10:02:52 +0200
commit55c44def6f327dcbebe0c2d3951d3df90954e13e (patch)
tree4cb7bb621c154c15a89efddc080472b4dde972cf /plugin.ts
parentc0f3a5cf1c7be29aba155eba214c13f921c00b2b (diff)
more small fixes
Diffstat (limited to 'plugin.ts')
-rw-r--r--plugin.ts6
1 files changed, 4 insertions, 2 deletions
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();