Skip to content

Commit

Permalink
fix: missing state default color
Browse files Browse the repository at this point in the history
  • Loading branch information
jcwillox committed Feb 13, 2023
1 parent fc16587 commit 584ddd6
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,12 @@ export class PaperButtonsRow extends LitElement {
}

_getStateStyles(domain?: string, stateObj?: HassEntity): StyleInfo {
if (!domain || !stateObj) return {};
const hex = getComputedStyle(this).getPropertyValue("--state-icon-color");
const base = {
"--rgb-state-default-color": this._hexToRgb(hex)?.join(", "),
};

if (!domain || !stateObj) return base;

if (stateObj.attributes.rgb_color) {
return {
Expand All @@ -388,7 +393,8 @@ export class PaperButtonsRow extends LitElement {
};
}
}
return {};

return base;
}

_getStateColor = (stateObj: HassEntity, domain?: string) => {
Expand Down

0 comments on commit 584ddd6

Please sign in to comment.