diff --git a/gallery/src/pages/automation/editor-condition.ts b/gallery/src/pages/automation/editor-condition.ts index 3a43eda71e..ed30c74272 100644 --- a/gallery/src/pages/automation/editor-condition.ts +++ b/gallery/src/pages/automation/editor-condition.ts @@ -80,7 +80,7 @@ const SCHEMAS: { name: string; conditions: ConditionWithShorthand[] }[] = [ ]; @customElement("demo-automation-editor-condition") -class DemoHaAutomationEditorCondition extends LitElement { +export class DemoAutomationEditorCondition extends LitElement { @state() private hass!: HomeAssistant; @state() private _disabled = false; @@ -155,6 +155,6 @@ class DemoHaAutomationEditorCondition extends LitElement { declare global { interface HTMLElementTagNameMap { - "demo-ha-automation-editor-condition": DemoHaAutomationEditorCondition; + "demo-automation-editor-condition": DemoAutomationEditorCondition; } } diff --git a/gallery/src/pages/automation/editor-trigger.ts b/gallery/src/pages/automation/editor-trigger.ts index 30c9721256..1ed11eb0a8 100644 --- a/gallery/src/pages/automation/editor-trigger.ts +++ b/gallery/src/pages/automation/editor-trigger.ts @@ -126,7 +126,7 @@ const SCHEMAS: { name: string; triggers: Trigger[] }[] = [ ]; @customElement("demo-automation-editor-trigger") -class DemoHaAutomationEditorTrigger extends LitElement { +export class DemoAutomationEditorTrigger extends LitElement { @state() private hass!: HomeAssistant; @state() private _disabled = false; @@ -201,6 +201,6 @@ class DemoHaAutomationEditorTrigger extends LitElement { declare global { interface HTMLElementTagNameMap { - "demo-ha-automation-editor-trigger": DemoHaAutomationEditorTrigger; + "demo-automation-editor-trigger": DemoAutomationEditorTrigger; } } diff --git a/gallery/src/pages/lovelace/media-player-row.ts b/gallery/src/pages/lovelace/media-player-row.ts index 44433bc089..eeba128c06 100644 --- a/gallery/src/pages/lovelace/media-player-row.ts +++ b/gallery/src/pages/lovelace/media-player-row.ts @@ -55,7 +55,7 @@ const CONFIGS = [ ]; @customElement("demo-lovelace-media-player-row") -class DemoHuiMediaPlayerRow extends LitElement { +export class DemoLovelaceMediaPlayerRow extends LitElement { @query("#demos") private _demoRoot!: HTMLElement; protected render(): TemplateResult { @@ -73,6 +73,6 @@ class DemoHuiMediaPlayerRow extends LitElement { declare global { interface HTMLElementTagNameMap { - "demo-lovelace-media-player-rows": DemoHuiMediaPlayerRow; + "demo-lovelace-media-player-row": DemoLovelaceMediaPlayerRow; } } diff --git a/gallery/src/pages/misc/util-long-press.ts b/gallery/src/pages/misc/util-long-press.ts index 7ce2106ba2..05b4f6291e 100644 --- a/gallery/src/pages/misc/util-long-press.ts +++ b/gallery/src/pages/misc/util-long-press.ts @@ -59,3 +59,9 @@ export class DemoUtilLongPress extends LitElement { } `; } + +declare global { + interface HTMLElementTagNameMap { + "demo-misc-util-long-press": DemoUtilLongPress; + } +} diff --git a/hassio/src/addon-store/hassio-addon-repository.ts b/hassio/src/addon-store/hassio-addon-repository.ts index 477a4361ab..3c7ee01566 100644 --- a/hassio/src/addon-store/hassio-addon-repository.ts +++ b/hassio/src/addon-store/hassio-addon-repository.ts @@ -140,3 +140,9 @@ export class HassioAddonRepositoryEl extends LitElement { ]; } } + +declare global { + interface HTMLElementTagNameMap { + "hassio-addon-repository": HassioAddonRepositoryEl; + } +} diff --git a/hassio/src/addon-store/hassio-addon-store.ts b/hassio/src/addon-store/hassio-addon-store.ts index a918c34820..695f41df6d 100644 --- a/hassio/src/addon-store/hassio-addon-store.ts +++ b/hassio/src/addon-store/hassio-addon-store.ts @@ -248,3 +248,9 @@ export class HassioAddonStore extends LitElement { `; } } + +declare global { + interface HTMLElementTagNameMap { + "hassio-addon-store": HassioAddonStore; + } +} diff --git a/hassio/src/dashboard/hassio-update.ts b/hassio/src/dashboard/hassio-update.ts index b331dc7609..b79aa14f18 100644 --- a/hassio/src/dashboard/hassio-update.ts +++ b/hassio/src/dashboard/hassio-update.ts @@ -151,3 +151,9 @@ export class HassioUpdate extends LitElement { ]; } } + +declare global { + interface HTMLElementTagNameMap { + "hassio-update": HassioUpdate; + } +} diff --git a/src/auth/ha-authorize.ts b/src/auth/ha-authorize.ts index 6af166f067..97fc3ef479 100644 --- a/src/auth/ha-authorize.ts +++ b/src/auth/ha-authorize.ts @@ -352,3 +352,9 @@ export class HaAuthorize extends litLocalizeLiteMixin(LitElement) { } } } + +declare global { + interface HTMLElementTagNameMap { + "ha-authorize": HaAuthorize; + } +} diff --git a/src/auth/ha-pick-auth-provider.ts b/src/auth/ha-pick-auth-provider.ts index 90a5c238b6..e26030146c 100644 --- a/src/auth/ha-pick-auth-provider.ts +++ b/src/auth/ha-pick-auth-provider.ts @@ -8,6 +8,9 @@ import "../components/ha-list-item"; import { AuthProvider } from "../data/auth"; declare global { + interface HTMLElementTagNameMap { + "ha-pick-auth-provider": HaPickAuthProvider; + } interface HASSDomEvents { "pick-auth-provider": AuthProvider; } diff --git a/src/components/entity/ha-entity-toggle.ts b/src/components/entity/ha-entity-toggle.ts index 223b208e1e..ba1da0e6a9 100644 --- a/src/components/entity/ha-entity-toggle.ts +++ b/src/components/entity/ha-entity-toggle.ts @@ -1,18 +1,18 @@ import { mdiFlash, mdiFlashOff } from "@mdi/js"; import { HassEntity } from "home-assistant-js-websocket"; import { - css, CSSResultGroup, - html, LitElement, PropertyValues, TemplateResult, + css, + html, } from "lit"; -import { property, state } from "lit/decorators"; +import { customElement, property, state } from "lit/decorators"; import { STATES_OFF } from "../../common/const"; import { computeStateDomain } from "../../common/entity/compute_state_domain"; import { computeStateName } from "../../common/entity/compute_state_name"; -import { isUnavailableState, UNAVAILABLE, UNKNOWN } from "../../data/entity"; +import { UNAVAILABLE, UNKNOWN, isUnavailableState } from "../../data/entity"; import { forwardHaptic } from "../../data/haptics"; import { HomeAssistant } from "../../types"; import "../ha-formfield"; @@ -24,6 +24,7 @@ const isOn = (stateObj?: HassEntity) => !STATES_OFF.includes(stateObj.state) && !isUnavailableState(stateObj.state); +@customElement("ha-entity-toggle") export class HaEntityToggle extends LitElement { // hass is not a property so that we only re-render on stateObj changes public hass?: HomeAssistant; @@ -175,4 +176,8 @@ export class HaEntityToggle extends LitElement { } } -customElements.define("ha-entity-toggle", HaEntityToggle); +declare global { + interface HTMLElementTagNameMap { + "ha-entity-toggle": HaEntityToggle; + } +} diff --git a/src/components/ha-gauge.ts b/src/components/ha-gauge.ts index 53b573dc47..de8322e1d8 100644 --- a/src/components/ha-gauge.ts +++ b/src/components/ha-gauge.ts @@ -19,7 +19,7 @@ export interface LevelDefinition { } @customElement("ha-gauge") -export class Gauge extends LitElement { +export class HaGauge extends LitElement { @property({ type: Number }) public min = 0; @property({ type: Number }) public max = 100; @@ -216,3 +216,9 @@ export class Gauge extends LitElement { `; } } + +declare global { + interface HTMLElementTagNameMap { + "ha-gauge": HaGauge; + } +} diff --git a/src/components/ha-qr-code.ts b/src/components/ha-qr-code.ts index f6a686d068..2c0228e9a4 100644 --- a/src/components/ha-qr-code.ts +++ b/src/components/ha-qr-code.ts @@ -112,3 +112,9 @@ export class HaQrCode extends LitElement { } `; } + +declare global { + interface HTMLElementTagNameMap { + "ha-qr-code": HaQrCode; + } +} diff --git a/src/components/ha-selector/ha-selector-backup-location.ts b/src/components/ha-selector/ha-selector-backup-location.ts index f20c447a7b..0a98806b83 100644 --- a/src/components/ha-selector/ha-selector-backup-location.ts +++ b/src/components/ha-selector/ha-selector-backup-location.ts @@ -41,6 +41,6 @@ export class HaBackupLocationSelector extends LitElement { declare global { interface HTMLElementTagNameMap { - "ha-selector-backup-location": HaBackupLocationSelector; + "ha-selector-backup_location": HaBackupLocationSelector; } } diff --git a/src/components/ha-selector/ha-selector-tts-voice.ts b/src/components/ha-selector/ha-selector-tts-voice.ts index dc6b0c0fdc..6098ed7ebb 100644 --- a/src/components/ha-selector/ha-selector-tts-voice.ts +++ b/src/components/ha-selector/ha-selector-tts-voice.ts @@ -47,6 +47,6 @@ export class HaTTSVoiceSelector extends LitElement { declare global { interface HTMLElementTagNameMap { - "ha-selector-tts-voice": HaTTSVoiceSelector; + "ha-selector-tts_voice": HaTTSVoiceSelector; } } diff --git a/src/components/ha-selector/ha-selector-ui-action.ts b/src/components/ha-selector/ha-selector-ui-action.ts index 7888ec1128..34c71d280d 100644 --- a/src/components/ha-selector/ha-selector-ui-action.ts +++ b/src/components/ha-selector/ha-selector-ui-action.ts @@ -39,6 +39,6 @@ export class HaSelectorUiAction extends LitElement { declare global { interface HTMLElementTagNameMap { - "ha-selector-ui-action": HaSelectorUiAction; + "ha-selector-ui_action": HaSelectorUiAction; } } diff --git a/src/components/ha-selector/ha-selector-ui-color.ts b/src/components/ha-selector/ha-selector-ui-color.ts index 4d77d1e213..c88c083f8e 100644 --- a/src/components/ha-selector/ha-selector-ui-color.ts +++ b/src/components/ha-selector/ha-selector-ui-color.ts @@ -36,6 +36,6 @@ export class HaSelectorUiColor extends LitElement { declare global { interface HTMLElementTagNameMap { - "ha-selector-ui-color": HaSelectorUiColor; + "ha-selector-ui_color": HaSelectorUiColor; } } diff --git a/src/components/ha-two-pane-top-app-bar-fixed.ts b/src/components/ha-two-pane-top-app-bar-fixed.ts index df6477534c..5cd5dbb2a2 100644 --- a/src/components/ha-two-pane-top-app-bar-fixed.ts +++ b/src/components/ha-two-pane-top-app-bar-fixed.ts @@ -17,7 +17,7 @@ export const passiveEventOptionsIfSupported = supportsPassiveEventListener : undefined; @customElement("ha-two-pane-top-app-bar-fixed") -export abstract class TopAppBarBaseBase extends BaseElement { +export class TopAppBarBaseBase extends BaseElement { protected override mdcFoundation!: MDCFixedTopAppBarFoundation; protected override mdcFoundationClass = MDCFixedTopAppBarFoundation; @@ -323,3 +323,9 @@ export abstract class TopAppBarBaseBase extends BaseElement { `, ]; } + +declare global { + interface HTMLElementTagNameMap { + "ha-two-pane-top-app-bar-fixed": TopAppBarBaseBase; + } +} diff --git a/src/panels/config/devices/device-detail/integration-elements/zha/ha-device-info-zha.ts b/src/panels/config/devices/device-detail/integration-elements/zha/ha-device-info-zha.ts index 227cfbd043..da52b4dd24 100644 --- a/src/panels/config/devices/device-detail/integration-elements/zha/ha-device-info-zha.ts +++ b/src/panels/config/devices/device-detail/integration-elements/zha/ha-device-info-zha.ts @@ -15,7 +15,7 @@ import { HomeAssistant } from "../../../../../../types"; import { formatAsPaddedHex } from "../../../../integrations/integration-panels/zha/functions"; @customElement("ha-device-info-zha") -export class HaDeviceActionsZha extends LitElement { +export class HaDeviceInfoZha extends LitElement { @property({ attribute: false }) public hass!: HomeAssistant; @property() public device!: DeviceRegistryEntry; @@ -98,3 +98,9 @@ export class HaDeviceActionsZha extends LitElement { ]; } } + +declare global { + interface HTMLElementTagNameMap { + "ha-device-info-zha": HaDeviceInfoZha; + } +} diff --git a/src/panels/config/entities/editor-tabs/settings/entity-settings-helper-tab.ts b/src/panels/config/entities/editor-tabs/settings/entity-settings-helper-tab.ts index 4aa5587994..dbe61afa3d 100644 --- a/src/panels/config/entities/editor-tabs/settings/entity-settings-helper-tab.ts +++ b/src/panels/config/entities/editor-tabs/settings/entity-settings-helper-tab.ts @@ -33,7 +33,7 @@ import "../../entity-registry-settings-editor"; import type { EntityRegistrySettingsEditor } from "../../entity-registry-settings-editor"; @customElement("entity-settings-helper-tab") -export class EntityRegistrySettingsHelper extends LitElement { +export class EntitySettingsHelperTab extends LitElement { @property({ attribute: false }) public hass!: HomeAssistant; @property() public entry!: ExtEntityRegistryEntry; @@ -226,6 +226,6 @@ export class EntityRegistrySettingsHelper extends LitElement { declare global { interface HTMLElementTagNameMap { - "entity-platform-helper-tab": EntityRegistrySettingsHelper; + "entity-settings-helper-tab": EntitySettingsHelperTab; } } diff --git a/src/panels/config/helpers/ha-config-helpers.ts b/src/panels/config/helpers/ha-config-helpers.ts index ac517776f3..1982716efc 100644 --- a/src/panels/config/helpers/ha-config-helpers.ts +++ b/src/panels/config/helpers/ha-config-helpers.ts @@ -418,3 +418,9 @@ export class HaConfigHelpers extends SubscribeMixin(LitElement) { showHelperDetailDialog(this, {}); } } + +declare global { + interface HTMLElementTagNameMap { + "ha-config-helpers": HaConfigHelpers; + } +} diff --git a/src/panels/config/integrations/integration-panels/matter/matter-config-dashboard.ts b/src/panels/config/integrations/integration-panels/matter/matter-config-dashboard.ts index 29e4a62650..9eaa14ec34 100644 --- a/src/panels/config/integrations/integration-panels/matter/matter-config-dashboard.ts +++ b/src/panels/config/integrations/integration-panels/matter/matter-config-dashboard.ts @@ -210,3 +210,9 @@ export class MatterConfigDashboard extends LitElement { `, ]; } + +declare global { + interface HTMLElementTagNameMap { + "matter-config-dashboard": MatterConfigDashboard; + } +} diff --git a/src/panels/config/integrations/integration-panels/mqtt/mqtt-config-panel.ts b/src/panels/config/integrations/integration-panels/mqtt/mqtt-config-panel.ts index 032ebf38ed..76ebc93326 100644 --- a/src/panels/config/integrations/integration-panels/mqtt/mqtt-config-panel.ts +++ b/src/panels/config/integrations/integration-panels/mqtt/mqtt-config-panel.ts @@ -16,7 +16,7 @@ import "./mqtt-subscribe-card"; const qosLevel = ["0", "1", "2"]; @customElement("mqtt-config-panel") -class HaPanelDevMqtt extends LitElement { +export class MQTTConfigPanel extends LitElement { @property({ attribute: false }) public hass!: HomeAssistant; @property({ type: Boolean }) public narrow!: boolean; @@ -248,6 +248,6 @@ class HaPanelDevMqtt extends LitElement { declare global { interface HTMLElementTagNameMap { - "developer-tools-mqtt": HaPanelDevMqtt; + "mqtt-config-panel": MQTTConfigPanel; } } diff --git a/src/panels/config/integrations/integration-panels/zha/zha-add-group-page.ts b/src/panels/config/integrations/integration-panels/zha/zha-add-group-page.ts index 367485563c..2b13eb3d08 100644 --- a/src/panels/config/integrations/integration-panels/zha/zha-add-group-page.ts +++ b/src/panels/config/integrations/integration-panels/zha/zha-add-group-page.ts @@ -198,3 +198,9 @@ export class ZHAAddGroupPage extends LitElement { ]; } } + +declare global { + interface HTMLElementTagNameMap { + "zha-add-group-page": ZHAAddGroupPage; + } +} diff --git a/src/panels/config/integrations/integration-panels/zha/zha-group-page.ts b/src/panels/config/integrations/integration-panels/zha/zha-group-page.ts index 7fde6ee13b..f765839206 100644 --- a/src/panels/config/integrations/integration-panels/zha/zha-group-page.ts +++ b/src/panels/config/integrations/integration-panels/zha/zha-group-page.ts @@ -324,3 +324,9 @@ export class ZHAGroupPage extends LitElement { ]; } } + +declare global { + interface HTMLElementTagNameMap { + "zha-group-page": ZHAGroupPage; + } +} diff --git a/src/panels/config/integrations/integration-panels/zha/zha-network-visualization-page.ts b/src/panels/config/integrations/integration-panels/zha/zha-network-visualization-page.ts index 706c0e9b73..2d9cd4bd94 100644 --- a/src/panels/config/integrations/integration-panels/zha/zha-network-visualization-page.ts +++ b/src/panels/config/integrations/integration-panels/zha/zha-network-visualization-page.ts @@ -472,3 +472,9 @@ export class ZHANetworkVisualizationPage extends LitElement { ]; } } + +declare global { + interface HTMLElementTagNameMap { + "zha-network-visualization-page": ZHANetworkVisualizationPage; + } +} diff --git a/src/panels/config/lovelace/dashboards/ha-config-lovelace-dashboards.ts b/src/panels/config/lovelace/dashboards/ha-config-lovelace-dashboards.ts index f246a48a1b..de05a5a0d6 100644 --- a/src/panels/config/lovelace/dashboards/ha-config-lovelace-dashboards.ts +++ b/src/panels/config/lovelace/dashboards/ha-config-lovelace-dashboards.ts @@ -407,3 +407,9 @@ export class HaConfigLovelaceDashboards extends LitElement { }); } } + +declare global { + interface HTMLElementTagNameMap { + "ha-config-lovelace-dashboards": HaConfigLovelaceDashboards; + } +} diff --git a/src/panels/config/lovelace/resources/ha-config-lovelace-resources.ts b/src/panels/config/lovelace/resources/ha-config-lovelace-resources.ts index ec4b8f77d5..71df3c3354 100644 --- a/src/panels/config/lovelace/resources/ha-config-lovelace-resources.ts +++ b/src/panels/config/lovelace/resources/ha-config-lovelace-resources.ts @@ -253,3 +253,9 @@ export class HaConfigLovelaceRescources extends LitElement { ]; } } + +declare global { + interface HTMLElementTagNameMap { + "ha-config-lovelace-resources": HaConfigLovelaceRescources; + } +} diff --git a/src/panels/config/person/ha-config-person.ts b/src/panels/config/person/ha-config-person.ts index 61a54c2582..60311cd901 100644 --- a/src/panels/config/person/ha-config-person.ts +++ b/src/panels/config/person/ha-config-person.ts @@ -2,7 +2,7 @@ import { mdiPlus } from "@mdi/js"; import "@polymer/paper-item/paper-icon-item"; import "@polymer/paper-item/paper-item-body"; import { css, CSSResultGroup, html, LitElement, nothing } from "lit"; -import { property, state } from "lit/decorators"; +import { customElement, property, state } from "lit/decorators"; import { stringCompare } from "../../../common/string/compare"; import "../../../components/ha-card"; import "../../../components/ha-fab"; @@ -31,7 +31,8 @@ import { showPersonDetailDialog, } from "./show-dialog-person-detail"; -class HaConfigPerson extends LitElement { +@customElement("ha-config-person") +export class HaConfigPerson extends LitElement { @property({ attribute: false }) public hass?: HomeAssistant; @property() public isWide?: boolean; @@ -292,4 +293,8 @@ class HaConfigPerson extends LitElement { } } -customElements.define("ha-config-person", HaConfigPerson); +declare global { + interface HTMLElementTagNameMap { + "ha-config-person": HaConfigPerson; + } +} diff --git a/src/panels/config/voice-assistants/ha-config-voice-assistants-assistants.ts b/src/panels/config/voice-assistants/ha-config-voice-assistants-assistants.ts index e88e0d9128..c932806fa8 100644 --- a/src/panels/config/voice-assistants/ha-config-voice-assistants-assistants.ts +++ b/src/panels/config/voice-assistants/ha-config-voice-assistants-assistants.ts @@ -96,3 +96,9 @@ export class HaConfigVoiceAssistantsAssistants extends LitElement { } `; } + +declare global { + interface HTMLElementTagNameMap { + "ha-config-voice-assistants-assistants": HaConfigVoiceAssistantsAssistants; + } +} diff --git a/src/panels/config/zone/ha-config-zone.ts b/src/panels/config/zone/ha-config-zone.ts index c3e302cdd7..cbe1af87dd 100644 --- a/src/panels/config/zone/ha-config-zone.ts +++ b/src/panels/config/zone/ha-config-zone.ts @@ -548,3 +548,9 @@ export class HaConfigZone extends SubscribeMixin(LitElement) { `; } } + +declare global { + interface HTMLElementTagNameMap { + "ha-config-zone": HaConfigZone; + } +} diff --git a/src/panels/energy/strategies/energy-view-strategy.ts b/src/panels/energy/strategies/energy-view-strategy.ts index 0ca612065d..27a0a91371 100644 --- a/src/panels/energy/strategies/energy-view-strategy.ts +++ b/src/panels/energy/strategies/energy-view-strategy.ts @@ -166,3 +166,9 @@ export class EnergyViewStrategy extends ReactiveElement { return view; } } + +declare global { + interface HTMLElementTagNameMap { + "energy-view-strategy": EnergyViewStrategy; + } +} diff --git a/src/panels/logbook/ha-panel-logbook.ts b/src/panels/logbook/ha-panel-logbook.ts index d192b53edb..2d4b754f54 100644 --- a/src/panels/logbook/ha-panel-logbook.ts +++ b/src/panels/logbook/ha-panel-logbook.ts @@ -274,3 +274,9 @@ export class HaPanelLogbook extends LitElement { ]; } } + +declare global { + interface HTMLElementTagNameMap { + "ha-panel-logbook": HaPanelLogbook; + } +} diff --git a/src/panels/lovelace/badges/hui-entity-filter-badge.ts b/src/panels/lovelace/badges/hui-entity-filter-badge.ts index a45799695a..04cdd94a0f 100644 --- a/src/panels/lovelace/badges/hui-entity-filter-badge.ts +++ b/src/panels/lovelace/badges/hui-entity-filter-badge.ts @@ -1,5 +1,5 @@ import { PropertyValues, ReactiveElement } from "lit"; -import { property, state } from "lit/decorators"; +import { customElement, property, state } from "lit/decorators"; import { HomeAssistant } from "../../../types"; import { evaluateFilter } from "../common/evaluate-filter"; import { processConfigEntities } from "../common/process-config-entities"; @@ -8,7 +8,11 @@ import { EntityFilterEntityConfig } from "../entity-rows/types"; import { LovelaceBadge } from "../types"; import { EntityFilterBadgeConfig } from "./types"; -class EntityFilterBadge extends ReactiveElement implements LovelaceBadge { +@customElement("hui-entity-filter-badge") +export class HuiEntityFilterBadge + extends ReactiveElement + implements LovelaceBadge +{ @property({ attribute: false }) public hass!: HomeAssistant; @state() private _config?: EntityFilterBadgeConfig; @@ -153,4 +157,9 @@ class EntityFilterBadge extends ReactiveElement implements LovelaceBadge { return false; } } -customElements.define("hui-entity-filter-badge", EntityFilterBadge); + +declare global { + interface HTMLElementTagNameMap { + "hui-entity-filter-badge": HuiEntityFilterBadge; + } +} diff --git a/src/panels/lovelace/cards/hui-entity-filter-card.ts b/src/panels/lovelace/cards/hui-entity-filter-card.ts index ebd649bc53..797d7114a7 100644 --- a/src/panels/lovelace/cards/hui-entity-filter-card.ts +++ b/src/panels/lovelace/cards/hui-entity-filter-card.ts @@ -1,5 +1,5 @@ import { PropertyValues, ReactiveElement } from "lit"; -import { property, state } from "lit/decorators"; +import { customElement, property, state } from "lit/decorators"; import { LovelaceCardConfig } from "../../../data/lovelace/config/card"; import { HomeAssistant } from "../../../types"; import { computeCardSize } from "../common/compute-card-size"; @@ -11,7 +11,11 @@ import { EntityFilterEntityConfig } from "../entity-rows/types"; import { LovelaceCard } from "../types"; import { EntityFilterCardConfig } from "./types"; -class EntityFilterCard extends ReactiveElement implements LovelaceCard { +@customElement("hui-entity-filter-card") +export class HuiEntityFilterCard + extends ReactiveElement + implements LovelaceCard +{ public static getStubConfig( hass: HomeAssistant, entities: string[], @@ -230,4 +234,9 @@ class EntityFilterCard extends ReactiveElement implements LovelaceCard { this._element = newCardEl; } } -customElements.define("hui-entity-filter-card", EntityFilterCard); + +declare global { + interface HTMLElementTagNameMap { + "hui-entity-filter-card": HuiEntityFilterCard; + } +} diff --git a/src/panels/lovelace/cards/hui-horizontal-stack-card.ts b/src/panels/lovelace/cards/hui-horizontal-stack-card.ts index 349f5867b7..72da14e3ea 100644 --- a/src/panels/lovelace/cards/hui-horizontal-stack-card.ts +++ b/src/panels/lovelace/cards/hui-horizontal-stack-card.ts @@ -1,8 +1,10 @@ import { css, CSSResultGroup } from "lit"; +import { customElement } from "lit/decorators"; import { computeCardSize } from "../common/compute-card-size"; import { HuiStackCard } from "./hui-stack-card"; -class HuiHorizontalStackCard extends HuiStackCard { +@customElement("hui-horizontal-stack-card") +export class HuiHorizontalStackCard extends HuiStackCard { public async getCardSize(): Promise { if (!this._cards) { return 0; @@ -48,8 +50,6 @@ class HuiHorizontalStackCard extends HuiStackCard { declare global { interface HTMLElementTagNameMap { - "hui-horitzontal-stack-card": HuiHorizontalStackCard; + "hui-horizontal-stack-card": HuiHorizontalStackCard; } } - -customElements.define("hui-horizontal-stack-card", HuiHorizontalStackCard); diff --git a/src/panels/lovelace/components/hui-generic-entity-row.ts b/src/panels/lovelace/components/hui-generic-entity-row.ts index 4a6c8d9209..d426fde1fd 100644 --- a/src/panels/lovelace/components/hui-generic-entity-row.ts +++ b/src/panels/lovelace/components/hui-generic-entity-row.ts @@ -6,7 +6,7 @@ import { html, nothing, } from "lit"; -import { property } from "lit/decorators"; +import { customElement, property } from "lit/decorators"; import { classMap } from "lit/directives/class-map"; import { ifDefined } from "lit/directives/if-defined"; import { DOMAINS_INPUT_ROW } from "../../../common/const"; @@ -24,7 +24,8 @@ import { handleAction } from "../common/handle-action"; import { hasAction } from "../common/has-action"; import { createEntityNotFoundWarning } from "./hui-warning"; -class HuiGenericEntityRow extends LitElement { +@customElement("hui-generic-entity-row") +export class HuiGenericEntityRow extends LitElement { @property({ attribute: false }) public hass?: HomeAssistant; @property() public config?: EntitiesCardEntityConfig; @@ -249,4 +250,9 @@ class HuiGenericEntityRow extends LitElement { `; } } -customElements.define("hui-generic-entity-row", HuiGenericEntityRow); + +declare global { + interface HTMLElementTagNameMap { + "hui-generic-entity-row": HuiGenericEntityRow; + } +} diff --git a/src/panels/lovelace/ha-panel-lovelace.ts b/src/panels/lovelace/ha-panel-lovelace.ts index 8b4cf33945..2ccca5e5d2 100644 --- a/src/panels/lovelace/ha-panel-lovelace.ts +++ b/src/panels/lovelace/ha-panel-lovelace.ts @@ -459,3 +459,9 @@ export class LovelacePanel extends LitElement { } } } + +declare global { + interface HTMLElementTagNameMap { + "ha-panel-lovelace": LovelacePanel; + } +} diff --git a/src/panels/lovelace/strategies/original-states-dashboard-strategy.ts b/src/panels/lovelace/strategies/original-states-dashboard-strategy.ts index 86f010d9a4..0c7ae3c14f 100644 --- a/src/panels/lovelace/strategies/original-states-dashboard-strategy.ts +++ b/src/panels/lovelace/strategies/original-states-dashboard-strategy.ts @@ -33,3 +33,9 @@ export class OriginalStatesDashboardStrategy extends ReactiveElement { ); } } + +declare global { + interface HTMLElementTagNameMap { + "original-states-dashboard-strategy": OriginalStatesDashboardStrategy; + } +} diff --git a/src/panels/lovelace/strategies/original-states-view-strategy.ts b/src/panels/lovelace/strategies/original-states-view-strategy.ts index 9fcf20e974..386f953fcf 100644 --- a/src/panels/lovelace/strategies/original-states-view-strategy.ts +++ b/src/panels/lovelace/strategies/original-states-view-strategy.ts @@ -75,3 +75,9 @@ export class OriginalStatesViewStrategy extends ReactiveElement { return view; } } + +declare global { + interface HTMLElementTagNameMap { + "original-states-view-strategy": OriginalStatesViewStrategy; + } +} diff --git a/src/state-summary/state-card-update.ts b/src/state-summary/state-card-update.ts index fc307cb372..85d34517a0 100755 --- a/src/state-summary/state-card-update.ts +++ b/src/state-summary/state-card-update.ts @@ -54,3 +54,9 @@ export class StateCardUpdate extends LitElement { ]; } } + +declare global { + interface HTMLElementTagNameMap { + "state-card-update": StateCardUpdate; + } +} diff --git a/tsconfig.json b/tsconfig.json index 0a45a72573..81f29f08d9 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -29,7 +29,7 @@ "rules": { // Custom elements "no-unclosed-tag": "warning", - "no-missing-element-type-definition": "warning", + "no-missing-element-type-definition": "error", // Binding names "no-legacy-attribute": "error", // Binding types