diff --git a/src/controllers/controller.ts b/src/controllers/controller.ts index e628718..d368130 100644 --- a/src/controllers/controller.ts +++ b/src/controllers/controller.ts @@ -67,7 +67,7 @@ export abstract class Controller { } get isOff(): boolean { - return this.value === 0; + return this.stateObj.state === "off" || this.value === 0; } get min(): number { diff --git a/src/controllers/light-controller.ts b/src/controllers/light-controller.ts index 046316b..16a7a39 100644 --- a/src/controllers/light-controller.ts +++ b/src/controllers/light-controller.ts @@ -111,6 +111,10 @@ export class LightController extends Controller { } } + get isOff() { + return this.stateObj.state === "off"; + } + set _value(value) { if (!this.stateObj) return; const color_mode = this.stateObj.attributes.color_mode;