mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-27 03:06:41 +00:00
Fix brightness on button card (#14724)
This commit is contained in:
parent
d64bb98bb4
commit
2d7973af79
@ -309,7 +309,7 @@ export class HuiButtonCard extends LitElement implements LovelaceCard {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private _computeBrightness(stateObj: HassEntity | LightEntity): string {
|
private _computeBrightness(stateObj: HassEntity | LightEntity): string {
|
||||||
if (!stateObj.attributes.brightness && stateActive(stateObj)) {
|
if (stateObj.attributes.brightness) {
|
||||||
const brightness = stateObj.attributes.brightness;
|
const brightness = stateObj.attributes.brightness;
|
||||||
return `brightness(${(brightness + 245) / 5}%)`;
|
return `brightness(${(brightness + 245) / 5}%)`;
|
||||||
}
|
}
|
||||||
@ -319,7 +319,7 @@ export class HuiButtonCard extends LitElement implements LovelaceCard {
|
|||||||
private _computeColor(
|
private _computeColor(
|
||||||
stateObj: HassEntity | LightEntity
|
stateObj: HassEntity | LightEntity
|
||||||
): string | undefined {
|
): string | undefined {
|
||||||
if (stateObj.attributes.rgb_color && stateActive(stateObj)) {
|
if (stateObj.attributes.rgb_color) {
|
||||||
return `rgb(${stateObj.attributes.rgb_color.join(",")})`;
|
return `rgb(${stateObj.attributes.rgb_color.join(",")})`;
|
||||||
}
|
}
|
||||||
const iconColor = stateColorCss(stateObj);
|
const iconColor = stateColorCss(stateObj);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user