Skip to content

Commit

Permalink
Fix #210
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasloven committed Oct 30, 2021
1 parent 491460e commit df3a687
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/controllers/controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 4 additions & 0 deletions src/controllers/light-controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit df3a687

Please sign in to comment.