From bb4ce278b08fe8bd9b79672e684e422e16562ff2 Mon Sep 17 00:00:00 2001 From: Zack Arnett Date: Mon, 29 Oct 2018 18:07:57 -0400 Subject: [PATCH] Fixing Gallery and updating timeout type --- gallery/src/data/entity.js | 4 +++- src/panels/lovelace/cards/hui-light-card.ts | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/gallery/src/data/entity.js b/gallery/src/data/entity.js index b2b90a50ca..d705322d81 100644 --- a/gallery/src/data/entity.js +++ b/gallery/src/data/entity.js @@ -55,7 +55,9 @@ export class LightEntity extends Entity { if (service === "turn_on") { // eslint-disable-next-line - const { brightness, hs_color } = data; + let { brightness, hs_color, brightness_pct } = data; + // eslint-disable-next-line + brightness = (255 * brightness_pct) / 100; this.update( "on", Object.assign(this.attributes, { diff --git a/src/panels/lovelace/cards/hui-light-card.ts b/src/panels/lovelace/cards/hui-light-card.ts index 2cb22acdf9..c3761b2724 100644 --- a/src/panels/lovelace/cards/hui-light-card.ts +++ b/src/panels/lovelace/cards/hui-light-card.ts @@ -37,7 +37,7 @@ export class HuiLightCard extends hassLocalizeLitMixin(LitElement) implements LovelaceCard { public hass?: HomeAssistant; private _config?: Config; - private _brightnessTimout?: NodeJS.Timer; + private _brightnessTimout?: number; static get properties() { return { @@ -254,7 +254,7 @@ export class HuiLightCard extends hassLocalizeLitMixin(LitElement) } private _hideBrightness() { - this._brightnessTimout = setTimeout(() => { + this._brightnessTimout = window.setTimeout(() => { this.shadowRoot!.querySelector(".brightness")!.classList.remove( "show_brightness" );