diff --git a/demo/src/custom-cards/cast-demo-row.ts b/demo/src/custom-cards/cast-demo-row.ts index fd852f973934..418a5cda0217 100644 --- a/demo/src/custom-cards/cast-demo-row.ts +++ b/demo/src/custom-cards/cast-demo-row.ts @@ -10,7 +10,7 @@ import { import "../../../src/components/ha-icon"; import { - EntityRow, + LovelaceRow, CastConfig, } from "../../../src/panels/lovelace/entity-rows/types"; import { HomeAssistant } from "../../../src/types"; @@ -18,7 +18,7 @@ import { CastManager } from "../../../src/cast/cast_manager"; import { castSendShowDemo } from "../../../src/cast/receiver_messages"; @customElement("cast-demo-row") -class CastDemoRow extends LitElement implements EntityRow { +class CastDemoRow extends LitElement implements LovelaceRow { public hass!: HomeAssistant; @property() private _castManager?: CastManager | null; diff --git a/src/panels/lovelace/cards/hui-entities-card.ts b/src/panels/lovelace/cards/hui-entities-card.ts index e004ceedaf62..b5c4eff61d0f 100644 --- a/src/panels/lovelace/cards/hui-entities-card.ts +++ b/src/panels/lovelace/cards/hui-entities-card.ts @@ -13,7 +13,7 @@ import "../../../components/ha-card"; import "../components/hui-entities-toggle"; import { HomeAssistant } from "../../../types"; -import { EntityRow } from "../entity-rows/types"; +import { LovelaceRow } from "../entity-rows/types"; import { LovelaceCard, LovelaceCardEditor } from "../types"; import { processConfigEntities } from "../common/process-config-entities"; import { createRowElement } from "../common/create-row-element"; @@ -43,7 +43,7 @@ class HuiEntitiesCard extends LitElement implements LovelaceCard { this._hass = hass; this.shadowRoot!.querySelectorAll("#states > div > *").forEach( (element: unknown) => { - (element as EntityRow).hass = hass; + (element as LovelaceRow).hass = hass; } ); const entitiesToggle = this.shadowRoot!.querySelector( diff --git a/src/panels/lovelace/common/create-row-element.ts b/src/panels/lovelace/common/create-row-element.ts index f7b00ad9bdea..7a1444411645 100644 --- a/src/panels/lovelace/common/create-row-element.ts +++ b/src/panels/lovelace/common/create-row-element.ts @@ -23,15 +23,17 @@ import "../entity-rows/hui-text-entity-row"; import "../entity-rows/hui-timer-entity-row"; import "../entity-rows/hui-toggle-entity-row"; import "../special-rows/hui-call-service-row"; +import "../special-rows/hui-conditional-row"; import "../special-rows/hui-divider-row"; import "../special-rows/hui-section-row"; import "../special-rows/hui-weblink-row"; import "../special-rows/hui-cast-row"; -import { EntityConfig, EntityRow } from "../entity-rows/types"; +import { EntityConfig, LovelaceRow } from "../entity-rows/types"; const CUSTOM_TYPE_PREFIX = "custom:"; const SPECIAL_TYPES = new Set([ "call-service", + "conditional", "divider", "section", "weblink", @@ -69,8 +71,8 @@ const TIMEOUT = 2000; const _createElement = ( tag: string, config: EntityConfig -): EntityRow | HuiErrorCard => { - const element = document.createElement(tag) as EntityRow; +): LovelaceRow | HuiErrorCard => { + const element = document.createElement(tag) as LovelaceRow; try { element.setConfig(deepClone(config)); } catch (err) { @@ -96,7 +98,7 @@ const _hideErrorElement = (element) => { export const createRowElement = ( config: EntityConfig -): EntityRow | HuiErrorCard => { +): LovelaceRow | HuiErrorCard => { let tag; if ( diff --git a/src/panels/lovelace/entity-rows/hui-climate-entity-row.ts b/src/panels/lovelace/entity-rows/hui-climate-entity-row.ts index c0596839a72a..83dd5b21180a 100644 --- a/src/panels/lovelace/entity-rows/hui-climate-entity-row.ts +++ b/src/panels/lovelace/entity-rows/hui-climate-entity-row.ts @@ -14,11 +14,11 @@ import "../components/hui-generic-entity-row"; import "../components/hui-warning"; import { HomeAssistant } from "../../../types"; -import { EntityRow, EntityConfig } from "./types"; +import { LovelaceRow, EntityConfig } from "./types"; import { hasConfigOrEntityChanged } from "../common/has-changed"; @customElement("hui-climate-entity-row") -class HuiClimateEntityRow extends LitElement implements EntityRow { +class HuiClimateEntityRow extends LitElement implements LovelaceRow { @property() public hass?: HomeAssistant; @property() private _config?: EntityConfig; diff --git a/src/panels/lovelace/entity-rows/hui-cover-entity-row.ts b/src/panels/lovelace/entity-rows/hui-cover-entity-row.ts index f65a0e3ba4de..4a4c2c245be4 100644 --- a/src/panels/lovelace/entity-rows/hui-cover-entity-row.ts +++ b/src/panels/lovelace/entity-rows/hui-cover-entity-row.ts @@ -16,11 +16,11 @@ import "../components/hui-warning"; import { isTiltOnly } from "../../../util/cover-model"; import { HomeAssistant } from "../../../types"; -import { EntityRow, EntityConfig } from "./types"; +import { LovelaceRow, EntityConfig } from "./types"; import { hasConfigOrEntityChanged } from "../common/has-changed"; @customElement("hui-cover-entity-row") -class HuiCoverEntityRow extends LitElement implements EntityRow { +class HuiCoverEntityRow extends LitElement implements LovelaceRow { @property() public hass?: HomeAssistant; @property() private _config?: EntityConfig; diff --git a/src/panels/lovelace/entity-rows/hui-group-entity-row.ts b/src/panels/lovelace/entity-rows/hui-group-entity-row.ts index 4b47afd9ae12..ca87d168e6ce 100644 --- a/src/panels/lovelace/entity-rows/hui-group-entity-row.ts +++ b/src/panels/lovelace/entity-rows/hui-group-entity-row.ts @@ -14,11 +14,11 @@ import "../components/hui-warning"; import { computeStateDisplay } from "../../../common/entity/compute_state_display"; import { DOMAINS_TOGGLE } from "../../../common/const"; import { HomeAssistant } from "../../../types"; -import { EntityRow, EntityConfig } from "./types"; +import { LovelaceRow, EntityConfig } from "./types"; import { hasConfigOrEntityChanged } from "../common/has-changed"; @customElement("hui-group-entity-row") -class HuiGroupEntityRow extends LitElement implements EntityRow { +class HuiGroupEntityRow extends LitElement implements LovelaceRow { @property() public hass?: HomeAssistant; @property() private _config?: EntityConfig; diff --git a/src/panels/lovelace/entity-rows/hui-input-datetime-entity-row.ts b/src/panels/lovelace/entity-rows/hui-input-datetime-entity-row.ts index 12199b9359fe..40909d74776d 100644 --- a/src/panels/lovelace/entity-rows/hui-input-datetime-entity-row.ts +++ b/src/panels/lovelace/entity-rows/hui-input-datetime-entity-row.ts @@ -16,12 +16,12 @@ import "../../../components/ha-date-input"; import { HaDateInput } from "../../../components/ha-date-input"; import { HomeAssistant } from "../../../types"; -import { EntityRow, EntityConfig } from "./types"; +import { LovelaceRow, EntityConfig } from "./types"; import { setInputDateTimeValue } from "../../../data/input_datetime"; import { hasConfigOrEntityChanged } from "../common/has-changed"; @customElement("hui-input-datetime-entity-row") -class HuiInputDatetimeEntityRow extends LitElement implements EntityRow { +class HuiInputDatetimeEntityRow extends LitElement implements LovelaceRow { @property() public hass?: HomeAssistant; @property() private _config?: EntityConfig; diff --git a/src/panels/lovelace/entity-rows/hui-input-number-entity-row.ts b/src/panels/lovelace/entity-rows/hui-input-number-entity-row.ts index 2140fc3d14eb..ffed9a931d63 100644 --- a/src/panels/lovelace/entity-rows/hui-input-number-entity-row.ts +++ b/src/panels/lovelace/entity-rows/hui-input-number-entity-row.ts @@ -14,13 +14,13 @@ import "../../../components/ha-slider"; import "../components/hui-warning"; import { computeRTLDirection } from "../../../common/util/compute_rtl"; -import { EntityRow, EntityConfig } from "./types"; +import { LovelaceRow, EntityConfig } from "./types"; import { HomeAssistant } from "../../../types"; import { setValue } from "../../../data/input_text"; import { hasConfigOrEntityChanged } from "../common/has-changed"; @customElement("hui-input-number-entity-row") -class HuiInputNumberEntityRow extends LitElement implements EntityRow { +class HuiInputNumberEntityRow extends LitElement implements LovelaceRow { @property() public hass?: HomeAssistant; @property() private _config?: EntityConfig; diff --git a/src/panels/lovelace/entity-rows/hui-input-select-entity-row.ts b/src/panels/lovelace/entity-rows/hui-input-select-entity-row.ts index 87e53f6e0aab..32f71363273c 100644 --- a/src/panels/lovelace/entity-rows/hui-input-select-entity-row.ts +++ b/src/panels/lovelace/entity-rows/hui-input-select-entity-row.ts @@ -18,7 +18,7 @@ import "../components/hui-warning"; import { computeStateName } from "../../../common/entity/compute_state_name"; import { HomeAssistant, InputSelectEntity } from "../../../types"; -import { EntityRow } from "./types"; +import { LovelaceRow } from "./types"; import { setInputSelectOption } from "../../../data/input-select"; import { hasConfigOrEntityChanged } from "../common/has-changed"; import { forwardHaptic } from "../../../data/haptics"; @@ -33,7 +33,7 @@ import { ActionHandlerEvent } from "../../../data/lovelace"; import { handleAction } from "../common/handle-action"; @customElement("hui-input-select-entity-row") -class HuiInputSelectEntityRow extends LitElement implements EntityRow { +class HuiInputSelectEntityRow extends LitElement implements LovelaceRow { @property() public hass?: HomeAssistant; @property() private _config?: EntitiesCardEntityConfig; diff --git a/src/panels/lovelace/entity-rows/hui-input-text-entity-row.ts b/src/panels/lovelace/entity-rows/hui-input-text-entity-row.ts index 586441e16f1a..538c5cd736a9 100644 --- a/src/panels/lovelace/entity-rows/hui-input-text-entity-row.ts +++ b/src/panels/lovelace/entity-rows/hui-input-text-entity-row.ts @@ -12,12 +12,12 @@ import "../components/hui-generic-entity-row"; import "../components/hui-warning"; import { HomeAssistant } from "../../../types"; -import { EntityRow, EntityConfig } from "./types"; +import { LovelaceRow, EntityConfig } from "./types"; import { setValue } from "../../../data/input_text"; import { hasConfigOrEntityChanged } from "../common/has-changed"; @customElement("hui-input-text-entity-row") -class HuiInputTextEntityRow extends LitElement implements EntityRow { +class HuiInputTextEntityRow extends LitElement implements LovelaceRow { @property() public hass?: HomeAssistant; @property() private _config?: EntityConfig; diff --git a/src/panels/lovelace/entity-rows/hui-lock-entity-row.ts b/src/panels/lovelace/entity-rows/hui-lock-entity-row.ts index fd08fec0c47b..d58025ebe58a 100644 --- a/src/panels/lovelace/entity-rows/hui-lock-entity-row.ts +++ b/src/panels/lovelace/entity-rows/hui-lock-entity-row.ts @@ -13,11 +13,11 @@ import "../components/hui-generic-entity-row"; import "../components/hui-warning"; import { HomeAssistant } from "../../../types"; -import { EntityRow, EntityConfig } from "./types"; +import { LovelaceRow, EntityConfig } from "./types"; import { hasConfigOrEntityChanged } from "../common/has-changed"; @customElement("hui-lock-entity-row") -class HuiLockEntityRow extends LitElement implements EntityRow { +class HuiLockEntityRow extends LitElement implements LovelaceRow { @property() public hass?: HomeAssistant; @property() private _config?: EntityConfig; diff --git a/src/panels/lovelace/entity-rows/hui-media-player-entity-row.ts b/src/panels/lovelace/entity-rows/hui-media-player-entity-row.ts index cd3f0fe07490..30c1352c4fac 100644 --- a/src/panels/lovelace/entity-rows/hui-media-player-entity-row.ts +++ b/src/panels/lovelace/entity-rows/hui-media-player-entity-row.ts @@ -13,7 +13,7 @@ import "@polymer/paper-icon-button/paper-icon-button"; import "../components/hui-generic-entity-row"; import "../components/hui-warning"; -import { EntityRow, EntityConfig } from "./types"; +import { LovelaceRow, EntityConfig } from "./types"; import { HomeAssistant } from "../../../types"; import { HassEntity } from "home-assistant-js-websocket"; import { supportsFeature } from "../../../common/entity/supports-feature"; @@ -26,7 +26,7 @@ import { import { hasConfigOrEntityChanged } from "../common/has-changed"; @customElement("hui-media-player-entity-row") -class HuiMediaPlayerEntityRow extends LitElement implements EntityRow { +class HuiMediaPlayerEntityRow extends LitElement implements LovelaceRow { @property() public hass?: HomeAssistant; @property() private _config?: EntityConfig; diff --git a/src/panels/lovelace/entity-rows/hui-scene-entity-row.ts b/src/panels/lovelace/entity-rows/hui-scene-entity-row.ts index 14553512f267..afbfb57b97a1 100644 --- a/src/panels/lovelace/entity-rows/hui-scene-entity-row.ts +++ b/src/panels/lovelace/entity-rows/hui-scene-entity-row.ts @@ -14,12 +14,12 @@ import "../../../components/entity/ha-entity-toggle"; import "../components/hui-warning"; import { HomeAssistant } from "../../../types"; -import { EntityRow, EntityConfig } from "./types"; +import { LovelaceRow, EntityConfig } from "./types"; import { hasConfigOrEntityChanged } from "../common/has-changed"; import { activateScene } from "../../../data/scene"; @customElement("hui-scene-entity-row") -class HuiSceneEntityRow extends LitElement implements EntityRow { +class HuiSceneEntityRow extends LitElement implements LovelaceRow { @property() public hass!: HomeAssistant; @property() private _config?: EntityConfig; diff --git a/src/panels/lovelace/entity-rows/hui-script-entity-row.ts b/src/panels/lovelace/entity-rows/hui-script-entity-row.ts index b11e144497d5..18d7ec016b8c 100644 --- a/src/panels/lovelace/entity-rows/hui-script-entity-row.ts +++ b/src/panels/lovelace/entity-rows/hui-script-entity-row.ts @@ -14,11 +14,11 @@ import "../../../components/entity/ha-entity-toggle"; import "../components/hui-warning"; import { HomeAssistant } from "../../../types"; -import { EntityRow, EntityConfig } from "./types"; +import { LovelaceRow, EntityConfig } from "./types"; import { hasConfigOrEntityChanged } from "../common/has-changed"; @customElement("hui-script-entity-row") -class HuiScriptEntityRow extends LitElement implements EntityRow { +class HuiScriptEntityRow extends LitElement implements LovelaceRow { public hass?: HomeAssistant; @property() private _config?: EntityConfig; diff --git a/src/panels/lovelace/entity-rows/hui-sensor-entity-row.ts b/src/panels/lovelace/entity-rows/hui-sensor-entity-row.ts index e415f717c9b1..91bd4090f3f7 100644 --- a/src/panels/lovelace/entity-rows/hui-sensor-entity-row.ts +++ b/src/panels/lovelace/entity-rows/hui-sensor-entity-row.ts @@ -14,7 +14,7 @@ import "../components/hui-timestamp-display"; import "../components/hui-warning"; import { HomeAssistant } from "../../../types"; -import { EntityRow, EntityConfig } from "./types"; +import { LovelaceRow, EntityConfig } from "./types"; import { hasConfigOrEntityChanged } from "../common/has-changed"; import { computeStateDisplay } from "../../../common/entity/compute_state_display"; @@ -23,7 +23,7 @@ interface SensorEntityConfig extends EntityConfig { } @customElement("hui-sensor-entity-row") -class HuiSensorEntityRow extends LitElement implements EntityRow { +class HuiSensorEntityRow extends LitElement implements LovelaceRow { @property() public hass?: HomeAssistant; @property() private _config?: SensorEntityConfig; diff --git a/src/panels/lovelace/entity-rows/hui-text-entity-row.ts b/src/panels/lovelace/entity-rows/hui-text-entity-row.ts index 4ca97ad0ceac..6dc2aa14ae43 100644 --- a/src/panels/lovelace/entity-rows/hui-text-entity-row.ts +++ b/src/panels/lovelace/entity-rows/hui-text-entity-row.ts @@ -14,11 +14,11 @@ import "../components/hui-warning"; import { computeStateDisplay } from "../../../common/entity/compute_state_display"; import { HomeAssistant } from "../../../types"; -import { EntityRow, EntityConfig } from "./types"; +import { LovelaceRow, EntityConfig } from "./types"; import { hasConfigOrEntityChanged } from "../common/has-changed"; @customElement("hui-text-entity-row") -class HuiTextEntityRow extends LitElement implements EntityRow { +class HuiTextEntityRow extends LitElement implements LovelaceRow { @property() public hass?: HomeAssistant; @property() private _config?: EntityConfig; diff --git a/src/panels/lovelace/entity-rows/hui-toggle-entity-row.ts b/src/panels/lovelace/entity-rows/hui-toggle-entity-row.ts index b8f636b3ad77..0ecb735c2731 100644 --- a/src/panels/lovelace/entity-rows/hui-toggle-entity-row.ts +++ b/src/panels/lovelace/entity-rows/hui-toggle-entity-row.ts @@ -13,11 +13,11 @@ import "../components/hui-warning"; import { computeStateDisplay } from "../../../common/entity/compute_state_display"; import { HomeAssistant } from "../../../types"; -import { EntityRow, EntityConfig } from "./types"; +import { LovelaceRow, EntityConfig } from "./types"; import { hasConfigOrEntityChanged } from "../common/has-changed"; @customElement("hui-toggle-entity-row") -class HuiToggleEntityRow extends LitElement implements EntityRow { +class HuiToggleEntityRow extends LitElement implements LovelaceRow { @property() public hass?: HomeAssistant; @property() private _config?: EntityConfig; diff --git a/src/panels/lovelace/entity-rows/types.ts b/src/panels/lovelace/entity-rows/types.ts index b4819692665f..06fedc56369e 100644 --- a/src/panels/lovelace/entity-rows/types.ts +++ b/src/panels/lovelace/entity-rows/types.ts @@ -1,4 +1,5 @@ import { HomeAssistant } from "../../../types"; +import { Condition } from "../common/validate-condition"; export interface EntityConfig { entity: string; @@ -30,6 +31,11 @@ export interface CallServiceConfig extends EntityConfig { service: string; service_data?: { [key: string]: any }; } +export interface ConditionalRowConfig extends EntityConfig { + type: "conditional"; + row: EntityRowConfig; + conditions: Condition[]; +} export interface CastConfig { type: "cast"; icon: string; @@ -46,7 +52,7 @@ export type EntityRowConfig = | CallServiceConfig | CastConfig; -export interface EntityRow extends HTMLElement { +export interface LovelaceRow extends HTMLElement { hass?: HomeAssistant; setConfig(config: EntityRowConfig); } diff --git a/src/panels/lovelace/special-rows/hui-call-service-row.ts b/src/panels/lovelace/special-rows/hui-call-service-row.ts index 8226581b0b1e..fb724bce8107 100644 --- a/src/panels/lovelace/special-rows/hui-call-service-row.ts +++ b/src/panels/lovelace/special-rows/hui-call-service-row.ts @@ -12,11 +12,11 @@ import "@material/mwc-button"; import "../../../components/ha-icon"; import { callService } from "../common/call-service"; -import { EntityRow, CallServiceConfig } from "../entity-rows/types"; +import { LovelaceRow, CallServiceConfig } from "../entity-rows/types"; import { HomeAssistant } from "../../../types"; @customElement("hui-call-service-row") -class HuiCallServiceRow extends LitElement implements EntityRow { +class HuiCallServiceRow extends LitElement implements LovelaceRow { public hass?: HomeAssistant; @property() private _config?: CallServiceConfig; diff --git a/src/panels/lovelace/special-rows/hui-cast-row.ts b/src/panels/lovelace/special-rows/hui-cast-row.ts index 9b5bc7eda20a..a1d2920b4b04 100644 --- a/src/panels/lovelace/special-rows/hui-cast-row.ts +++ b/src/panels/lovelace/special-rows/hui-cast-row.ts @@ -9,7 +9,7 @@ import { } from "lit-element"; import { classMap } from "lit-html/directives/class-map"; -import { EntityRow, CastConfig } from "../entity-rows/types"; +import { LovelaceRow, CastConfig } from "../entity-rows/types"; import { HomeAssistant } from "../../../types"; import "../../../components/ha-icon"; @@ -20,7 +20,7 @@ import { } from "../../../cast/receiver_messages"; @customElement("hui-cast-row") -class HuiCastRow extends LitElement implements EntityRow { +class HuiCastRow extends LitElement implements LovelaceRow { public hass!: HomeAssistant; @property() private _config?: CastConfig; diff --git a/src/panels/lovelace/special-rows/hui-conditional-row.ts b/src/panels/lovelace/special-rows/hui-conditional-row.ts new file mode 100644 index 000000000000..a4147e847a8e --- /dev/null +++ b/src/panels/lovelace/special-rows/hui-conditional-row.ts @@ -0,0 +1,67 @@ +import { customElement, property, UpdatingElement } from "lit-element"; + +import { createRowElement } from "../common/create-row-element"; +import { + checkConditionsMet, + validateConditionalConfig, +} from "../../lovelace/common/validate-condition"; +import { HomeAssistant } from "../../../types"; +import { LovelaceRow, ConditionalRowConfig } from "../entity-rows/types"; + +@customElement("hui-conditional-row") +class HuiConditionalRow extends UpdatingElement implements LovelaceRow { + @property() public hass?: HomeAssistant; + @property() private _config?: ConditionalRowConfig; + private _row?: LovelaceRow; + + public setConfig(config) { + if (!config.row) { + throw new Error("No row option configured."); + } + + if (!config.conditions) { + throw new Error("No conditions option configured."); + } + + if (!Array.isArray(config.conditions)) { + throw new Error("conditions option is not an array"); + } + + if (!validateConditionalConfig(config.conditions)) { + throw new Error("conditions option is invalid."); + } + + if (this._row && this._row.parentElement) { + this.removeChild(this._row); + } + + this._config = config; + this._row = createRowElement(config.row) as LovelaceRow; + } + + protected update() { + if (!this._row || !this.hass) { + return; + } + + const visible = + this._config && checkConditionsMet(this._config.conditions, this.hass); + + if (visible) { + this._row.hass = this.hass; + if (!this._row.parentElement) { + this.appendChild(this._row); + } + } else if (this._row.parentElement) { + this.removeChild(this._row); + } + // This will hide the complete row so it won't get styled by parent + this.style.setProperty("display", visible ? "" : "none"); + } +} + +declare global { + interface HTMLElementTagNameMap { + "hui-conditional-row": HuiConditionalRow; + } +} diff --git a/src/panels/lovelace/special-rows/hui-divider-row.ts b/src/panels/lovelace/special-rows/hui-divider-row.ts index 0f6df4cee156..3e50cd2a42b2 100644 --- a/src/panels/lovelace/special-rows/hui-divider-row.ts +++ b/src/panels/lovelace/special-rows/hui-divider-row.ts @@ -6,11 +6,11 @@ import { property, } from "lit-element"; -import { EntityRow, DividerConfig } from "../entity-rows/types"; +import { LovelaceRow, DividerConfig } from "../entity-rows/types"; import { HomeAssistant } from "../../../types"; @customElement("hui-divider-row") -class HuiDividerRow extends LitElement implements EntityRow { +class HuiDividerRow extends LitElement implements LovelaceRow { public hass?: HomeAssistant; @property() private _config?: DividerConfig; diff --git a/src/panels/lovelace/special-rows/hui-section-row.ts b/src/panels/lovelace/special-rows/hui-section-row.ts index 21f09f10bc00..30a151365ae7 100644 --- a/src/panels/lovelace/special-rows/hui-section-row.ts +++ b/src/panels/lovelace/special-rows/hui-section-row.ts @@ -8,13 +8,13 @@ import { CSSResult, } from "lit-element"; -import { EntityRow, SectionConfig } from "../entity-rows/types"; +import { LovelaceRow, SectionConfig } from "../entity-rows/types"; import { HomeAssistant } from "../../../types"; import "../../../components/ha-icon"; @customElement("hui-section-row") -class HuiSectionRow extends LitElement implements EntityRow { +class HuiSectionRow extends LitElement implements LovelaceRow { public hass?: HomeAssistant; @property() private _config?: SectionConfig; diff --git a/src/panels/lovelace/special-rows/hui-weblink-row.ts b/src/panels/lovelace/special-rows/hui-weblink-row.ts index 247ba45aea1b..067698810eef 100644 --- a/src/panels/lovelace/special-rows/hui-weblink-row.ts +++ b/src/panels/lovelace/special-rows/hui-weblink-row.ts @@ -8,13 +8,13 @@ import { CSSResult, } from "lit-element"; -import { EntityRow, WeblinkConfig } from "../entity-rows/types"; +import { LovelaceRow, WeblinkConfig } from "../entity-rows/types"; import { HomeAssistant } from "../../../types"; import "../../../components/ha-icon"; @customElement("hui-weblink-row") -class HuiWeblinkRow extends LitElement implements EntityRow { +class HuiWeblinkRow extends LitElement implements LovelaceRow { public hass?: HomeAssistant; @property() private _config?: WeblinkConfig;