Skip to content

Commit

Permalink
Merge pull request #16 from d2kagw/cast-booleans-to-switches
Browse files Browse the repository at this point in the history
cast boolean states as switches
  • Loading branch information
d2kagw authored Apr 29, 2023
2 parents 05b8a81 + d913625 commit 327250b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "lovelace-muto",
"version": "1.2.2",
"version": "1.2.3",
"description": "",
"main": "index.js",
"scripts": {
Expand Down
6 changes: 5 additions & 1 deletion src/shared/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,11 @@ export function colorForEntityState(entity: HassEntity): string {
return "";
} else {
if (deviceStateColors) {
styleString = deviceStateColors[entity.state];
let state: string = entity.state;
state = state == "True" ? "on" : state;
state = state == "False" ? "off" : state;

styleString = deviceStateColors[state];
} else {
console.info(`Muto`, `No device state colors for device type`, deviceType);
}
Expand Down

0 comments on commit 327250b

Please sign in to comment.