aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlonkaars <loek@pipeframe.xyz>2021-08-06 22:29:19 +0200
committerlonkaars <loek@pipeframe.xyz>2021-08-06 22:29:19 +0200
commit7124470a672206aa49a6ee3e48d1a9bd58b50228 (patch)
tree22297d89e04320947275ba66b8f97501cdf1ab8e
parent9ed98f43d7b80364cc9004e6bf374ef610a5a0e3 (diff)
small fix
-rw-r--r--plugin.ts4
1 files changed, 4 insertions, 0 deletions
diff --git a/plugin.ts b/plugin.ts
index b588ac3..20189b1 100644
--- a/plugin.ts
+++ b/plugin.ts
@@ -104,6 +104,10 @@ export default class BekenBridge implements AccessoryPlugin {
}
updateLamp() {
+ if (!this.state.on) {
+ this.lamp.color = [0, 0, 0, 0];
+ return;
+ }
switch (this.state.lamp) {
case 'rgb': {
var rgb = Color({ h: this.state.hue, s: this.state.saturation, v: this.state.brightness });