aboutsummaryrefslogtreecommitdiff
path: root/plugin.ts
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 /plugin.ts
parent9ed98f43d7b80364cc9004e6bf374ef610a5a0e3 (diff)
small fix
Diffstat (limited to 'plugin.ts')
-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 });