From 65d3af6fd632909691f8c7a072916a09cab2bcc3 Mon Sep 17 00:00:00 2001 From: Paul Bottein Date: Mon, 20 Mar 2023 20:38:48 +0100 Subject: [PATCH] Add white mode to more info light (#15774) --- .../more-info/controls/more-info-light.ts | 29 +++++++++++++++++++ src/translations/en.json | 1 + 2 files changed, 30 insertions(+) diff --git a/src/dialogs/more-info/controls/more-info-light.ts b/src/dialogs/more-info/controls/more-info-light.ts index cac953da44..79dfbe7a77 100644 --- a/src/dialogs/more-info/controls/more-info-light.ts +++ b/src/dialogs/more-info/controls/more-info-light.ts @@ -2,6 +2,7 @@ import "@material/mwc-list/mwc-list-item"; import "@material/web/iconbutton/outlined-icon-button"; import { mdiCreation, + mdiFileWordBox, mdiLightbulb, mdiLightbulbOff, mdiPalette, @@ -73,6 +74,11 @@ class MoreInfoLight extends LitElement { const supportsColor = lightSupportsColor(this.stateObj); + const supportsWhite = lightSupportsColorMode( + this.stateObj, + LightColorMode.WHITE + ); + const supportsBrightness = lightSupportsBrightness(this.stateObj); const supportsEffects = supportsFeature( @@ -148,6 +154,22 @@ class MoreInfoLight extends LitElement { ` : null} + ${supportsWhite + ? html` + + + + ` + : null} ${supportsEffects && this.stateObj.attributes.effect_list ? html` { + this.hass.callService("light", "turn_on", { + entity_id: this.stateObj!.entity_id, + white: true, + }); + }; + private _handleEffectButton(ev) { ev.stopPropagation(); ev.preventDefault(); diff --git a/src/translations/en.json b/src/translations/en.json index ca63b724df..b02bf832e7 100755 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -899,6 +899,7 @@ "light": { "toggle": "Toggle", "change_color": "Change color", + "set_white": "Set white", "select_effect": "Select effect", "brightness": "Brightness", "color_picker": {