Skip to content

Commit

Permalink
added support for input_boolean button states
Browse files Browse the repository at this point in the history
  • Loading branch information
d2kagw committed May 29, 2024
1 parent 327250b commit bdfe632
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/cards/button-card/button-card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ export class ButtonCard extends MutoBaseCard {
case "motion":
case "moisture":
case "switch":
case "input_boolean":
return this.defaultButtonContent();

case "weather":
Expand Down
3 changes: 2 additions & 1 deletion src/shared/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ export const deviceStateColor = {
climate: defaultStateColors.on_is_good,
switch: defaultStateColors.on_is_good,
sensor: defaultStateColors.on_is_good,
input_boolean: defaultStateColors.on_is_good,

battery_charging: defaultStateColors.off_is_good,
connectivity: defaultStateColors.off_is_bad,
Expand All @@ -87,7 +88,7 @@ export function colorForEntityState(entity: HassEntity): string {
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 bdfe632

Please sign in to comment.