From 9f213cf055b94774e643712c4e955555b733435d Mon Sep 17 00:00:00 2001 From: Ian Richardson Date: Wed, 11 Sep 2019 13:47:48 -0500 Subject: [PATCH] Don't display slider if light doesn't support brightness (#3684) Closes https://github.com/home-assistant/home-assistant-polymer/issues/3542 --- src/panels/lovelace/cards/hui-light-card.ts | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/panels/lovelace/cards/hui-light-card.ts b/src/panels/lovelace/cards/hui-light-card.ts index 7ee16e5d6a..71480dd5f2 100644 --- a/src/panels/lovelace/cards/hui-light-card.ts +++ b/src/panels/lovelace/cards/hui-light-card.ts @@ -25,6 +25,8 @@ import { LovelaceCard, LovelaceCardEditor } from "../types"; import { hasConfigOrEntityChanged } from "../common/has-changed"; import { toggleEntity } from "../common/entity/toggle-entity"; import { LightCardConfig } from "./types"; +import { supportsFeature } from "../../../common/entity/supports-feature"; +import { SUPPORT_BRIGHTNESS } from "../../../data/light"; @customElement("hui-light-card") export class HuiLightCard extends LitElement implements LovelaceCard { @@ -90,12 +92,17 @@ export class HuiLightCard extends LitElement implements LovelaceCard { class="more-info" @click="${this._handleMoreInfo}" > +
- + ${supportsFeature(stateObj, SUPPORT_BRIGHTNESS) + ? html` + + ` + : ""}
+
${brightness} %