From b376ccd897b051b643b9c345828defca32382d1a Mon Sep 17 00:00:00 2001 From: Thomas Aldrian Date: Mon, 18 Sep 2023 10:30:39 +0100 Subject: [PATCH] Formatting fixes --- .../hui-climate-presets-tile-feature.ts | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/panels/lovelace/tile-features/hui-climate-presets-tile-feature.ts b/src/panels/lovelace/tile-features/hui-climate-presets-tile-feature.ts index 1c553f44404e..4dd81fd00788 100644 --- a/src/panels/lovelace/tile-features/hui-climate-presets-tile-feature.ts +++ b/src/panels/lovelace/tile-features/hui-climate-presets-tile-feature.ts @@ -23,7 +23,8 @@ export const supportsClimatePresetsTileFeature = (stateObj: HassEntity) => { @customElement("hui-climate-presets-tile-feature") class HuiClimatePresetsTileFeature extends LitElement - implements LovelaceTileFeature { + implements LovelaceTileFeature +{ @property({ attribute: false }) public hass?: HomeAssistant; @property({ attribute: false }) public stateObj?: ClimateEntity; @@ -54,7 +55,7 @@ class HuiClimatePresetsTileFeature private async _valueChanged(ev: CustomEvent) { const preset = (ev.detail as any).value as string; - const oldPreset = this.stateObj!.attributes.preset_mode + const oldPreset = this.stateObj!.attributes.preset_mode; if (preset === oldPreset) return; this._currentPreset = preset; @@ -70,7 +71,7 @@ class HuiClimatePresetsTileFeature await this.hass!.callService("climate", "set_preset_mode", { entity_id: this.stateObj!.entity_id, preset_mode: preset, - }) + }); } protected render(): TemplateResult | null { @@ -85,14 +86,13 @@ class HuiClimatePresetsTileFeature const color = stateColorCss(this.stateObj); - const presets = this.stateObj.attributes.preset_modes as string[] || []; + const presets = (this.stateObj.attributes.preset_modes as string[]) || []; - const options = presets - .map((preset) => ({ - value: preset, - label: this.hass!.formatEntityAttributeName(this.stateObj!, preset), - path: computePresetModeIcon(preset), - })); + const options = presets.map((preset) => ({ + value: preset, + label: this.hass!.formatEntityAttributeName(this.stateObj!, preset), + path: computePresetModeIcon(preset), + })); return html`
@@ -103,8 +103,8 @@ class HuiClimatePresetsTileFeature hide-label .ariaLabel=${this.hass.localize("ui.card.climate.preset")} style=${styleMap({ - "--control-select-color": color, - })} + "--control-select-color": color, + })} .disabled=${this.stateObj!.state === UNAVAILABLE} >