mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-24 09:46:36 +00:00
Don't show edit favorite colors button if the light doesn't support it (#16750)
This commit is contained in:
parent
21f983572c
commit
9f3e8abe69
@ -58,6 +58,10 @@ export const lightSupportsBrightness = (entity: LightEntity) =>
|
||||
modesSupportingBrightness.includes(mode)
|
||||
) || false;
|
||||
|
||||
export const lightSupportsFavoriteColors = (entity: LightEntity) =>
|
||||
lightSupportsColor(entity) ||
|
||||
lightSupportsColorMode(entity, LightColorMode.COLOR_TEMP);
|
||||
|
||||
export const getLightCurrentModeRgbColor = (
|
||||
entity: LightEntity
|
||||
): number[] | undefined =>
|
||||
|
@ -37,6 +37,7 @@ import {
|
||||
lightSupportsBrightness,
|
||||
lightSupportsColor,
|
||||
lightSupportsColorMode,
|
||||
lightSupportsFavoriteColors,
|
||||
} from "../../../data/light";
|
||||
import type { HomeAssistant } from "../../../types";
|
||||
import { moreInfoControlStyle } from "../components/ha-more-info-control-style";
|
||||
@ -206,7 +207,9 @@ class MoreInfoLight extends LitElement {
|
||||
`
|
||||
: nothing}
|
||||
</div>
|
||||
${this.entry && (this.editMode || hasFavoriteColors)
|
||||
${this.entry &&
|
||||
lightSupportsFavoriteColors(this.stateObj) &&
|
||||
(this.editMode || hasFavoriteColors)
|
||||
? html`
|
||||
<ha-more-info-light-favorite-colors
|
||||
.hass=${this.hass}
|
||||
|
@ -32,6 +32,7 @@ import {
|
||||
ExtEntityRegistryEntry,
|
||||
getExtendedEntityRegistryEntry,
|
||||
} from "../../data/entity_registry";
|
||||
import { lightSupportsFavoriteColors } from "../../data/light";
|
||||
import { SearchableDomains } from "../../data/search";
|
||||
import { haStyleDialog } from "../../resources/styles";
|
||||
import "../../state-summary/state-card-content";
|
||||
@ -359,7 +360,10 @@ export class MoreInfoDialog extends LitElement {
|
||||
</ha-list-item>
|
||||
`
|
||||
: nothing}
|
||||
${this._entry && domain === "light"
|
||||
${this._entry &&
|
||||
stateObj &&
|
||||
domain === "light" &&
|
||||
lightSupportsFavoriteColors(stateObj)
|
||||
? html`
|
||||
<ha-list-item
|
||||
graphic="icon"
|
||||
|
Loading…
x
Reference in New Issue
Block a user