Fixing Gallery and updating timeout type

This commit is contained in:
Zack Arnett 2018-10-29 18:07:57 -04:00
parent 7178d208d3
commit bb4ce278b0
2 changed files with 5 additions and 3 deletions

View File

@ -55,7 +55,9 @@ export class LightEntity extends Entity {
if (service === "turn_on") { if (service === "turn_on") {
// eslint-disable-next-line // 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( this.update(
"on", "on",
Object.assign(this.attributes, { Object.assign(this.attributes, {

View File

@ -37,7 +37,7 @@ export class HuiLightCard extends hassLocalizeLitMixin(LitElement)
implements LovelaceCard { implements LovelaceCard {
public hass?: HomeAssistant; public hass?: HomeAssistant;
private _config?: Config; private _config?: Config;
private _brightnessTimout?: NodeJS.Timer; private _brightnessTimout?: number;
static get properties() { static get properties() {
return { return {
@ -254,7 +254,7 @@ export class HuiLightCard extends hassLocalizeLitMixin(LitElement)
} }
private _hideBrightness() { private _hideBrightness() {
this._brightnessTimout = setTimeout(() => { this._brightnessTimout = window.setTimeout(() => {
this.shadowRoot!.querySelector(".brightness")!.classList.remove( this.shadowRoot!.querySelector(".brightness")!.classList.remove(
"show_brightness" "show_brightness"
); );