diff --git a/cast/src/launcher/layout/hc-cast.ts b/cast/src/launcher/layout/hc-cast.ts index 32139fa557..1a00cd62dd 100644 --- a/cast/src/launcher/layout/hc-cast.ts +++ b/cast/src/launcher/layout/hc-cast.ts @@ -8,6 +8,7 @@ import { html, LitElement, property, + internalProperty, TemplateResult, } from "lit-element"; import { CastManager } from "../../../../src/cast/cast_manager"; @@ -41,9 +42,9 @@ class HcCast extends LitElement { @property() public castManager!: CastManager; - @property() private askWrite = false; + @internalProperty() private askWrite = false; - @property() private lovelaceConfig?: LovelaceConfig | null; + @internalProperty() private lovelaceConfig?: LovelaceConfig | null; protected render(): TemplateResult { if (this.lovelaceConfig === undefined) { diff --git a/cast/src/launcher/layout/hc-connect.ts b/cast/src/launcher/layout/hc-connect.ts index 2aa72385e9..8f3e1272ee 100644 --- a/cast/src/launcher/layout/hc-connect.ts +++ b/cast/src/launcher/layout/hc-connect.ts @@ -17,8 +17,8 @@ import { customElement, html, LitElement, - property, TemplateResult, + internalProperty, } from "lit-element"; import { CastManager, getCastManager } from "../../../../src/cast/cast_manager"; import { castSendShowDemo } from "../../../../src/cast/receiver_messages"; @@ -60,19 +60,19 @@ const INTRO = html` @customElement("hc-connect") export class HcConnect extends LitElement { - @property() private loading = false; + @internalProperty() private loading = false; // If we had stored credentials but we cannot connect, // show a screen asking retry or logout. - @property() private cannotConnect = false; + @internalProperty() private cannotConnect = false; - @property() private error?: string | TemplateResult; + @internalProperty() private error?: string | TemplateResult; - @property() private auth?: Auth; + @internalProperty() private auth?: Auth; - @property() private connection?: Connection; + @internalProperty() private connection?: Connection; - @property() private castManager?: CastManager | null; + @internalProperty() private castManager?: CastManager | null; private openDemo = false; diff --git a/cast/src/receiver/layout/hc-demo.ts b/cast/src/receiver/layout/hc-demo.ts index b3c0fcab0e..5852111743 100644 --- a/cast/src/receiver/layout/hc-demo.ts +++ b/cast/src/receiver/layout/hc-demo.ts @@ -1,4 +1,10 @@ -import { customElement, html, property, TemplateResult } from "lit-element"; +import { + customElement, + html, + property, + internalProperty, + TemplateResult, +} from "lit-element"; import { mockHistory } from "../../../../demo/src/stubs/history"; import { LovelaceConfig } from "../../../../src/data/lovelace"; import { @@ -13,9 +19,9 @@ import "./hc-lovelace"; @customElement("hc-demo") class HcDemo extends HassElement { - @property() public lovelacePath!: string; + @property({ attribute: false }) public lovelacePath!: string; - @property() private _lovelaceConfig?: LovelaceConfig; + @internalProperty() private _lovelaceConfig?: LovelaceConfig; protected render(): TemplateResult { if (!this._lovelaceConfig) { diff --git a/cast/src/receiver/layout/hc-launch-screen.ts b/cast/src/receiver/layout/hc-launch-screen.ts index b2d729bf65..603f70f655 100644 --- a/cast/src/receiver/layout/hc-launch-screen.ts +++ b/cast/src/receiver/layout/hc-launch-screen.ts @@ -11,7 +11,7 @@ import { HomeAssistant } from "../../../../src/types"; @customElement("hc-launch-screen") class HcLaunchScreen extends LitElement { - @property() public hass?: HomeAssistant; + @property({ attribute: false }) public hass?: HomeAssistant; @property() public error?: string; diff --git a/cast/src/receiver/layout/hc-lovelace.ts b/cast/src/receiver/layout/hc-lovelace.ts index b8478cc370..bb3272c033 100644 --- a/cast/src/receiver/layout/hc-lovelace.ts +++ b/cast/src/receiver/layout/hc-lovelace.ts @@ -16,9 +16,9 @@ import "./hc-launch-screen"; @customElement("hc-lovelace") class HcLovelace extends LitElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; - @property() public lovelaceConfig!: LovelaceConfig; + @property({ attribute: false }) public lovelaceConfig!: LovelaceConfig; @property() public viewPath?: string | number; diff --git a/cast/src/receiver/layout/hc-main.ts b/cast/src/receiver/layout/hc-main.ts index d5f462ad1b..974c941d8b 100644 --- a/cast/src/receiver/layout/hc-main.ts +++ b/cast/src/receiver/layout/hc-main.ts @@ -3,7 +3,12 @@ import { getAuth, UnsubscribeFunc, } from "home-assistant-js-websocket"; -import { customElement, html, property, TemplateResult } from "lit-element"; +import { + customElement, + html, + internalProperty, + TemplateResult, +} from "lit-element"; import { CAST_NS } from "../../../../src/cast/const"; import { ConnectMessage, @@ -31,13 +36,13 @@ let resourcesLoaded = false; @customElement("hc-main") export class HcMain extends HassElement { - @property() private _showDemo = false; + @internalProperty() private _showDemo = false; - @property() private _lovelaceConfig?: LovelaceConfig; + @internalProperty() private _lovelaceConfig?: LovelaceConfig; - @property() private _lovelacePath: string | number | null = null; + @internalProperty() private _lovelacePath: string | number | null = null; - @property() private _error?: string; + @internalProperty() private _error?: string; private _unsubLovelace?: UnsubscribeFunc; diff --git a/demo/src/custom-cards/cast-demo-row.ts b/demo/src/custom-cards/cast-demo-row.ts index 746a0a2eae..9dae52a96d 100644 --- a/demo/src/custom-cards/cast-demo-row.ts +++ b/demo/src/custom-cards/cast-demo-row.ts @@ -4,7 +4,7 @@ import { customElement, html, LitElement, - property, + internalProperty, TemplateResult, } from "lit-element"; import { CastManager } from "../../../src/cast/cast_manager"; @@ -20,7 +20,7 @@ import { HomeAssistant } from "../../../src/types"; class CastDemoRow extends LitElement implements LovelaceRow { public hass!: HomeAssistant; - @property() private _castManager?: CastManager | null; + @internalProperty() private _castManager?: CastManager | null; public setConfig(_config: CastConfig): void { // No config possible. diff --git a/demo/src/custom-cards/ha-demo-card.ts b/demo/src/custom-cards/ha-demo-card.ts index f2cfa88a47..ad909a4e4f 100644 --- a/demo/src/custom-cards/ha-demo-card.ts +++ b/demo/src/custom-cards/ha-demo-card.ts @@ -5,6 +5,7 @@ import { html, LitElement, property, + internalProperty, TemplateResult, } from "lit-element"; import { until } from "lit-html/directives/until"; @@ -21,11 +22,11 @@ import { } from "../configs/demo-configs"; export class HADemoCard extends LitElement implements LovelaceCard { - @property() public lovelace?: Lovelace; + @property({ attribute: false }) public lovelace?: Lovelace; - @property() public hass!: MockHomeAssistant; + @property({ attribute: false }) public hass!: MockHomeAssistant; - @property() private _switching?: boolean; + @internalProperty() private _switching?: boolean; private _hidden = localStorage.hide_demo_card; diff --git a/hassio/src/addon-store/hassio-addon-repository.ts b/hassio/src/addon-store/hassio-addon-repository.ts index 9f78190a4c..c188e516b7 100644 --- a/hassio/src/addon-store/hassio-addon-repository.ts +++ b/hassio/src/addon-store/hassio-addon-repository.ts @@ -21,7 +21,7 @@ import { filterAndSort } from "../components/hassio-filter-addons"; import { hassioStyle } from "../resources/hassio-style"; class HassioAddonRepositoryEl extends LitElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; @property() public repo!: HassioAddonRepository; diff --git a/hassio/src/addon-store/hassio-addon-store.ts b/hassio/src/addon-store/hassio-addon-store.ts index 88dfb115c6..b72826b3c0 100644 --- a/hassio/src/addon-store/hassio-addon-store.ts +++ b/hassio/src/addon-store/hassio-addon-store.ts @@ -6,6 +6,7 @@ import { CSSResult, LitElement, property, + internalProperty, PropertyValues, } from "lit-element"; import { html, TemplateResult } from "lit-html"; @@ -52,7 +53,7 @@ class HassioAddonStore extends LitElement { @property({ attribute: false }) private _repos?: HassioAddonRepository[]; - @property() private _filter?: string; + @internalProperty() private _filter?: string; public async refreshData() { this._repos = undefined; diff --git a/hassio/src/addon-view/config/hassio-addon-audio.ts b/hassio/src/addon-view/config/hassio-addon-audio.ts index 8a7b4c08c5..17dde2fb41 100644 --- a/hassio/src/addon-view/config/hassio-addon-audio.ts +++ b/hassio/src/addon-view/config/hassio-addon-audio.ts @@ -9,6 +9,7 @@ import { html, LitElement, property, + internalProperty, PropertyValues, TemplateResult, } from "lit-element"; @@ -34,15 +35,15 @@ class HassioAddonAudio extends LitElement { @property({ attribute: false }) public addon!: HassioAddonDetails; - @property() private _error?: string; + @internalProperty() private _error?: string; - @property() private _inputDevices?: HassioHardwareAudioDevice[]; + @internalProperty() private _inputDevices?: HassioHardwareAudioDevice[]; - @property() private _outputDevices?: HassioHardwareAudioDevice[]; + @internalProperty() private _outputDevices?: HassioHardwareAudioDevice[]; - @property() private _selectedInput!: null | string; + @internalProperty() private _selectedInput!: null | string; - @property() private _selectedOutput!: null | string; + @internalProperty() private _selectedOutput!: null | string; protected render(): TemplateResult { return html` diff --git a/hassio/src/addon-view/config/hassio-addon-config.ts b/hassio/src/addon-view/config/hassio-addon-config.ts index 56eec34d95..2e3e4ee0cd 100644 --- a/hassio/src/addon-view/config/hassio-addon-config.ts +++ b/hassio/src/addon-view/config/hassio-addon-config.ts @@ -7,6 +7,7 @@ import { html, LitElement, property, + internalProperty, PropertyValues, query, TemplateResult, @@ -32,7 +33,7 @@ class HassioAddonConfig extends LitElement { @property({ attribute: false }) public addon!: HassioAddonDetails; - @property() private _error?: string; + @internalProperty() private _error?: string; @property({ type: Boolean }) private _configHasChanged = false; diff --git a/hassio/src/addon-view/config/hassio-addon-network.ts b/hassio/src/addon-view/config/hassio-addon-network.ts index 5a13e3ec9c..ea16c73a4a 100644 --- a/hassio/src/addon-view/config/hassio-addon-network.ts +++ b/hassio/src/addon-view/config/hassio-addon-network.ts @@ -6,6 +6,7 @@ import { html, LitElement, property, + internalProperty, PropertyValues, TemplateResult, } from "lit-element"; @@ -37,9 +38,9 @@ class HassioAddonNetwork extends LitElement { @property({ attribute: false }) public addon!: HassioAddonDetails; - @property() private _error?: string; + @internalProperty() private _error?: string; - @property() private _config?: NetworkItem[]; + @internalProperty() private _config?: NetworkItem[]; public connectedCallback(): void { super.connectedCallback(); diff --git a/hassio/src/addon-view/documentation/hassio-addon-documentation-tab.ts b/hassio/src/addon-view/documentation/hassio-addon-documentation-tab.ts index fa41b6b195..7e5b519886 100644 --- a/hassio/src/addon-view/documentation/hassio-addon-documentation-tab.ts +++ b/hassio/src/addon-view/documentation/hassio-addon-documentation-tab.ts @@ -5,6 +5,7 @@ import { html, LitElement, property, + internalProperty, TemplateResult, } from "lit-element"; import "../../../../src/components/ha-markdown"; @@ -24,9 +25,9 @@ class HassioAddonDocumentationDashboard extends LitElement { @property({ attribute: false }) public addon?: HassioAddonDetails; - @property() private _error?: string; + @internalProperty() private _error?: string; - @property() private _content?: string; + @internalProperty() private _content?: string; public async connectedCallback(): Promise { super.connectedCallback(); diff --git a/hassio/src/addon-view/info/hassio-addon-info.ts b/hassio/src/addon-view/info/hassio-addon-info.ts index 22a708d38e..89a2426199 100644 --- a/hassio/src/addon-view/info/hassio-addon-info.ts +++ b/hassio/src/addon-view/info/hassio-addon-info.ts @@ -23,6 +23,7 @@ import { html, LitElement, property, + internalProperty, TemplateResult, } from "lit-element"; import { classMap } from "lit-html/directives/class-map"; @@ -124,7 +125,7 @@ class HassioAddonInfo extends LitElement { @property({ attribute: false }) public addon!: HassioAddonDetails; - @property() private _error?: string; + @internalProperty() private _error?: string; @property({ type: Boolean }) private _installing = false; diff --git a/hassio/src/addon-view/log/hassio-addon-logs.ts b/hassio/src/addon-view/log/hassio-addon-logs.ts index 069b5f6c7a..e9f6703c2c 100644 --- a/hassio/src/addon-view/log/hassio-addon-logs.ts +++ b/hassio/src/addon-view/log/hassio-addon-logs.ts @@ -6,6 +6,7 @@ import { html, LitElement, property, + internalProperty, TemplateResult, } from "lit-element"; import "../../../../src/components/ha-card"; @@ -24,9 +25,9 @@ class HassioAddonLogs extends LitElement { @property({ attribute: false }) public addon!: HassioAddonDetails; - @property() private _error?: string; + @internalProperty() private _error?: string; - @property() private _content?: string; + @internalProperty() private _content?: string; public async connectedCallback(): Promise { super.connectedCallback(); diff --git a/hassio/src/components/hassio-card-content.ts b/hassio/src/components/hassio-card-content.ts index 015e131bd2..ee57a98ab8 100644 --- a/hassio/src/components/hassio-card-content.ts +++ b/hassio/src/components/hassio-card-content.ts @@ -14,7 +14,7 @@ import { HomeAssistant } from "../../../src/types"; @customElement("hassio-card-content") class HassioCardContent extends LitElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; @property() public title!: string; diff --git a/hassio/src/dashboard/hassio-addons.ts b/hassio/src/dashboard/hassio-addons.ts index 1ed58c2435..31e7450bb2 100644 --- a/hassio/src/dashboard/hassio-addons.ts +++ b/hassio/src/dashboard/hassio-addons.ts @@ -19,7 +19,7 @@ import { hassioStyle } from "../resources/hassio-style"; @customElement("hassio-addons") class HassioAddons extends LitElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; @property() public addons?: HassioAddonInfo[]; diff --git a/hassio/src/dashboard/hassio-update.ts b/hassio/src/dashboard/hassio-update.ts index 31e97cb8b2..2fee6b61dc 100644 --- a/hassio/src/dashboard/hassio-update.ts +++ b/hassio/src/dashboard/hassio-update.ts @@ -7,6 +7,7 @@ import { html, LitElement, property, + internalProperty, TemplateResult, } from "lit-element"; import "../../../src/components/buttons/ha-call-api-button"; @@ -23,15 +24,15 @@ import { hassioStyle } from "../resources/hassio-style"; @customElement("hassio-update") export class HassioUpdate extends LitElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; - @property() public hassInfo: HassioHomeAssistantInfo; + @property({ attribute: false }) public hassInfo: HassioHomeAssistantInfo; - @property() public hassOsInfo?: HassioHassOSInfo; + @property({ attribute: false }) public hassOsInfo?: HassioHassOSInfo; @property() public supervisorInfo: HassioSupervisorInfo; - @property() private _error?: string; + @internalProperty() private _error?: string; protected render(): TemplateResult { const updatesAvailable: number = [ diff --git a/hassio/src/dialogs/markdown/dialog-hassio-markdown.ts b/hassio/src/dialogs/markdown/dialog-hassio-markdown.ts index 8feae8e709..907904c8a3 100644 --- a/hassio/src/dialogs/markdown/dialog-hassio-markdown.ts +++ b/hassio/src/dialogs/markdown/dialog-hassio-markdown.ts @@ -5,6 +5,7 @@ import { html, LitElement, property, + internalProperty, TemplateResult, } from "lit-element"; import { createCloseHeading } from "../../../../src/components/ha-dialog"; @@ -16,13 +17,13 @@ import { HassioMarkdownDialogParams } from "./show-dialog-hassio-markdown"; @customElement("dialog-hassio-markdown") class HassioMarkdownDialog extends LitElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; @property() public title!: string; @property() public content!: string; - @property() private _opened = false; + @internalProperty() private _opened = false; public showDialog(params: HassioMarkdownDialogParams) { this.title = params.title; diff --git a/hassio/src/dialogs/repositories/dialog-hassio-repositories.ts b/hassio/src/dialogs/repositories/dialog-hassio-repositories.ts index d32bfd756c..0f9f42f860 100644 --- a/hassio/src/dialogs/repositories/dialog-hassio-repositories.ts +++ b/hassio/src/dialogs/repositories/dialog-hassio-repositories.ts @@ -13,6 +13,7 @@ import { html, LitElement, property, + internalProperty, query, TemplateResult, } from "lit-element"; @@ -39,11 +40,11 @@ class HassioRepositoriesDialog extends LitElement { @query("#repository_input") private _optionInput?: PaperInputElement; - @property() private _opened = false; + @internalProperty() private _opened = false; - @property() private _prosessing = false; + @internalProperty() private _prosessing = false; - @property() private _error?: string; + @internalProperty() private _error?: string; public async showDialog(_dialogParams: any): Promise { this._dialogParams = _dialogParams; diff --git a/hassio/src/dialogs/snapshot/dialog-hassio-snapshot.ts b/hassio/src/dialogs/snapshot/dialog-hassio-snapshot.ts index 589878b7aa..ff427aca5b 100755 --- a/hassio/src/dialogs/snapshot/dialog-hassio-snapshot.ts +++ b/hassio/src/dialogs/snapshot/dialog-hassio-snapshot.ts @@ -9,6 +9,7 @@ import { html, LitElement, property, + internalProperty, TemplateResult, } from "lit-element"; import { createCloseHeading } from "../../../../src/components/ha-dialog"; @@ -68,21 +69,21 @@ interface FolderItem { @customElement("dialog-hassio-snapshot") class HassioSnapshotDialog extends LitElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; - @property() private _error?: string; + @internalProperty() private _error?: string; - @property() private _snapshot?: HassioSnapshotDetail; + @internalProperty() private _snapshot?: HassioSnapshotDetail; - @property() private _folders!: FolderItem[]; + @internalProperty() private _folders!: FolderItem[]; - @property() private _addons!: AddonItem[]; + @internalProperty() private _addons!: AddonItem[]; - @property() private _dialogParams?: HassioSnapshotDialogParams; + @internalProperty() private _dialogParams?: HassioSnapshotDialogParams; - @property() private _snapshotPassword!: string; + @internalProperty() private _snapshotPassword!: string; - @property() private _restoreHass: boolean | null | undefined = true; + @internalProperty() private _restoreHass: boolean | null | undefined = true; public async showDialog(params: HassioSnapshotDialogParams) { this._snapshot = await fetchHassioSnapshotInfo(this.hass, params.slug); diff --git a/hassio/src/hassio-main.ts b/hassio/src/hassio-main.ts index 37abf78279..14d6833bed 100644 --- a/hassio/src/hassio-main.ts +++ b/hassio/src/hassio-main.ts @@ -1,5 +1,10 @@ import { PolymerElement } from "@polymer/polymer"; -import { customElement, property, PropertyValues } from "lit-element"; +import { + customElement, + property, + internalProperty, + PropertyValues, +} from "lit-element"; import { applyThemesOnElement } from "../../src/common/dom/apply_themes_on_element"; import { fireEvent } from "../../src/common/dom/fire_event"; import { navigate } from "../../src/common/navigate"; @@ -37,7 +42,7 @@ import "./hassio-panel"; @customElement("hassio-main") class HassioMain extends ProvideHassLitMixin(HassRouterPage) { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; @property() public panel!: HassioPanelInfo; @@ -73,15 +78,15 @@ class HassioMain extends ProvideHassLitMixin(HassRouterPage) { }, }; - @property() private _supervisorInfo: HassioSupervisorInfo; + @internalProperty() private _supervisorInfo: HassioSupervisorInfo; - @property() private _hostInfo: HassioHostInfo; + @internalProperty() private _hostInfo: HassioHostInfo; - @property() private _hassioInfo?: HassioInfo; + @internalProperty() private _hassioInfo?: HassioInfo; - @property() private _hassOsInfo?: HassioHassOSInfo; + @internalProperty() private _hassOsInfo?: HassioHassOSInfo; - @property() private _hassInfo: HassioHomeAssistantInfo; + @internalProperty() private _hassInfo: HassioHomeAssistantInfo; protected firstUpdated(changedProps: PropertyValues) { super.firstUpdated(changedProps); diff --git a/hassio/src/ingress-view/hassio-ingress-view.ts b/hassio/src/ingress-view/hassio-ingress-view.ts index a064f69a54..42cf1b373a 100644 --- a/hassio/src/ingress-view/hassio-ingress-view.ts +++ b/hassio/src/ingress-view/hassio-ingress-view.ts @@ -5,6 +5,7 @@ import { html, LitElement, property, + internalProperty, PropertyValues, TemplateResult, } from "lit-element"; @@ -19,11 +20,11 @@ import { HomeAssistant, Route } from "../../../src/types"; @customElement("hassio-ingress-view") class HassioIngressView extends LitElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; @property() public route!: Route; - @property() private _addon?: HassioAddonDetails; + @internalProperty() private _addon?: HassioAddonDetails; protected render(): TemplateResult { if (!this._addon) { diff --git a/hassio/src/snapshots/hassio-snapshots.ts b/hassio/src/snapshots/hassio-snapshots.ts index b26ef91157..79c8f35b2f 100644 --- a/hassio/src/snapshots/hassio-snapshots.ts +++ b/hassio/src/snapshots/hassio-snapshots.ts @@ -15,6 +15,7 @@ import { html, LitElement, property, + internalProperty, PropertyValues, TemplateResult, } from "lit-element"; @@ -56,19 +57,19 @@ class HassioSnapshots extends LitElement { @property({ attribute: false }) public supervisorInfo!: HassioSupervisorInfo; - @property() private _snapshotName = ""; + @internalProperty() private _snapshotName = ""; - @property() private _snapshotPassword = ""; + @internalProperty() private _snapshotPassword = ""; - @property() private _snapshotHasPassword = false; + @internalProperty() private _snapshotHasPassword = false; - @property() private _snapshotType: HassioSnapshot["type"] = "full"; + @internalProperty() private _snapshotType: HassioSnapshot["type"] = "full"; - @property() private _snapshots?: HassioSnapshot[] = []; + @internalProperty() private _snapshots?: HassioSnapshot[] = []; - @property() private _addonList: CheckboxItem[] = []; + @internalProperty() private _addonList: CheckboxItem[] = []; - @property() private _folderList: CheckboxItem[] = [ + @internalProperty() private _folderList: CheckboxItem[] = [ { slug: "homeassistant", name: "Home Assistant configuration", @@ -79,9 +80,9 @@ class HassioSnapshots extends LitElement { { slug: "addons/local", name: "Local add-ons", checked: true }, ]; - @property() private _creatingSnapshot = false; + @internalProperty() private _creatingSnapshot = false; - @property() private _error = ""; + @internalProperty() private _error = ""; public async refreshData() { await reloadHassioSnapshots(this.hass); diff --git a/hassio/src/system/hassio-host-info.ts b/hassio/src/system/hassio-host-info.ts index be0596122c..3a53925ddb 100644 --- a/hassio/src/system/hassio-host-info.ts +++ b/hassio/src/system/hassio-host-info.ts @@ -6,6 +6,7 @@ import { html, LitElement, property, + internalProperty, TemplateResult, } from "lit-element"; import "../../../src/components/buttons/ha-call-api-button"; @@ -32,15 +33,15 @@ import { hassioStyle } from "../resources/hassio-style"; @customElement("hassio-host-info") class HassioHostInfo extends LitElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; @property() public hostInfo!: HassioHostInfoType; @property({ attribute: false }) public hassioInfo!: HassioInfo; - @property() public hassOsInfo!: HassioHassOSInfo; + @property({ attribute: false }) public hassOsInfo!: HassioHassOSInfo; - @property() private _errors?: string; + @internalProperty() private _errors?: string; public render(): TemplateResult | void { return html` diff --git a/hassio/src/system/hassio-supervisor-info.ts b/hassio/src/system/hassio-supervisor-info.ts index 51a45c18b2..1843cb4058 100644 --- a/hassio/src/system/hassio-supervisor-info.ts +++ b/hassio/src/system/hassio-supervisor-info.ts @@ -6,6 +6,7 @@ import { html, LitElement, property, + internalProperty, TemplateResult, } from "lit-element"; import { fireEvent } from "../../../src/common/dom/fire_event"; @@ -23,11 +24,11 @@ import { hassioStyle } from "../resources/hassio-style"; @customElement("hassio-supervisor-info") class HassioSupervisorInfo extends LitElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; @property() public supervisorInfo!: HassioSupervisorInfoType; - @property() private _errors?: string; + @internalProperty() private _errors?: string; public render(): TemplateResult | void { return html` diff --git a/hassio/src/system/hassio-supervisor-log.ts b/hassio/src/system/hassio-supervisor-log.ts index d9f3218a7a..ec2dbe7031 100644 --- a/hassio/src/system/hassio-supervisor-log.ts +++ b/hassio/src/system/hassio-supervisor-log.ts @@ -9,6 +9,7 @@ import { html, LitElement, property, + internalProperty, TemplateResult, } from "lit-element"; import "../../../src/components/ha-card"; @@ -55,11 +56,11 @@ const logProviders: LogProvider[] = [ class HassioSupervisorLog extends LitElement { @property({ attribute: false }) public hass!: HomeAssistant; - @property() private _error?: string; + @internalProperty() private _error?: string; - @property() private _selectedLogProvider = "supervisor"; + @internalProperty() private _selectedLogProvider = "supervisor"; - @property() private _content?: string; + @internalProperty() private _content?: string; public async connectedCallback(): Promise { super.connectedCallback(); diff --git a/src/auth/ha-auth-flow.ts b/src/auth/ha-auth-flow.ts index 88afcbedae..4ad4b3330b 100644 --- a/src/auth/ha-auth-flow.ts +++ b/src/auth/ha-auth-flow.ts @@ -5,6 +5,7 @@ import { html, LitElement, property, + internalProperty, PropertyValues, TemplateResult, } from "lit-element"; @@ -28,13 +29,13 @@ class HaAuthFlow extends litLocalizeLiteMixin(LitElement) { @property() public oauth2State?: string; - @property() private _state: State = "loading"; + @internalProperty() private _state: State = "loading"; - @property() private _stepData: any = {}; + @internalProperty() private _stepData: any = {}; - @property() private _step?: DataEntryFlowStep; + @internalProperty() private _step?: DataEntryFlowStep; - @property() private _errorMessage?: string; + @internalProperty() private _errorMessage?: string; protected render() { return html` diff --git a/src/auth/ha-authorize.ts b/src/auth/ha-authorize.ts index b96eac0aff..989525cb23 100644 --- a/src/auth/ha-authorize.ts +++ b/src/auth/ha-authorize.ts @@ -4,6 +4,7 @@ import { html, LitElement, property, + internalProperty, PropertyValues, } from "lit-element"; import { @@ -25,9 +26,9 @@ class HaAuthorize extends litLocalizeLiteMixin(LitElement) { @property() public oauth2State?: string; - @property() private _authProvider?: AuthProvider; + @internalProperty() private _authProvider?: AuthProvider; - @property() private _authProviders?: AuthProvider[]; + @internalProperty() private _authProviders?: AuthProvider[]; constructor() { super(); diff --git a/src/common/dom/load_resource.ts b/src/common/dom/load_resource.ts index 670afddc9e..c4933ed8e5 100644 --- a/src/common/dom/load_resource.ts +++ b/src/common/dom/load_resource.ts @@ -23,7 +23,8 @@ const _load = ( if (type) { (element as HTMLScriptElement).type = type; // https://github.com/home-assistant/frontend/pull/6328 - (element as HTMLScriptElement).crossOrigin = url.substr(0, 1) === "/" ? "use-credentials" : "anonymous"; + (element as HTMLScriptElement).crossOrigin = + url.substr(0, 1) === "/" ? "use-credentials" : "anonymous"; } break; case "link": diff --git a/src/components/data-table/ha-data-table.ts b/src/components/data-table/ha-data-table.ts index 3ec2aba13a..05283fb7db 100644 --- a/src/components/data-table/ha-data-table.ts +++ b/src/components/data-table/ha-data-table.ts @@ -6,11 +6,11 @@ import { html, LitElement, property, + internalProperty, PropertyValues, query, TemplateResult, eventOptions, - internalProperty, } from "lit-element"; import { classMap } from "lit-html/directives/class-map"; import { ifDefined } from "lit-html/directives/if-defined"; diff --git a/src/components/device/ha-area-devices-picker.ts b/src/components/device/ha-area-devices-picker.ts index 3a0804e637..9a974c88f1 100644 --- a/src/components/device/ha-area-devices-picker.ts +++ b/src/components/device/ha-area-devices-picker.ts @@ -13,6 +13,7 @@ import { html, LitElement, property, + internalProperty, PropertyValues, TemplateResult, } from "lit-element"; @@ -87,7 +88,7 @@ const rowRenderer = ( @customElement("ha-area-devices-picker") export class HaAreaDevicesPicker extends SubscribeMixin(LitElement) { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; @property() public label?: string; @@ -124,13 +125,13 @@ export class HaAreaDevicesPicker extends SubscribeMixin(LitElement) { @property({ type: Boolean }) private _opened?: boolean; - @property() private _areaPicker = true; + @internalProperty() private _areaPicker = true; - @property() private _devices?: DeviceRegistryEntry[]; + @internalProperty() private _devices?: DeviceRegistryEntry[]; - @property() private _areas?: AreaRegistryEntry[]; + @internalProperty() private _areas?: AreaRegistryEntry[]; - @property() private _entities?: EntityRegistryEntry[]; + @internalProperty() private _entities?: EntityRegistryEntry[]; private _selectedDevices: string[] = []; diff --git a/src/components/device/ha-device-automation-picker.ts b/src/components/device/ha-device-automation-picker.ts index b32446710a..5f05069dd1 100644 --- a/src/components/device/ha-device-automation-picker.ts +++ b/src/components/device/ha-device-automation-picker.ts @@ -8,6 +8,7 @@ import { html, LitElement, property, + internalProperty, TemplateResult, } from "lit-element"; import { fireEvent } from "../../common/dom/fire_event"; @@ -24,7 +25,7 @@ const UNKNOWN_AUTOMATION_KEY = "UNKNOWN_AUTOMATION"; export abstract class HaDeviceAutomationPicker< T extends DeviceAutomation > extends LitElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; @property() public label?: string; @@ -36,11 +37,11 @@ export abstract class HaDeviceAutomationPicker< protected UNKNOWN_AUTOMATION_TEXT = "Unknown automation"; - @property() private _automations: T[] = []; + @internalProperty() private _automations: T[] = []; // Trigger an empty render so we start with a clean DOM. // paper-listbox does not like changing things around. - @property() private _renderEmpty = false; + @internalProperty() private _renderEmpty = false; private _localizeDeviceAutomation: ( hass: HomeAssistant, diff --git a/src/components/device/ha-device-picker.ts b/src/components/device/ha-device-picker.ts index be4fb6bbe4..4b5e60f936 100644 --- a/src/components/device/ha-device-picker.ts +++ b/src/components/device/ha-device-picker.ts @@ -66,7 +66,7 @@ const rowRenderer = (root: HTMLElement, _owner, model: { item: Device }) => { @customElement("ha-device-picker") export class HaDevicePicker extends SubscribeMixin(LitElement) { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; @property() public label?: string; diff --git a/src/components/device/ha-devices-picker.ts b/src/components/device/ha-devices-picker.ts index 4abf6c4eda..9106521d1d 100644 --- a/src/components/device/ha-devices-picker.ts +++ b/src/components/device/ha-devices-picker.ts @@ -12,7 +12,7 @@ import "./ha-device-picker"; @customElement("ha-devices-picker") class HaDevicesPicker extends LitElement { - @property() public hass?: HomeAssistant; + @property({ attribute: false }) public hass?: HomeAssistant; @property() public value?: string[]; diff --git a/src/components/entity/ha-entities-picker.ts b/src/components/entity/ha-entities-picker.ts index 6f03e48f01..0ac66ed8fa 100644 --- a/src/components/entity/ha-entities-picker.ts +++ b/src/components/entity/ha-entities-picker.ts @@ -15,7 +15,7 @@ import type { HaEntityPickerEntityFilterFunc } from "./ha-entity-picker"; @customElement("ha-entities-picker") class HaEntitiesPickerLight extends LitElement { - @property() public hass?: HomeAssistant; + @property({ attribute: false }) public hass?: HomeAssistant; @property() public value?: string[]; diff --git a/src/components/entity/ha-entity-picker.ts b/src/components/entity/ha-entity-picker.ts index 231914cecf..300ae57a79 100644 --- a/src/components/entity/ha-entity-picker.ts +++ b/src/components/entity/ha-entity-picker.ts @@ -59,7 +59,7 @@ class HaEntityPicker extends LitElement { @property({ type: Boolean, attribute: "allow-custom-entity" }) public allowCustomEntity; - @property() public hass?: HomeAssistant; + @property({ attribute: false }) public hass?: HomeAssistant; @property() public label?: string; diff --git a/src/components/entity/ha-entity-toggle.ts b/src/components/entity/ha-entity-toggle.ts index 587f299641..ca46ad32b0 100644 --- a/src/components/entity/ha-entity-toggle.ts +++ b/src/components/entity/ha-entity-toggle.ts @@ -6,6 +6,7 @@ import { html, LitElement, property, + internalProperty, PropertyValues, TemplateResult, } from "lit-element"; @@ -28,7 +29,7 @@ export class HaEntityToggle extends LitElement { @property() public stateObj?: HassEntity; - @property() private _isOn = false; + @internalProperty() private _isOn = false; protected render(): TemplateResult { if (!this.stateObj) { diff --git a/src/components/entity/ha-state-label-badge.ts b/src/components/entity/ha-state-label-badge.ts index 1c812a6065..2fb7b688bd 100644 --- a/src/components/entity/ha-state-label-badge.ts +++ b/src/components/entity/ha-state-label-badge.ts @@ -6,6 +6,7 @@ import { html, LitElement, property, + internalProperty, PropertyValues, TemplateResult, } from "lit-element"; @@ -22,7 +23,7 @@ import "../ha-label-badge"; @customElement("ha-state-label-badge") export class HaStateLabelBadge extends LitElement { - @property() public hass?: HomeAssistant; + @property({ attribute: false }) public hass?: HomeAssistant; @property() public state?: HassEntity; @@ -32,7 +33,7 @@ export class HaStateLabelBadge extends LitElement { @property() public image?: string; - @property() private _timerTimeRemaining?: number; + @internalProperty() private _timerTimeRemaining?: number; private _connected?: boolean; diff --git a/src/components/entity/state-badge.ts b/src/components/entity/state-badge.ts index 1c840ed278..d621d6c590 100644 --- a/src/components/entity/state-badge.ts +++ b/src/components/entity/state-badge.ts @@ -6,6 +6,7 @@ import { html, LitElement, property, + internalProperty, PropertyValues, TemplateResult, } from "lit-element"; @@ -31,7 +32,7 @@ export class StateBadge extends LitElement { @property({ type: Boolean, reflect: true, attribute: "icon" }) private _showIcon = true; - @property() private _iconStyle: { [name: string]: string } = {}; + @internalProperty() private _iconStyle: { [name: string]: string } = {}; protected render(): TemplateResult { const stateObj = this.stateObj; diff --git a/src/components/ha-area-picker.ts b/src/components/ha-area-picker.ts index 77a86a6dae..0a12ecd0d8 100644 --- a/src/components/ha-area-picker.ts +++ b/src/components/ha-area-picker.ts @@ -12,6 +12,7 @@ import { html, LitElement, property, + internalProperty, TemplateResult, } from "lit-element"; import { fireEvent } from "../common/dom/fire_event"; @@ -61,7 +62,7 @@ const rowRenderer = ( @customElement("ha-area-picker") export class HaAreaPicker extends SubscribeMixin(LitElement) { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; @property() public label?: string; @@ -72,7 +73,7 @@ export class HaAreaPicker extends SubscribeMixin(LitElement) { @property({ type: Boolean, attribute: "no-add" }) public noAdd?: boolean; - @property() private _opened?: boolean; + @internalProperty() private _opened?: boolean; public hassSubscribe(): UnsubscribeFunc[] { return [ diff --git a/src/components/ha-camera-stream.ts b/src/components/ha-camera-stream.ts index 89d1330234..61b3d89d96 100644 --- a/src/components/ha-camera-stream.ts +++ b/src/components/ha-camera-stream.ts @@ -5,6 +5,7 @@ import { html, LitElement, property, + internalProperty, PropertyValues, TemplateResult, } from "lit-element"; @@ -22,17 +23,17 @@ type HLSModule = typeof import("hls.js"); @customElement("ha-camera-stream") class HaCameraStream extends LitElement { - @property() public hass?: HomeAssistant; + @property({ attribute: false }) public hass?: HomeAssistant; @property() public stateObj?: CameraEntity; @property({ type: Boolean }) public showControls = false; - @property() private _attached = false; + @internalProperty() private _attached = false; // We keep track if we should force MJPEG with a string // that way it automatically resets if we change entity. - @property() private _forceMJPEG: string | undefined = undefined; + @internalProperty() private _forceMJPEG: string | undefined = undefined; private _hlsPolyfillInstance?: Hls; diff --git a/src/components/ha-code-editor.ts b/src/components/ha-code-editor.ts index eee7214179..aac917e31a 100644 --- a/src/components/ha-code-editor.ts +++ b/src/components/ha-code-editor.ts @@ -2,6 +2,7 @@ import { Editor } from "codemirror"; import { customElement, property, + internalProperty, PropertyValues, UpdatingElement, } from "lit-element"; @@ -28,7 +29,7 @@ export class HaCodeEditor extends UpdatingElement { @property() public error = false; - @property() private _value = ""; + @internalProperty() private _value = ""; public set value(value: string) { this._value = value; diff --git a/src/components/ha-date-range-picker.ts b/src/components/ha-date-range-picker.ts index 66bb2f1eae..426da4127d 100644 --- a/src/components/ha-date-range-picker.ts +++ b/src/components/ha-date-range-picker.ts @@ -24,7 +24,7 @@ export interface DateRangePickerRanges { @customElement("ha-date-range-picker") export class HaDateRangePicker extends LitElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; @property() public startDate!: Date; diff --git a/src/components/ha-form/ha-form-multi_select.ts b/src/components/ha-form/ha-form-multi_select.ts index 99fa3e905e..b46218ae6f 100644 --- a/src/components/ha-form/ha-form-multi_select.ts +++ b/src/components/ha-form/ha-form-multi_select.ts @@ -11,6 +11,7 @@ import { html, LitElement, property, + internalProperty, query, TemplateResult, } from "lit-element"; @@ -32,7 +33,7 @@ export class HaFormMultiSelect extends LitElement implements HaFormElement { @property() public suffix!: string; - @property() private _init = false; + @internalProperty() private _init = false; @query("paper-menu-button") private _input?: HTMLElement; diff --git a/src/components/ha-form/ha-form-string.ts b/src/components/ha-form/ha-form-string.ts index c940e5e7c6..46bdbee332 100644 --- a/src/components/ha-form/ha-form-string.ts +++ b/src/components/ha-form/ha-form-string.ts @@ -6,6 +6,7 @@ import { html, LitElement, property, + internalProperty, query, TemplateResult, } from "lit-element"; @@ -26,7 +27,7 @@ export class HaFormString extends LitElement implements HaFormElement { @property() public suffix!: string; - @property() private _unmaskedPassword = false; + @internalProperty() private _unmaskedPassword = false; @query("paper-input") private _input?: HTMLElement; diff --git a/src/components/ha-icon-button-arrow-next.ts b/src/components/ha-icon-button-arrow-next.ts index 150f5b4b2d..4d84add488 100644 --- a/src/components/ha-icon-button-arrow-next.ts +++ b/src/components/ha-icon-button-arrow-next.ts @@ -1,6 +1,7 @@ import { LitElement, property, + internalProperty, TemplateResult, html, customElement, @@ -13,7 +14,7 @@ import "./ha-svg-icon"; export class HaIconButtonArrowNext extends LitElement { @property({ type: Boolean }) public disabled = false; - @property() private _icon = mdiArrowRight; + @internalProperty() private _icon = mdiArrowRight; public connectedCallback() { super.connectedCallback(); diff --git a/src/components/ha-icon-button-arrow-prev.ts b/src/components/ha-icon-button-arrow-prev.ts index 06e97b290c..07c8265bb2 100644 --- a/src/components/ha-icon-button-arrow-prev.ts +++ b/src/components/ha-icon-button-arrow-prev.ts @@ -1,6 +1,7 @@ import { LitElement, property, + internalProperty, TemplateResult, html, customElement, @@ -13,7 +14,7 @@ import "./ha-svg-icon"; export class HaIconButtonArrowPrev extends LitElement { @property({ type: Boolean }) public disabled = false; - @property() private _icon = mdiArrowLeft; + @internalProperty() private _icon = mdiArrowLeft; public connectedCallback() { super.connectedCallback(); diff --git a/src/components/ha-icon-button-next.ts b/src/components/ha-icon-button-next.ts index 6e37d1c764..e328c4ff1e 100644 --- a/src/components/ha-icon-button-next.ts +++ b/src/components/ha-icon-button-next.ts @@ -1,6 +1,7 @@ import { LitElement, property, + internalProperty, TemplateResult, html, customElement, @@ -13,7 +14,7 @@ import "./ha-svg-icon"; export class HaIconButtonNext extends LitElement { @property({ type: Boolean }) public disabled = false; - @property() private _icon = mdiChevronRight; + @internalProperty() private _icon = mdiChevronRight; public connectedCallback() { super.connectedCallback(); diff --git a/src/components/ha-icon-button-prev.ts b/src/components/ha-icon-button-prev.ts index 7548004c02..077b5a03bf 100644 --- a/src/components/ha-icon-button-prev.ts +++ b/src/components/ha-icon-button-prev.ts @@ -1,6 +1,7 @@ import { LitElement, property, + internalProperty, TemplateResult, html, customElement, @@ -13,7 +14,7 @@ import "./ha-svg-icon"; export class HaIconButtonPrev extends LitElement { @property({ type: Boolean }) public disabled = false; - @property() private _icon = mdiChevronLeft; + @internalProperty() private _icon = mdiChevronLeft; public connectedCallback() { super.connectedCallback(); diff --git a/src/components/ha-icon.ts b/src/components/ha-icon.ts index c89b1d2f51..07b802bd40 100644 --- a/src/components/ha-icon.ts +++ b/src/components/ha-icon.ts @@ -3,6 +3,7 @@ import { customElement, LitElement, property, + internalProperty, PropertyValues, html, TemplateResult, @@ -233,11 +234,11 @@ const cachedIcons: { [key: string]: string } = {}; export class HaIcon extends LitElement { @property() public icon?: string; - @property() private _path?: string; + @internalProperty() private _path?: string; - @property() private _viewBox?; + @internalProperty() private _viewBox?; - @property() private _legacy = false; + @internalProperty() private _legacy = false; protected updated(changedProps: PropertyValues) { if (changedProps.has("icon")) { diff --git a/src/components/ha-menu-button.ts b/src/components/ha-menu-button.ts index 985678b03b..7531c989d9 100644 --- a/src/components/ha-menu-button.ts +++ b/src/components/ha-menu-button.ts @@ -8,6 +8,7 @@ import { html, LitElement, property, + internalProperty, TemplateResult, } from "lit-element"; import { fireEvent } from "../common/dom/fire_event"; @@ -22,9 +23,9 @@ class HaMenuButton extends LitElement { @property() public narrow!: boolean; - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; - @property() private _hasNotifications = false; + @internalProperty() private _hasNotifications = false; private _alwaysVisible = false; diff --git a/src/components/ha-related-items.ts b/src/components/ha-related-items.ts index e056361c53..35a24a8479 100644 --- a/src/components/ha-related-items.ts +++ b/src/components/ha-related-items.ts @@ -6,6 +6,7 @@ import { html, LitElement, property, + internalProperty, PropertyValues, TemplateResult, } from "lit-element"; @@ -27,19 +28,19 @@ import "./ha-switch"; @customElement("ha-related-items") export class HaRelatedItems extends SubscribeMixin(LitElement) { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; @property() public itemType!: ItemType; @property() public itemId!: string; - @property() private _entries?: ConfigEntry[]; + @internalProperty() private _entries?: ConfigEntry[]; - @property() private _devices?: DeviceRegistryEntry[]; + @internalProperty() private _devices?: DeviceRegistryEntry[]; - @property() private _areas?: AreaRegistryEntry[]; + @internalProperty() private _areas?: AreaRegistryEntry[]; - @property() private _related?: RelatedResult; + @internalProperty() private _related?: RelatedResult; public hassSubscribe(): UnsubscribeFunc[] { return [ diff --git a/src/components/ha-sidebar.ts b/src/components/ha-sidebar.ts index 549b77c19f..41cfb119ca 100644 --- a/src/components/ha-sidebar.ts +++ b/src/components/ha-sidebar.ts @@ -18,6 +18,7 @@ import { customElement, LitElement, property, + internalProperty, PropertyValues, } from "lit-element"; import { classMap } from "lit-html/directives/class-map"; @@ -111,7 +112,7 @@ const computePanels = (hass: HomeAssistant): [PanelInfo[], PanelInfo[]] => { @customElement("ha-sidebar") class HaSidebar extends LitElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; @property() public narrow!: boolean; @@ -119,9 +120,9 @@ class HaSidebar extends LitElement { @property({ type: Boolean, reflect: true }) public expanded = false; - @property() private _externalConfig?: ExternalConfig; + @internalProperty() private _externalConfig?: ExternalConfig; - @property() private _notifications?: PersistentNotification[]; + @internalProperty() private _notifications?: PersistentNotification[]; // property used only in css // @ts-ignore diff --git a/src/components/ha-tab.ts b/src/components/ha-tab.ts index e58f820303..cc052052d9 100644 --- a/src/components/ha-tab.ts +++ b/src/components/ha-tab.ts @@ -4,10 +4,10 @@ import { customElement, LitElement, property, + internalProperty, TemplateResult, html, queryAsync, - internalProperty, eventOptions, } from "lit-element"; import "@material/mwc-ripple/mwc-ripple"; diff --git a/src/components/ha-yaml-editor.ts b/src/components/ha-yaml-editor.ts index e49c0bd043..83c909003b 100644 --- a/src/components/ha-yaml-editor.ts +++ b/src/components/ha-yaml-editor.ts @@ -4,6 +4,7 @@ import { html, LitElement, property, + internalProperty, query, TemplateResult, } from "lit-element"; @@ -41,7 +42,7 @@ export class HaYamlEditor extends LitElement { @property() public label?: string; - @property() private _yaml = ""; + @internalProperty() private _yaml = ""; @query("ha-code-editor") private _editor?: HaCodeEditor; diff --git a/src/components/map/ha-map.ts b/src/components/map/ha-map.ts index e39b636261..8d25d5011a 100644 --- a/src/components/map/ha-map.ts +++ b/src/components/map/ha-map.ts @@ -22,7 +22,7 @@ import { HomeAssistant } from "../../types"; @customElement("ha-map") class HaMap extends LitElement { - @property() public hass?: HomeAssistant; + @property({ attribute: false }) public hass?: HomeAssistant; @property() public entities?: string[]; diff --git a/src/data/config_flow.ts b/src/data/config_flow.ts index 983d6a52d0..a06f8f42ec 100644 --- a/src/data/config_flow.ts +++ b/src/data/config_flow.ts @@ -5,7 +5,13 @@ import { HomeAssistant } from "../types"; import { DataEntryFlowProgress, DataEntryFlowStep } from "./data_entry_flow"; import { domainToName } from "./integration"; -export const DISCOVERY_SOURCES = ["unignore", "homekit", "ssdp", "zeroconf", "discovery"]; +export const DISCOVERY_SOURCES = [ + "unignore", + "homekit", + "ssdp", + "zeroconf", + "discovery", +]; export const createConfigFlow = (hass: HomeAssistant, handler: string) => hass.callApi("POST", "config/config_entries/flow", { diff --git a/src/dialogs/config-entry-system-options/dialog-config-entry-system-options.ts b/src/dialogs/config-entry-system-options/dialog-config-entry-system-options.ts index 915eb18556..a57abebb7d 100644 --- a/src/dialogs/config-entry-system-options/dialog-config-entry-system-options.ts +++ b/src/dialogs/config-entry-system-options/dialog-config-entry-system-options.ts @@ -7,6 +7,7 @@ import { html, LitElement, property, + internalProperty, TemplateResult, } from "lit-element"; import "../../components/dialog/ha-paper-dialog"; @@ -26,17 +27,17 @@ import { computeRTLDirection } from "../../common/util/compute_rtl"; @customElement("dialog-config-entry-system-options") class DialogConfigEntrySystemOptions extends LitElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; - @property() private _disableNewEntities!: boolean; + @internalProperty() private _disableNewEntities!: boolean; - @property() private _error?: string; + @internalProperty() private _error?: string; - @property() private _params?: ConfigEntrySystemOptionsDialogParams; + @internalProperty() private _params?: ConfigEntrySystemOptionsDialogParams; - @property() private _loading?: boolean; + @internalProperty() private _loading?: boolean; - @property() private _submitting?: boolean; + @internalProperty() private _submitting?: boolean; public async showDialog( params: ConfigEntrySystemOptionsDialogParams diff --git a/src/dialogs/config-flow/dialog-data-entry-flow.ts b/src/dialogs/config-flow/dialog-data-entry-flow.ts index 9ad6c60a4b..976a98d301 100644 --- a/src/dialogs/config-flow/dialog-data-entry-flow.ts +++ b/src/dialogs/config-flow/dialog-data-entry-flow.ts @@ -10,7 +10,7 @@ import { customElement, html, LitElement, - property, + internalProperty, PropertyValues, TemplateResult, } from "lit-element"; @@ -54,23 +54,23 @@ declare global { class DataEntryFlowDialog extends LitElement { public hass!: HomeAssistant; - @property() private _params?: DataEntryFlowDialogParams; + @internalProperty() private _params?: DataEntryFlowDialogParams; - @property() private _loading = true; + @internalProperty() private _loading = true; private _instance = instance; - @property() private _step: + @internalProperty() private _step: | DataEntryFlowStep | undefined // Null means we need to pick a config flow | null; - @property() private _devices?: DeviceRegistryEntry[]; + @internalProperty() private _devices?: DeviceRegistryEntry[]; - @property() private _areas?: AreaRegistryEntry[]; + @internalProperty() private _areas?: AreaRegistryEntry[]; - @property() private _handlers?: string[]; + @internalProperty() private _handlers?: string[]; private _unsubAreas?: UnsubscribeFunc; diff --git a/src/dialogs/config-flow/step-flow-pick-handler.ts b/src/dialogs/config-flow/step-flow-pick-handler.ts index 930b067b17..c875a58218 100644 --- a/src/dialogs/config-flow/step-flow-pick-handler.ts +++ b/src/dialogs/config-flow/step-flow-pick-handler.ts @@ -8,6 +8,7 @@ import { html, LitElement, property, + internalProperty, TemplateResult, } from "lit-element"; import { classMap } from "lit-html/directives/class-map"; @@ -31,13 +32,13 @@ interface HandlerObj { class StepFlowPickHandler extends LitElement { public flowConfig!: FlowConfig; - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; @property() public handlers!: string[]; @property() public showAdvanced?: boolean; - @property() private filter?: string; + @internalProperty() private filter?: string; private _width?: number; diff --git a/src/dialogs/device-registry-detail/dialog-device-registry-detail.ts b/src/dialogs/device-registry-detail/dialog-device-registry-detail.ts index 9386b900d9..f949d810db 100644 --- a/src/dialogs/device-registry-detail/dialog-device-registry-detail.ts +++ b/src/dialogs/device-registry-detail/dialog-device-registry-detail.ts @@ -11,6 +11,7 @@ import { html, LitElement, property, + internalProperty, TemplateResult, } from "lit-element"; import "../../components/dialog/ha-paper-dialog"; @@ -23,15 +24,15 @@ import { DeviceRegistryDetailDialogParams } from "./show-dialog-device-registry- @customElement("dialog-device-registry-detail") class DialogDeviceRegistryDetail extends LitElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; - @property() private _nameByUser!: string; + @internalProperty() private _nameByUser!: string; - @property() private _error?: string; + @internalProperty() private _error?: string; - @property() private _params?: DeviceRegistryDetailDialogParams; + @internalProperty() private _params?: DeviceRegistryDetailDialogParams; - @property() private _areaId?: string; + @internalProperty() private _areaId?: string; private _submitting?: boolean; diff --git a/src/dialogs/domain-toggler/dialog-domain-toggler.ts b/src/dialogs/domain-toggler/dialog-domain-toggler.ts index d3b7e7a06a..326fb40c01 100644 --- a/src/dialogs/domain-toggler/dialog-domain-toggler.ts +++ b/src/dialogs/domain-toggler/dialog-domain-toggler.ts @@ -5,7 +5,7 @@ import { customElement, html, LitElement, - property, + internalProperty, TemplateResult, } from "lit-element"; import "../../components/dialog/ha-paper-dialog"; @@ -19,7 +19,7 @@ import { HaDomainTogglerDialogParams } from "./show-dialog-domain-toggler"; class DomainTogglerDialog extends LitElement { public hass!: HomeAssistant; - @property() private _params?: HaDomainTogglerDialogParams; + @internalProperty() private _params?: HaDomainTogglerDialogParams; public async showDialog(params: HaDomainTogglerDialogParams): Promise { this._params = params; diff --git a/src/dialogs/generic/dialog-box.ts b/src/dialogs/generic/dialog-box.ts index d0511b22df..0663b6bfe7 100644 --- a/src/dialogs/generic/dialog-box.ts +++ b/src/dialogs/generic/dialog-box.ts @@ -7,6 +7,7 @@ import { html, LitElement, property, + internalProperty, TemplateResult, } from "lit-element"; import { classMap } from "lit-html/directives/class-map"; @@ -20,11 +21,11 @@ import { fireEvent } from "../../common/dom/fire_event"; @customElement("dialog-box") class DialogBox extends LitElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; - @property() private _params?: DialogParams; + @internalProperty() private _params?: DialogParams; - @property() private _value?: string; + @internalProperty() private _value?: string; public async showDialog(params: DialogParams): Promise { this._params = params; diff --git a/src/dialogs/more-info/controls/more-info-automation.ts b/src/dialogs/more-info/controls/more-info-automation.ts index 7e2651ec24..8a25e93fe4 100644 --- a/src/dialogs/more-info/controls/more-info-automation.ts +++ b/src/dialogs/more-info/controls/more-info-automation.ts @@ -15,7 +15,7 @@ import { HomeAssistant } from "../../../types"; @customElement("more-info-automation") class MoreInfoAutomation extends LitElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; @property() public stateObj?: HassEntity; diff --git a/src/dialogs/more-info/controls/more-info-camera.ts b/src/dialogs/more-info/controls/more-info-camera.ts index 55623f58d5..d990cf25a0 100644 --- a/src/dialogs/more-info/controls/more-info-camera.ts +++ b/src/dialogs/more-info/controls/more-info-camera.ts @@ -6,6 +6,7 @@ import { html, LitElement, property, + internalProperty, PropertyValues, TemplateResult, } from "lit-element"; @@ -20,13 +21,13 @@ import { import type { CameraEntity, HomeAssistant } from "../../../types"; class MoreInfoCamera extends LitElement { - @property() public hass?: HomeAssistant; + @property({ attribute: false }) public hass?: HomeAssistant; @property() public stateObj?: CameraEntity; - @property() private _cameraPrefs?: CameraPreferences; + @internalProperty() private _cameraPrefs?: CameraPreferences; - @property() private _attached = false; + @internalProperty() private _attached = false; public connectedCallback() { super.connectedCallback(); diff --git a/src/dialogs/more-info/controls/more-info-climate.ts b/src/dialogs/more-info/controls/more-info-climate.ts index c093944d62..e0436cea81 100644 --- a/src/dialogs/more-info/controls/more-info-climate.ts +++ b/src/dialogs/more-info/controls/more-info-climate.ts @@ -32,7 +32,7 @@ import { import { HomeAssistant } from "../../../types"; class MoreInfoClimate extends LitElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; @property() public stateObj?: ClimateEntity; diff --git a/src/dialogs/more-info/controls/more-info-counter.ts b/src/dialogs/more-info/controls/more-info-counter.ts index 2ec001a01a..7be5eb5ab6 100644 --- a/src/dialogs/more-info/controls/more-info-counter.ts +++ b/src/dialogs/more-info/controls/more-info-counter.ts @@ -13,7 +13,7 @@ import { HomeAssistant } from "../../../types"; @customElement("more-info-counter") class MoreInfoCounter extends LitElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; @property() public stateObj?: HassEntity; diff --git a/src/dialogs/more-info/controls/more-info-default.ts b/src/dialogs/more-info/controls/more-info-default.ts index c9a3c49d71..443b39ed43 100644 --- a/src/dialogs/more-info/controls/more-info-default.ts +++ b/src/dialogs/more-info/controls/more-info-default.ts @@ -11,7 +11,7 @@ import { HomeAssistant } from "../../../types"; @customElement("more-info-default") class MoreInfoDefault extends LitElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; @property() public stateObj?: HassEntity; diff --git a/src/dialogs/more-info/controls/more-info-humidifier.ts b/src/dialogs/more-info/controls/more-info-humidifier.ts index 6a3bbc1aad..bfb4642a4a 100644 --- a/src/dialogs/more-info/controls/more-info-humidifier.ts +++ b/src/dialogs/more-info/controls/more-info-humidifier.ts @@ -24,7 +24,7 @@ import { import { HomeAssistant } from "../../../types"; class MoreInfoHumidifier extends LitElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; @property() public stateObj?: HumidifierEntity; diff --git a/src/dialogs/more-info/controls/more-info-person.ts b/src/dialogs/more-info/controls/more-info-person.ts index 31def98ccf..ef8b3f803b 100644 --- a/src/dialogs/more-info/controls/more-info-person.ts +++ b/src/dialogs/more-info/controls/more-info-person.ts @@ -18,7 +18,7 @@ import { HomeAssistant } from "../../../types"; @customElement("more-info-person") class MoreInfoPerson extends LitElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; @property() public stateObj?: HassEntity; diff --git a/src/dialogs/more-info/controls/more-info-script.ts b/src/dialogs/more-info/controls/more-info-script.ts index 83d7ccd31e..735d41429f 100644 --- a/src/dialogs/more-info/controls/more-info-script.ts +++ b/src/dialogs/more-info/controls/more-info-script.ts @@ -11,7 +11,7 @@ import { HomeAssistant } from "../../../types"; @customElement("more-info-script") class MoreInfoScript extends LitElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; @property() public stateObj?: HassEntity; diff --git a/src/dialogs/more-info/controls/more-info-sun.ts b/src/dialogs/more-info/controls/more-info-sun.ts index 10b832f260..a611e521cf 100644 --- a/src/dialogs/more-info/controls/more-info-sun.ts +++ b/src/dialogs/more-info/controls/more-info-sun.ts @@ -14,7 +14,7 @@ import { HomeAssistant } from "../../../types"; @customElement("more-info-sun") class MoreInfoSun extends LitElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; @property() public stateObj?: HassEntity; diff --git a/src/dialogs/more-info/controls/more-info-timer.ts b/src/dialogs/more-info/controls/more-info-timer.ts index 4a1dbeb40a..809d697c70 100644 --- a/src/dialogs/more-info/controls/more-info-timer.ts +++ b/src/dialogs/more-info/controls/more-info-timer.ts @@ -14,7 +14,7 @@ import { HomeAssistant } from "../../../types"; @customElement("more-info-timer") class MoreInfoTimer extends LitElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; @property() public stateObj?: TimerEntity; diff --git a/src/dialogs/more-info/controls/more-info-vacuum.ts b/src/dialogs/more-info/controls/more-info-vacuum.ts index d39786ae7f..0c131333f1 100644 --- a/src/dialogs/more-info/controls/more-info-vacuum.ts +++ b/src/dialogs/more-info/controls/more-info-vacuum.ts @@ -90,7 +90,7 @@ const VACUUM_COMMANDS: VacuumCommand[] = [ @customElement("more-info-vacuum") class MoreInfoVacuum extends LitElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; @property() public stateObj?: VacuumEntity; diff --git a/src/dialogs/more-info/controls/more-info-weather.ts b/src/dialogs/more-info/controls/more-info-weather.ts index 0019a83b43..8d7a4ca5f3 100644 --- a/src/dialogs/more-info/controls/more-info-weather.ts +++ b/src/dialogs/more-info/controls/more-info-weather.ts @@ -51,7 +51,7 @@ const weatherIcons = { @customElement("more-info-weather") class MoreInfoWeather extends LitElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; @property() public stateObj?: HassEntity; diff --git a/src/dialogs/more-info/ha-more-info-dialog.ts b/src/dialogs/more-info/ha-more-info-dialog.ts index fb68cc7eec..56ba7308ff 100644 --- a/src/dialogs/more-info/ha-more-info-dialog.ts +++ b/src/dialogs/more-info/ha-more-info-dialog.ts @@ -18,9 +18,9 @@ import { customElement, LitElement, property, + internalProperty, css, html, - internalProperty, } from "lit-element"; import { haStyleDialog } from "../../resources/styles"; import { HomeAssistant } from "../../types"; @@ -39,7 +39,7 @@ export interface MoreInfoDialogParams { @customElement("ha-more-info-dialog") export class MoreInfoDialog extends LitElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; @property({ type: Boolean, reflect: true }) public large = false; diff --git a/src/dialogs/more-info/more-info-content.ts b/src/dialogs/more-info/more-info-content.ts index 2038fb014b..369d9e8d4f 100644 --- a/src/dialogs/more-info/more-info-content.ts +++ b/src/dialogs/more-info/more-info-content.ts @@ -27,7 +27,7 @@ import "./controls/more-info-water_heater"; import "./controls/more-info-weather"; class MoreInfoContent extends UpdatingElement { - @property() public hass?: HomeAssistant; + @property({ attribute: false }) public hass?: HomeAssistant; @property() public stateObj?: HassEntity; diff --git a/src/dialogs/notifications/configurator-notification-item.ts b/src/dialogs/notifications/configurator-notification-item.ts index 296ead9767..a29f1db335 100644 --- a/src/dialogs/notifications/configurator-notification-item.ts +++ b/src/dialogs/notifications/configurator-notification-item.ts @@ -15,7 +15,7 @@ import "./notification-item-template"; @customElement("configurator-notification-item") export class HuiConfiguratorNotificationItem extends LitElement { - @property() public hass?: HomeAssistant; + @property({ attribute: false }) public hass?: HomeAssistant; @property() public notification?: PersitentNotificationEntity; diff --git a/src/dialogs/notifications/notification-item.ts b/src/dialogs/notifications/notification-item.ts index f540571965..41207b1db4 100644 --- a/src/dialogs/notifications/notification-item.ts +++ b/src/dialogs/notifications/notification-item.ts @@ -14,7 +14,7 @@ import "./persistent-notification-item"; @customElement("notification-item") export class HuiNotificationItem extends LitElement { - @property() public hass?: HomeAssistant; + @property({ attribute: false }) public hass?: HomeAssistant; @property() public notification?: HassEntity | PersistentNotification; diff --git a/src/dialogs/notifications/persistent-notification-item.ts b/src/dialogs/notifications/persistent-notification-item.ts index fa705a3900..a8f2a20777 100644 --- a/src/dialogs/notifications/persistent-notification-item.ts +++ b/src/dialogs/notifications/persistent-notification-item.ts @@ -17,7 +17,7 @@ import "./notification-item-template"; @customElement("persistent-notification-item") export class HuiPersistentNotificationItem extends LitElement { - @property() public hass?: HomeAssistant; + @property({ attribute: false }) public hass?: HomeAssistant; @property() public notification?: PersistentNotification; diff --git a/src/dialogs/voice-command-dialog/ha-voice-command-dialog.ts b/src/dialogs/voice-command-dialog/ha-voice-command-dialog.ts index 4b57035a8a..226bebba07 100644 --- a/src/dialogs/voice-command-dialog/ha-voice-command-dialog.ts +++ b/src/dialogs/voice-command-dialog/ha-voice-command-dialog.ts @@ -10,6 +10,7 @@ import { html, LitElement, property, + internalProperty, PropertyValues, query, TemplateResult, @@ -41,20 +42,20 @@ interface Results { @customElement("ha-voice-command-dialog") export class HaVoiceCommandDialog extends LitElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; @property() public results: Results | null = null; - @property() private _conversation: Message[] = [ + @internalProperty() private _conversation: Message[] = [ { who: "hass", text: "", }, ]; - @property() private _opened = false; + @internalProperty() private _opened = false; - @property() private _agentInfo?: AgentInfo; + @internalProperty() private _agentInfo?: AgentInfo; @query("#messages") private messages!: PaperDialogScrollableElement; diff --git a/src/layouts/hass-loading-screen.ts b/src/layouts/hass-loading-screen.ts index c8cdf24d97..f0b01c96b1 100644 --- a/src/layouts/hass-loading-screen.ts +++ b/src/layouts/hass-loading-screen.ts @@ -21,7 +21,7 @@ class HassLoadingScreen extends LitElement { @property({ type: Boolean }) public rootnav = false; - @property() public hass?: HomeAssistant; + @property({ attribute: false }) public hass?: HomeAssistant; @property() public narrow?: boolean; diff --git a/src/layouts/hass-tabs-subpage-data-table.ts b/src/layouts/hass-tabs-subpage-data-table.ts index b504b29947..e5e497d054 100644 --- a/src/layouts/hass-tabs-subpage-data-table.ts +++ b/src/layouts/hass-tabs-subpage-data-table.ts @@ -24,7 +24,7 @@ import { computeRTLDirection } from "../common/util/compute_rtl"; @customElement("hass-tabs-subpage-data-table") export class HaTabsSubpageDataTable extends LitElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; @property() public isWide!: boolean; diff --git a/src/layouts/hass-tabs-subpage.ts b/src/layouts/hass-tabs-subpage.ts index ebb3a8e4b8..44cdf6a4d6 100644 --- a/src/layouts/hass-tabs-subpage.ts +++ b/src/layouts/hass-tabs-subpage.ts @@ -6,6 +6,7 @@ import { html, LitElement, property, + internalProperty, PropertyValues, TemplateResult, eventOptions, @@ -36,7 +37,7 @@ export interface PageNavigation { @customElement("hass-tabs-subpage") class HassTabsSubpage extends LitElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; @property({ type: Boolean }) public hassio = false; @@ -52,7 +53,7 @@ class HassTabsSubpage extends LitElement { @property({ type: Boolean, reflect: true }) public narrow = false; - @property() private _activeTab?: PageNavigation; + @internalProperty() private _activeTab?: PageNavigation; // @ts-ignore @restoreScroll(".content") private _savedScrollPos?: number; diff --git a/src/layouts/home-assistant-main.ts b/src/layouts/home-assistant-main.ts index 5055c7d258..589f6208b5 100644 --- a/src/layouts/home-assistant-main.ts +++ b/src/layouts/home-assistant-main.ts @@ -31,7 +31,7 @@ declare global { @customElement("home-assistant-main") class HomeAssistantMain extends LitElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; @property() public route?: Route; diff --git a/src/layouts/home-assistant.ts b/src/layouts/home-assistant.ts index d4ea24beab..b1f95abd52 100644 --- a/src/layouts/home-assistant.ts +++ b/src/layouts/home-assistant.ts @@ -1,5 +1,10 @@ import "@polymer/app-route/app-location"; -import { html, property, PropertyValues, customElement } from "lit-element"; +import { + html, + internalProperty, + PropertyValues, + customElement, +} from "lit-element"; import { navigate } from "../common/navigate"; import { getStorageDefaultPanelUrlPath } from "../data/panel"; import "../resources/custom-card-support"; @@ -15,11 +20,11 @@ import { storeState } from "../util/ha-pref-storage"; @customElement("home-assistant") export class HomeAssistantAppEl extends HassElement { - @property() private _route?: Route; + @internalProperty() private _route?: Route; - @property() private _error = false; + @internalProperty() private _error = false; - @property() private _panelUrl?: string; + @internalProperty() private _panelUrl?: string; private _haVersion?: string; diff --git a/src/layouts/partial-panel-resolver.ts b/src/layouts/partial-panel-resolver.ts index 0d9838cb19..280a32eb16 100644 --- a/src/layouts/partial-panel-resolver.ts +++ b/src/layouts/partial-panel-resolver.ts @@ -87,7 +87,7 @@ const getRoutes = (panels: Panels): RouterOptions => { @customElement("partial-panel-resolver") class PartialPanelResolver extends HassRouterPage { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; @property() public narrow?: boolean; diff --git a/src/managers/notification-manager.ts b/src/managers/notification-manager.ts index 1607fadc20..2e4bed3c13 100644 --- a/src/managers/notification-manager.ts +++ b/src/managers/notification-manager.ts @@ -5,6 +5,7 @@ import { html, LitElement, property, + internalProperty, query, TemplateResult, } from "lit-element"; @@ -26,11 +27,11 @@ export interface ToastActionParams { } class NotificationManager extends LitElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; - @property() private _action?: ToastActionParams; + @internalProperty() private _action?: ToastActionParams; - @property() private _noCancelOnOutsideClick = false; + @internalProperty() private _noCancelOnOutsideClick = false; @query("ha-toast") private _toast!: HaToast; diff --git a/src/mixins/subscribe-mixin.ts b/src/mixins/subscribe-mixin.ts index 466e945af3..88c54eaf3c 100644 --- a/src/mixins/subscribe-mixin.ts +++ b/src/mixins/subscribe-mixin.ts @@ -10,7 +10,7 @@ export const SubscribeMixin = >( superClass: T ) => { class SubscribeClass extends superClass { - @property() public hass?: HomeAssistant; + @property({ attribute: false }) public hass?: HomeAssistant; private __unsubs?: Array>; diff --git a/src/onboarding/ha-onboarding.ts b/src/onboarding/ha-onboarding.ts index 3dfc002f02..cdd1a3af02 100644 --- a/src/onboarding/ha-onboarding.ts +++ b/src/onboarding/ha-onboarding.ts @@ -9,6 +9,7 @@ import { customElement, html, property, + internalProperty, PropertyValues, TemplateResult, } from "lit-element"; @@ -55,13 +56,13 @@ declare global { @customElement("ha-onboarding") class HaOnboarding extends litLocalizeLiteMixin(HassElement) { - @property() public hass?: HomeAssistant; + @property({ attribute: false }) public hass?: HomeAssistant; public translationFragment = "page-onboarding"; - @property() private _loading = false; + @internalProperty() private _loading = false; - @property() private _steps?: OnboardingStep[]; + @internalProperty() private _steps?: OnboardingStep[]; protected render(): TemplateResult { const step = this._curStep()!; diff --git a/src/onboarding/onboarding-core-config.ts b/src/onboarding/onboarding-core-config.ts index 0f69b3c03b..4b72d0d8e6 100644 --- a/src/onboarding/onboarding-core-config.ts +++ b/src/onboarding/onboarding-core-config.ts @@ -10,6 +10,7 @@ import { html, LitElement, property, + internalProperty, TemplateResult, } from "lit-element"; import { fireEvent } from "../common/dom/fire_event"; @@ -29,21 +30,21 @@ const amsterdam = [52.3731339, 4.8903147]; @customElement("onboarding-core-config") class OnboardingCoreConfig extends LitElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; @property() public onboardingLocalize!: LocalizeFunc; - @property() private _working = false; + @internalProperty() private _working = false; - @property() private _name!: ConfigUpdateValues["location_name"]; + @internalProperty() private _name!: ConfigUpdateValues["location_name"]; - @property() private _location!: [number, number]; + @internalProperty() private _location!: [number, number]; - @property() private _elevation!: string; + @internalProperty() private _elevation!: string; - @property() private _unitSystem!: ConfigUpdateValues["unit_system"]; + @internalProperty() private _unitSystem!: ConfigUpdateValues["unit_system"]; - @property() private _timeZone!: string; + @internalProperty() private _timeZone!: string; protected render(): TemplateResult { return html` diff --git a/src/onboarding/onboarding-create-user.ts b/src/onboarding/onboarding-create-user.ts index c1b6d16149..d12fcd97ce 100644 --- a/src/onboarding/onboarding-create-user.ts +++ b/src/onboarding/onboarding-create-user.ts @@ -8,6 +8,7 @@ import { html, LitElement, property, + internalProperty, PropertyValues, TemplateResult, } from "lit-element"; @@ -22,17 +23,17 @@ class OnboardingCreateUser extends LitElement { @property() public language!: string; - @property() private _name = ""; + @internalProperty() private _name = ""; - @property() private _username = ""; + @internalProperty() private _username = ""; - @property() private _password = ""; + @internalProperty() private _password = ""; - @property() private _passwordConfirm = ""; + @internalProperty() private _passwordConfirm = ""; - @property() private _loading = false; + @internalProperty() private _loading = false; - @property() private _errorMsg?: string = undefined; + @internalProperty() private _errorMsg?: string = undefined; protected render(): TemplateResult { return html` diff --git a/src/onboarding/onboarding-integrations.ts b/src/onboarding/onboarding-integrations.ts index 5213f024bd..e2ac111b9f 100644 --- a/src/onboarding/onboarding-integrations.ts +++ b/src/onboarding/onboarding-integrations.ts @@ -6,6 +6,7 @@ import { html, LitElement, property, + internalProperty, PropertyValues, TemplateResult, } from "lit-element"; @@ -30,13 +31,13 @@ import "./integration-badge"; @customElement("onboarding-integrations") class OnboardingIntegrations extends LitElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; @property() public onboardingLocalize!: LocalizeFunc; - @property() private _entries?: ConfigEntry[]; + @internalProperty() private _entries?: ConfigEntry[]; - @property() private _discovered?: DataEntryFlowProgress[]; + @internalProperty() private _discovered?: DataEntryFlowProgress[]; private _unsubEvents?: () => void; diff --git a/src/panels/calendar/ha-full-calendar.ts b/src/panels/calendar/ha-full-calendar.ts index 50c9da53a4..1a511028e0 100644 --- a/src/panels/calendar/ha-full-calendar.ts +++ b/src/panels/calendar/ha-full-calendar.ts @@ -1,5 +1,6 @@ import { property, + internalProperty, PropertyValues, LitElement, CSSResult, @@ -56,9 +57,9 @@ class HAFullCalendar extends LitElement { @property({ type: Boolean, reflect: true }) public narrow!: boolean; - @property() private calendar?: Calendar; + @internalProperty() private calendar?: Calendar; - @property() private _activeView = "dayGridMonth"; + @internalProperty() private _activeView = "dayGridMonth"; protected render(): TemplateResult { return html` diff --git a/src/panels/calendar/ha-panel-calendar.ts b/src/panels/calendar/ha-panel-calendar.ts index 7c4232bfa3..8f8133cc76 100644 --- a/src/panels/calendar/ha-panel-calendar.ts +++ b/src/panels/calendar/ha-panel-calendar.ts @@ -2,6 +2,7 @@ import { customElement, LitElement, property, + internalProperty, CSSResultArray, css, TemplateResult, @@ -33,14 +34,14 @@ import { getCalendars, fetchCalendarEvents } from "../../data/calendar"; @customElement("ha-panel-calendar") class PanelCalendar extends LitElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; @property({ type: Boolean, reflect: true }) public narrow!: boolean; - @property() private _calendars: SelectedCalendar[] = []; + @internalProperty() private _calendars: SelectedCalendar[] = []; - @property() private _events: CalendarEvent[] = []; + @internalProperty() private _events: CalendarEvent[] = []; private _start?: Date; diff --git a/src/panels/config/areas/dialog-area-registry-detail.ts b/src/panels/config/areas/dialog-area-registry-detail.ts index 78c5a522df..de7574b00c 100644 --- a/src/panels/config/areas/dialog-area-registry-detail.ts +++ b/src/panels/config/areas/dialog-area-registry-detail.ts @@ -7,6 +7,7 @@ import { html, LitElement, property, + internalProperty, TemplateResult, } from "lit-element"; import "../../../components/dialog/ha-paper-dialog"; @@ -17,15 +18,15 @@ import { HomeAssistant } from "../../../types"; import { AreaRegistryDetailDialogParams } from "./show-dialog-area-registry-detail"; class DialogAreaDetail extends LitElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; - @property() private _name!: string; + @internalProperty() private _name!: string; - @property() private _error?: string; + @internalProperty() private _error?: string; - @property() private _params?: AreaRegistryDetailDialogParams; + @internalProperty() private _params?: AreaRegistryDetailDialogParams; - @property() private _submitting?: boolean; + @internalProperty() private _submitting?: boolean; public async showDialog( params: AreaRegistryDetailDialogParams diff --git a/src/panels/config/areas/ha-config-area-page.ts b/src/panels/config/areas/ha-config-area-page.ts index 151ed75bb9..41bd615b2d 100644 --- a/src/panels/config/areas/ha-config-area-page.ts +++ b/src/panels/config/areas/ha-config-area-page.ts @@ -6,6 +6,7 @@ import { html, LitElement, property, + internalProperty, TemplateResult, } from "lit-element"; import { ifDefined } from "lit-html/directives/if-defined"; @@ -35,7 +36,7 @@ import { @customElement("ha-config-area-page") class HaConfigAreaPage extends LitElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; @property() public areaId!: string; @@ -51,7 +52,7 @@ class HaConfigAreaPage extends LitElement { @property() public route!: Route; - @property() private _related?: RelatedResult; + @internalProperty() private _related?: RelatedResult; private _area = memoizeOne((areaId: string, areas: AreaRegistryEntry[]): | AreaRegistryEntry diff --git a/src/panels/config/areas/ha-config-areas-dashboard.ts b/src/panels/config/areas/ha-config-areas-dashboard.ts index 2e0e56e9f2..6a80eabf20 100644 --- a/src/panels/config/areas/ha-config-areas-dashboard.ts +++ b/src/panels/config/areas/ha-config-areas-dashboard.ts @@ -42,7 +42,7 @@ import { computeRTL } from "../../../common/util/compute_rtl"; @customElement("ha-config-areas-dashboard") export class HaConfigAreasDashboard extends LitElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; @property() public isWide?: boolean; diff --git a/src/panels/config/areas/ha-config-areas.ts b/src/panels/config/areas/ha-config-areas.ts index 3e4bf1c0f4..1c00eb4f98 100644 --- a/src/panels/config/areas/ha-config-areas.ts +++ b/src/panels/config/areas/ha-config-areas.ts @@ -1,5 +1,10 @@ import { UnsubscribeFunc } from "home-assistant-js-websocket"; -import { customElement, property, PropertyValues } from "lit-element"; +import { + customElement, + property, + internalProperty, + PropertyValues, +} from "lit-element"; import { compare } from "../../../common/string/compare"; import { AreaRegistryEntry, @@ -20,7 +25,7 @@ import "./ha-config-areas-dashboard"; @customElement("ha-config-areas") class HaConfigAreas extends HassRouterPage { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; @property() public narrow!: boolean; @@ -41,11 +46,12 @@ class HaConfigAreas extends HassRouterPage { }, }; - @property() private _configEntries: ConfigEntry[] = []; + @internalProperty() private _configEntries: ConfigEntry[] = []; - @property() private _deviceRegistryEntries: DeviceRegistryEntry[] = []; + @internalProperty() + private _deviceRegistryEntries: DeviceRegistryEntry[] = []; - @property() private _areas: AreaRegistryEntry[] = []; + @internalProperty() private _areas: AreaRegistryEntry[] = []; private _unsubs?: UnsubscribeFunc[]; diff --git a/src/panels/config/automation/action/ha-automation-action-row.ts b/src/panels/config/automation/action/ha-automation-action-row.ts index 2cd6158fd3..d1e0767f5e 100644 --- a/src/panels/config/automation/action/ha-automation-action-row.ts +++ b/src/panels/config/automation/action/ha-automation-action-row.ts @@ -14,6 +14,7 @@ import { html, LitElement, property, + internalProperty, } from "lit-element"; import { dynamicElement } from "../../../../common/dom/dynamic-element-directive"; import { fireEvent } from "../../../../common/dom/fire_event"; @@ -78,7 +79,7 @@ export const handleChangeEvent = (element: ActionElement, ev: CustomEvent) => { @customElement("ha-automation-action-row") export default class HaAutomationActionRow extends LitElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; @property() public action!: Action; @@ -86,7 +87,7 @@ export default class HaAutomationActionRow extends LitElement { @property() public totalActions!: number; - @property() private _yamlMode = false; + @internalProperty() private _yamlMode = false; protected render() { const type = getType(this.action); diff --git a/src/panels/config/automation/action/ha-automation-action.ts b/src/panels/config/automation/action/ha-automation-action.ts index 35369a26df..d6e815ea63 100644 --- a/src/panels/config/automation/action/ha-automation-action.ts +++ b/src/panels/config/automation/action/ha-automation-action.ts @@ -16,7 +16,7 @@ import { HaDeviceAction } from "./types/ha-automation-action-device_id"; @customElement("ha-automation-action") export default class HaAutomationAction extends LitElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; @property() public actions!: Action[]; diff --git a/src/panels/config/automation/action/types/ha-automation-action-condition.ts b/src/panels/config/automation/action/types/ha-automation-action-condition.ts index 195e716804..8849117902 100644 --- a/src/panels/config/automation/action/types/ha-automation-action-condition.ts +++ b/src/panels/config/automation/action/types/ha-automation-action-condition.ts @@ -7,7 +7,7 @@ import { ActionElement } from "../ha-automation-action-row"; @customElement("ha-automation-action-condition") export class HaConditionAction extends LitElement implements ActionElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; @property() public action!: Condition; diff --git a/src/panels/config/automation/action/types/ha-automation-action-delay.ts b/src/panels/config/automation/action/types/ha-automation-action-delay.ts index 5067408ec2..f6380e99bd 100644 --- a/src/panels/config/automation/action/types/ha-automation-action-delay.ts +++ b/src/panels/config/automation/action/types/ha-automation-action-delay.ts @@ -8,7 +8,7 @@ import { ActionElement, handleChangeEvent } from "../ha-automation-action-row"; @customElement("ha-automation-action-delay") export class HaDelayAction extends LitElement implements ActionElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; @property() public action!: DelayAction; diff --git a/src/panels/config/automation/action/types/ha-automation-action-device_id.ts b/src/panels/config/automation/action/types/ha-automation-action-device_id.ts index 059d1835eb..da08f8d9de 100644 --- a/src/panels/config/automation/action/types/ha-automation-action-device_id.ts +++ b/src/panels/config/automation/action/types/ha-automation-action-device_id.ts @@ -1,4 +1,10 @@ -import { customElement, html, LitElement, property } from "lit-element"; +import { + customElement, + html, + LitElement, + property, + internalProperty, +} from "lit-element"; import memoizeOne from "memoize-one"; import { fireEvent } from "../../../../../common/dom/fire_event"; import "../../../../../components/device/ha-device-action-picker"; @@ -13,13 +19,13 @@ import { HomeAssistant } from "../../../../../types"; @customElement("ha-automation-action-device_id") export class HaDeviceAction extends LitElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; @property() public action!: DeviceAction; - @property() private _deviceId?: string; + @internalProperty() private _deviceId?: string; - @property() private _capabilities?; + @internalProperty() private _capabilities?; private _origAction?: DeviceAction; diff --git a/src/panels/config/automation/action/types/ha-automation-action-event.ts b/src/panels/config/automation/action/types/ha-automation-action-event.ts index dc876a9fdd..3cb54dbb42 100644 --- a/src/panels/config/automation/action/types/ha-automation-action-event.ts +++ b/src/panels/config/automation/action/types/ha-automation-action-event.ts @@ -17,7 +17,7 @@ import { ActionElement, handleChangeEvent } from "../ha-automation-action-row"; @customElement("ha-automation-action-event") export class HaEventAction extends LitElement implements ActionElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; @property() public action!: EventAction; diff --git a/src/panels/config/automation/action/types/ha-automation-action-scene.ts b/src/panels/config/automation/action/types/ha-automation-action-scene.ts index b69808c522..9b0610b187 100644 --- a/src/panels/config/automation/action/types/ha-automation-action-scene.ts +++ b/src/panels/config/automation/action/types/ha-automation-action-scene.ts @@ -10,7 +10,7 @@ const includeDomains = ["scene"]; @customElement("ha-automation-action-scene") export class HaSceneAction extends LitElement implements ActionElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; @property() public action!: SceneAction; diff --git a/src/panels/config/automation/action/types/ha-automation-action-service.ts b/src/panels/config/automation/action/types/ha-automation-action-service.ts index 3cdbc811e2..97b2a7bf17 100644 --- a/src/panels/config/automation/action/types/ha-automation-action-service.ts +++ b/src/panels/config/automation/action/types/ha-automation-action-service.ts @@ -22,7 +22,7 @@ import { ActionElement, handleChangeEvent } from "../ha-automation-action-row"; @customElement("ha-automation-action-service") export class HaServiceAction extends LitElement implements ActionElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; @property() public action!: ServiceAction; diff --git a/src/panels/config/automation/action/types/ha-automation-action-wait_template.ts b/src/panels/config/automation/action/types/ha-automation-action-wait_template.ts index 6924787d4b..e585d52032 100644 --- a/src/panels/config/automation/action/types/ha-automation-action-wait_template.ts +++ b/src/panels/config/automation/action/types/ha-automation-action-wait_template.ts @@ -8,7 +8,7 @@ import { ActionElement, handleChangeEvent } from "../ha-automation-action-row"; @customElement("ha-automation-action-wait_template") export class HaWaitAction extends LitElement implements ActionElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; @property() public action!: WaitAction; diff --git a/src/panels/config/automation/condition/ha-automation-condition-editor.ts b/src/panels/config/automation/condition/ha-automation-condition-editor.ts index 242f5b2085..ecc54fdfd1 100644 --- a/src/panels/config/automation/condition/ha-automation-condition-editor.ts +++ b/src/panels/config/automation/condition/ha-automation-condition-editor.ts @@ -35,7 +35,7 @@ const OPTIONS = [ @customElement("ha-automation-condition-editor") export default class HaAutomationConditionEditor extends LitElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; @property() public condition!: Condition; diff --git a/src/panels/config/automation/condition/ha-automation-condition-row.ts b/src/panels/config/automation/condition/ha-automation-condition-row.ts index be81fda127..e9dbf21fff 100644 --- a/src/panels/config/automation/condition/ha-automation-condition-row.ts +++ b/src/panels/config/automation/condition/ha-automation-condition-row.ts @@ -10,6 +10,7 @@ import { html, LitElement, property, + internalProperty, } from "lit-element"; import { fireEvent } from "../../../../common/dom/fire_event"; import "../../../../components/ha-card"; @@ -49,11 +50,11 @@ export const handleChangeEvent = ( @customElement("ha-automation-condition-row") export default class HaAutomationConditionRow extends LitElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; @property() public condition!: Condition; - @property() private _yamlMode = false; + @internalProperty() private _yamlMode = false; protected render() { if (!this.condition) { diff --git a/src/panels/config/automation/condition/ha-automation-condition.ts b/src/panels/config/automation/condition/ha-automation-condition.ts index c65502bfa4..05367bd6a2 100644 --- a/src/panels/config/automation/condition/ha-automation-condition.ts +++ b/src/panels/config/automation/condition/ha-automation-condition.ts @@ -16,7 +16,7 @@ import { HaDeviceCondition } from "./types/ha-automation-condition-device"; @customElement("ha-automation-condition") export default class HaAutomationCondition extends LitElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; @property() public conditions!: Condition[]; diff --git a/src/panels/config/automation/condition/types/ha-automation-condition-device.ts b/src/panels/config/automation/condition/types/ha-automation-condition-device.ts index 40eca3eb45..d3c728a5c1 100644 --- a/src/panels/config/automation/condition/types/ha-automation-condition-device.ts +++ b/src/panels/config/automation/condition/types/ha-automation-condition-device.ts @@ -1,4 +1,10 @@ -import { customElement, html, LitElement, property } from "lit-element"; +import { + customElement, + html, + LitElement, + property, + internalProperty, +} from "lit-element"; import { fireEvent } from "../../../../../common/dom/fire_event"; import "../../../../../components/device/ha-device-condition-picker"; import "../../../../../components/device/ha-device-picker"; @@ -12,13 +18,13 @@ import { HomeAssistant } from "../../../../../types"; @customElement("ha-automation-condition-device") export class HaDeviceCondition extends LitElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; @property() public condition!: DeviceCondition; - @property() private _deviceId?: string; + @internalProperty() private _deviceId?: string; - @property() private _capabilities?; + @internalProperty() private _capabilities?; private _origCondition?: DeviceCondition; diff --git a/src/panels/config/automation/condition/types/ha-automation-condition-logical.ts b/src/panels/config/automation/condition/types/ha-automation-condition-logical.ts index d2c4b3e607..6d6fc40f77 100644 --- a/src/panels/config/automation/condition/types/ha-automation-condition-logical.ts +++ b/src/panels/config/automation/condition/types/ha-automation-condition-logical.ts @@ -7,7 +7,7 @@ import { ConditionElement } from "../ha-automation-condition-row"; @customElement("ha-automation-condition-logical") export class HaLogicalCondition extends LitElement implements ConditionElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; @property() public condition!: LogicalCondition; diff --git a/src/panels/config/automation/condition/types/ha-automation-condition-numeric_state.ts b/src/panels/config/automation/condition/types/ha-automation-condition-numeric_state.ts index b73e5e4879..1c3adae50d 100644 --- a/src/panels/config/automation/condition/types/ha-automation-condition-numeric_state.ts +++ b/src/panels/config/automation/condition/types/ha-automation-condition-numeric_state.ts @@ -9,7 +9,7 @@ import { handleChangeEvent } from "../ha-automation-condition-row"; @customElement("ha-automation-condition-numeric_state") export default class HaNumericStateCondition extends LitElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; @property() public condition!: NumericStateCondition; diff --git a/src/panels/config/automation/condition/types/ha-automation-condition-state.ts b/src/panels/config/automation/condition/types/ha-automation-condition-state.ts index 7627c88916..8795dca8ba 100644 --- a/src/panels/config/automation/condition/types/ha-automation-condition-state.ts +++ b/src/panels/config/automation/condition/types/ha-automation-condition-state.ts @@ -12,7 +12,7 @@ import { @customElement("ha-automation-condition-state") export class HaStateCondition extends LitElement implements ConditionElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; @property() public condition!: StateCondition; diff --git a/src/panels/config/automation/condition/types/ha-automation-condition-sun.ts b/src/panels/config/automation/condition/types/ha-automation-condition-sun.ts index 99386c1f26..becb62bf8c 100644 --- a/src/panels/config/automation/condition/types/ha-automation-condition-sun.ts +++ b/src/panels/config/automation/condition/types/ha-automation-condition-sun.ts @@ -13,7 +13,7 @@ import { @customElement("ha-automation-condition-sun") export class HaSunCondition extends LitElement implements ConditionElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; @property() public condition!: SunCondition; diff --git a/src/panels/config/automation/condition/types/ha-automation-condition-template.ts b/src/panels/config/automation/condition/types/ha-automation-condition-template.ts index c3d06a0355..e226d9534a 100644 --- a/src/panels/config/automation/condition/types/ha-automation-condition-template.ts +++ b/src/panels/config/automation/condition/types/ha-automation-condition-template.ts @@ -6,7 +6,7 @@ import { handleChangeEvent } from "../ha-automation-condition-row"; @customElement("ha-automation-condition-template") export class HaTemplateCondition extends LitElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; @property() public condition!: TemplateCondition; diff --git a/src/panels/config/automation/condition/types/ha-automation-condition-time.ts b/src/panels/config/automation/condition/types/ha-automation-condition-time.ts index 708624abfd..7f790194fc 100644 --- a/src/panels/config/automation/condition/types/ha-automation-condition-time.ts +++ b/src/panels/config/automation/condition/types/ha-automation-condition-time.ts @@ -9,7 +9,7 @@ import { @customElement("ha-automation-condition-time") export class HaTimeCondition extends LitElement implements ConditionElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; @property() public condition!: TimeCondition; diff --git a/src/panels/config/automation/condition/types/ha-automation-condition-zone.ts b/src/panels/config/automation/condition/types/ha-automation-condition-zone.ts index 2f7416f4e1..e84bd7766d 100644 --- a/src/panels/config/automation/condition/types/ha-automation-condition-zone.ts +++ b/src/panels/config/automation/condition/types/ha-automation-condition-zone.ts @@ -16,7 +16,7 @@ const includeDomains = ["zone"]; @customElement("ha-automation-condition-zone") export class HaZoneCondition extends LitElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; @property() public condition!: ZoneCondition; diff --git a/src/panels/config/automation/ha-automation-editor.ts b/src/panels/config/automation/ha-automation-editor.ts index cc70db4fe5..5c93e80db0 100644 --- a/src/panels/config/automation/ha-automation-editor.ts +++ b/src/panels/config/automation/ha-automation-editor.ts @@ -9,6 +9,7 @@ import { html, LitElement, property, + internalProperty, PropertyValues, TemplateResult, } from "lit-element"; @@ -50,7 +51,7 @@ const MODES = ["parallel", "single", "restart", "queued"]; const MODES_MAX = ["queued", "parallel"]; export class HaAutomationEditor extends LitElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; @property() public automationId!: string; @@ -62,13 +63,13 @@ export class HaAutomationEditor extends LitElement { @property() public route!: Route; - @property() private _config?: AutomationConfig; + @internalProperty() private _config?: AutomationConfig; - @property() private _dirty?: boolean; + @internalProperty() private _dirty?: boolean; - @property() private _errors?: string; + @internalProperty() private _errors?: string; - @property() private _entityId?: string; + @internalProperty() private _entityId?: string; protected render(): TemplateResult { const stateObj = this._entityId diff --git a/src/panels/config/automation/ha-automation-picker.ts b/src/panels/config/automation/ha-automation-picker.ts index 30d92aef41..f853558bfb 100644 --- a/src/panels/config/automation/ha-automation-picker.ts +++ b/src/panels/config/automation/ha-automation-picker.ts @@ -35,7 +35,7 @@ import { mdiPlus } from "@mdi/js"; @customElement("ha-automation-picker") class HaAutomationPicker extends LitElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; @property() public isWide!: boolean; diff --git a/src/panels/config/automation/ha-config-automation.ts b/src/panels/config/automation/ha-config-automation.ts index 3ae487499f..7b0953d0e5 100644 --- a/src/panels/config/automation/ha-config-automation.ts +++ b/src/panels/config/automation/ha-config-automation.ts @@ -21,7 +21,7 @@ const equal = (a: AutomationEntity[], b: AutomationEntity[]): boolean => { @customElement("ha-config-automation") class HaConfigAutomation extends HassRouterPage { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; @property() public narrow!: boolean; diff --git a/src/panels/config/automation/thingtalk/dialog-thingtalk.ts b/src/panels/config/automation/thingtalk/dialog-thingtalk.ts index 7bf85c3ff8..60f027fe53 100644 --- a/src/panels/config/automation/thingtalk/dialog-thingtalk.ts +++ b/src/panels/config/automation/thingtalk/dialog-thingtalk.ts @@ -10,6 +10,7 @@ import { html, LitElement, property, + internalProperty, query, TemplateResult, } from "lit-element"; @@ -37,17 +38,17 @@ export interface PlaceholderContainer { @customElement("ha-dialog-thinktalk") class DialogThingtalk extends LitElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; - @property() private _error?: string; + @internalProperty() private _error?: string; - @property() private _params?: ThingtalkDialogParams; + @internalProperty() private _params?: ThingtalkDialogParams; - @property() private _submitting = false; + @internalProperty() private _submitting = false; - @property() private _opened = false; + @internalProperty() private _opened = false; - @property() private _placeholders?: PlaceholderContainer; + @internalProperty() private _placeholders?: PlaceholderContainer; @query("#input") private _input?: PaperInputElement; diff --git a/src/panels/config/automation/thingtalk/ha-thingtalk-placeholders.ts b/src/panels/config/automation/thingtalk/ha-thingtalk-placeholders.ts index 3a1d1db4ab..d9cea90ffe 100644 --- a/src/panels/config/automation/thingtalk/ha-thingtalk-placeholders.ts +++ b/src/panels/config/automation/thingtalk/ha-thingtalk-placeholders.ts @@ -6,6 +6,7 @@ import { html, LitElement, property, + internalProperty, PropertyValues, TemplateResult, } from "lit-element"; @@ -63,7 +64,7 @@ interface DeviceEntitiesLookup { @customElement("ha-thingtalk-placeholders") export class ThingTalkPlaceholders extends SubscribeMixin(LitElement) { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; @property() public opened!: boolean; @@ -71,13 +72,13 @@ export class ThingTalkPlaceholders extends SubscribeMixin(LitElement) { @property() public placeholders!: PlaceholderContainer; - @property() private _error?: string; + @internalProperty() private _error?: string; private _deviceEntityLookup: DeviceEntitiesLookup = {}; - @property() private _extraInfo: ExtraInfo = {}; + @internalProperty() private _extraInfo: ExtraInfo = {}; - @property() private _placeholderValues: PlaceholderValues = {}; + @internalProperty() private _placeholderValues: PlaceholderValues = {}; private _devices?: DeviceRegistryEntry[]; diff --git a/src/panels/config/automation/trigger/ha-automation-trigger-row.ts b/src/panels/config/automation/trigger/ha-automation-trigger-row.ts index 58444edcd5..c9c4efac28 100644 --- a/src/panels/config/automation/trigger/ha-automation-trigger-row.ts +++ b/src/panels/config/automation/trigger/ha-automation-trigger-row.ts @@ -13,6 +13,7 @@ import { html, LitElement, property, + internalProperty, } from "lit-element"; import { dynamicElement } from "../../../../common/dom/dynamic-element-directive"; import { fireEvent } from "../../../../common/dom/fire_event"; @@ -78,11 +79,11 @@ export const handleChangeEvent = (element: TriggerElement, ev: CustomEvent) => { @customElement("ha-automation-trigger-row") export default class HaAutomationTriggerRow extends LitElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; @property() public trigger!: Trigger; - @property() private _yamlMode = false; + @internalProperty() private _yamlMode = false; protected render() { const selected = OPTIONS.indexOf(this.trigger.platform); diff --git a/src/panels/config/automation/trigger/ha-automation-trigger.ts b/src/panels/config/automation/trigger/ha-automation-trigger.ts index 39d8467a1e..a074cbb881 100644 --- a/src/panels/config/automation/trigger/ha-automation-trigger.ts +++ b/src/panels/config/automation/trigger/ha-automation-trigger.ts @@ -16,7 +16,7 @@ import { HaDeviceTrigger } from "./types/ha-automation-trigger-device"; @customElement("ha-automation-trigger") export default class HaAutomationTrigger extends LitElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; @property() public triggers!: Trigger[]; diff --git a/src/panels/config/automation/trigger/types/ha-automation-trigger-device.ts b/src/panels/config/automation/trigger/types/ha-automation-trigger-device.ts index 1dea9a2391..684696c546 100644 --- a/src/panels/config/automation/trigger/types/ha-automation-trigger-device.ts +++ b/src/panels/config/automation/trigger/types/ha-automation-trigger-device.ts @@ -1,4 +1,10 @@ -import { customElement, html, LitElement, property } from "lit-element"; +import { + customElement, + html, + LitElement, + property, + internalProperty, +} from "lit-element"; import { fireEvent } from "../../../../../common/dom/fire_event"; import "../../../../../components/device/ha-device-picker"; import "../../../../../components/device/ha-device-trigger-picker"; @@ -12,13 +18,13 @@ import { HomeAssistant } from "../../../../../types"; @customElement("ha-automation-trigger-device") export class HaDeviceTrigger extends LitElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; @property() public trigger!: DeviceTrigger; - @property() private _deviceId?: string; + @internalProperty() private _deviceId?: string; - @property() private _capabilities?; + @internalProperty() private _capabilities?; private _origTrigger?: DeviceTrigger; diff --git a/src/panels/config/automation/trigger/types/ha-automation-trigger-event.ts b/src/panels/config/automation/trigger/types/ha-automation-trigger-event.ts index c8ba2e984e..fd1555c598 100644 --- a/src/panels/config/automation/trigger/types/ha-automation-trigger-event.ts +++ b/src/panels/config/automation/trigger/types/ha-automation-trigger-event.ts @@ -11,7 +11,7 @@ import { @customElement("ha-automation-trigger-event") export class HaEventTrigger extends LitElement implements TriggerElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; @property() public trigger!: EventTrigger; diff --git a/src/panels/config/automation/trigger/types/ha-automation-trigger-geo_location.ts b/src/panels/config/automation/trigger/types/ha-automation-trigger-geo_location.ts index 42fe2d0245..b65fac6d92 100644 --- a/src/panels/config/automation/trigger/types/ha-automation-trigger-geo_location.ts +++ b/src/panels/config/automation/trigger/types/ha-automation-trigger-geo_location.ts @@ -12,7 +12,7 @@ const includeDomains = ["zone"]; @customElement("ha-automation-trigger-geo_location") export default class HaGeolocationTrigger extends LitElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; @property() public trigger!: GeoLocationTrigger; diff --git a/src/panels/config/automation/trigger/types/ha-automation-trigger-homeassistant.ts b/src/panels/config/automation/trigger/types/ha-automation-trigger-homeassistant.ts index e6e2136cca..ec346a1316 100644 --- a/src/panels/config/automation/trigger/types/ha-automation-trigger-homeassistant.ts +++ b/src/panels/config/automation/trigger/types/ha-automation-trigger-homeassistant.ts @@ -8,7 +8,7 @@ import type { HomeAssistant } from "../../../../../types"; @customElement("ha-automation-trigger-homeassistant") export default class HaHassTrigger extends LitElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; @property() public trigger!: HassTrigger; diff --git a/src/panels/config/automation/trigger/types/ha-automation-trigger-mqtt.ts b/src/panels/config/automation/trigger/types/ha-automation-trigger-mqtt.ts index 2f55a97a9a..0450f37ff2 100644 --- a/src/panels/config/automation/trigger/types/ha-automation-trigger-mqtt.ts +++ b/src/panels/config/automation/trigger/types/ha-automation-trigger-mqtt.ts @@ -9,7 +9,7 @@ import { @customElement("ha-automation-trigger-mqtt") export class HaMQTTTrigger extends LitElement implements TriggerElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; @property() public trigger!: MqttTrigger; diff --git a/src/panels/config/automation/trigger/types/ha-automation-trigger-numeric_state.ts b/src/panels/config/automation/trigger/types/ha-automation-trigger-numeric_state.ts index b8d4cffd71..6d10f83c2d 100644 --- a/src/panels/config/automation/trigger/types/ha-automation-trigger-numeric_state.ts +++ b/src/panels/config/automation/trigger/types/ha-automation-trigger-numeric_state.ts @@ -9,7 +9,7 @@ import { handleChangeEvent } from "../ha-automation-trigger-row"; @customElement("ha-automation-trigger-numeric_state") export default class HaNumericStateTrigger extends LitElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; @property() public trigger!: NumericStateTrigger; diff --git a/src/panels/config/automation/trigger/types/ha-automation-trigger-state.ts b/src/panels/config/automation/trigger/types/ha-automation-trigger-state.ts index 02a9f03c54..838c789b56 100644 --- a/src/panels/config/automation/trigger/types/ha-automation-trigger-state.ts +++ b/src/panels/config/automation/trigger/types/ha-automation-trigger-state.ts @@ -12,7 +12,7 @@ import { @customElement("ha-automation-trigger-state") export class HaStateTrigger extends LitElement implements TriggerElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; @property() public trigger!: StateTrigger; diff --git a/src/panels/config/automation/trigger/types/ha-automation-trigger-sun.ts b/src/panels/config/automation/trigger/types/ha-automation-trigger-sun.ts index 349f391842..3c2bb9cf62 100644 --- a/src/panels/config/automation/trigger/types/ha-automation-trigger-sun.ts +++ b/src/panels/config/automation/trigger/types/ha-automation-trigger-sun.ts @@ -13,7 +13,7 @@ import { @customElement("ha-automation-trigger-sun") export class HaSunTrigger extends LitElement implements TriggerElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; @property() public trigger!: SunTrigger; diff --git a/src/panels/config/automation/trigger/types/ha-automation-trigger-template.ts b/src/panels/config/automation/trigger/types/ha-automation-trigger-template.ts index 4687229463..c4aacff1bb 100644 --- a/src/panels/config/automation/trigger/types/ha-automation-trigger-template.ts +++ b/src/panels/config/automation/trigger/types/ha-automation-trigger-template.ts @@ -6,7 +6,7 @@ import { handleChangeEvent } from "../ha-automation-trigger-row"; @customElement("ha-automation-trigger-template") export class HaTemplateTrigger extends LitElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; @property() public trigger!: TemplateTrigger; diff --git a/src/panels/config/automation/trigger/types/ha-automation-trigger-time.ts b/src/panels/config/automation/trigger/types/ha-automation-trigger-time.ts index f308b59187..7ea3043660 100644 --- a/src/panels/config/automation/trigger/types/ha-automation-trigger-time.ts +++ b/src/panels/config/automation/trigger/types/ha-automation-trigger-time.ts @@ -9,7 +9,7 @@ import { @customElement("ha-automation-trigger-time") export class HaTimeTrigger extends LitElement implements TriggerElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; @property() public trigger!: TimeTrigger; diff --git a/src/panels/config/automation/trigger/types/ha-automation-trigger-time_pattern.ts b/src/panels/config/automation/trigger/types/ha-automation-trigger-time_pattern.ts index db0b0dc906..1f0f081ad9 100644 --- a/src/panels/config/automation/trigger/types/ha-automation-trigger-time_pattern.ts +++ b/src/panels/config/automation/trigger/types/ha-automation-trigger-time_pattern.ts @@ -9,7 +9,7 @@ import { @customElement("ha-automation-trigger-time_pattern") export class HaTimePatternTrigger extends LitElement implements TriggerElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; @property() public trigger!: TimePatternTrigger; diff --git a/src/panels/config/automation/trigger/types/ha-automation-trigger-webhook.ts b/src/panels/config/automation/trigger/types/ha-automation-trigger-webhook.ts index 0ca2a1fe65..3eb56a805e 100644 --- a/src/panels/config/automation/trigger/types/ha-automation-trigger-webhook.ts +++ b/src/panels/config/automation/trigger/types/ha-automation-trigger-webhook.ts @@ -6,7 +6,7 @@ import { handleChangeEvent } from "../ha-automation-trigger-row"; @customElement("ha-automation-trigger-webhook") export class HaWebhookTrigger extends LitElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; @property() public trigger!: WebhookTrigger; diff --git a/src/panels/config/automation/trigger/types/ha-automation-trigger-zone.ts b/src/panels/config/automation/trigger/types/ha-automation-trigger-zone.ts index 47b140718c..4d93d61f6c 100644 --- a/src/panels/config/automation/trigger/types/ha-automation-trigger-zone.ts +++ b/src/panels/config/automation/trigger/types/ha-automation-trigger-zone.ts @@ -18,7 +18,7 @@ const includeDomains = ["zone"]; @customElement("ha-automation-trigger-zone") export class HaZoneTrigger extends LitElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; @property() public trigger!: ZoneTrigger; diff --git a/src/panels/config/cloud/account/cloud-alexa-pref.ts b/src/panels/config/cloud/account/cloud-alexa-pref.ts index 8fae8a1895..f8753c34d4 100644 --- a/src/panels/config/cloud/account/cloud-alexa-pref.ts +++ b/src/panels/config/cloud/account/cloud-alexa-pref.ts @@ -5,6 +5,7 @@ import { html, LitElement, property, + internalProperty, TemplateResult, } from "lit-element"; import { fireEvent } from "../../../../common/dom/fire_event"; @@ -16,11 +17,11 @@ import { CloudStatusLoggedIn, updateCloudPref } from "../../../../data/cloud"; import type { HomeAssistant } from "../../../../types"; export class CloudAlexaPref extends LitElement { - @property() public hass?: HomeAssistant; + @property({ attribute: false }) public hass?: HomeAssistant; @property() public cloudStatus?: CloudStatusLoggedIn; - @property() private _syncing = false; + @internalProperty() private _syncing = false; protected render(): TemplateResult { if (!this.cloudStatus) { diff --git a/src/panels/config/cloud/account/cloud-google-pref.ts b/src/panels/config/cloud/account/cloud-google-pref.ts index ed9db0a768..1d47bc2ddc 100644 --- a/src/panels/config/cloud/account/cloud-google-pref.ts +++ b/src/panels/config/cloud/account/cloud-google-pref.ts @@ -18,7 +18,7 @@ import type { HomeAssistant } from "../../../../types"; import { showSaveSuccessToast } from "../../../../util/toast-saved-success"; export class CloudGooglePref extends LitElement { - @property() public hass?: HomeAssistant; + @property({ attribute: false }) public hass?: HomeAssistant; @property() public cloudStatus?: CloudStatusLoggedIn; diff --git a/src/panels/config/cloud/account/cloud-remote-pref.ts b/src/panels/config/cloud/account/cloud-remote-pref.ts index c2c72c1ed7..0df92f38da 100644 --- a/src/panels/config/cloud/account/cloud-remote-pref.ts +++ b/src/panels/config/cloud/account/cloud-remote-pref.ts @@ -24,7 +24,7 @@ import { showCloudCertificateDialog } from "../dialog-cloud-certificate/show-dia @customElement("cloud-remote-pref") export class CloudRemotePref extends LitElement { - @property() public hass?: HomeAssistant; + @property({ attribute: false }) public hass?: HomeAssistant; @property() public cloudStatus?: CloudStatusLoggedIn; diff --git a/src/panels/config/cloud/account/cloud-webhooks.ts b/src/panels/config/cloud/account/cloud-webhooks.ts index bde7ec9f77..8b35052539 100644 --- a/src/panels/config/cloud/account/cloud-webhooks.ts +++ b/src/panels/config/cloud/account/cloud-webhooks.ts @@ -1,7 +1,13 @@ import "@polymer/paper-item/paper-item"; import "@polymer/paper-item/paper-item-body"; import "../../../../components/ha-circular-progress"; -import { html, LitElement, property, PropertyValues } from "lit-element"; +import { + html, + LitElement, + property, + internalProperty, + PropertyValues, +} from "lit-element"; import "../../../../components/ha-card"; import "../../../../components/ha-switch"; import { @@ -15,15 +21,17 @@ import { HomeAssistant, WebhookError } from "../../../../types"; import { showManageCloudhookDialog } from "../dialog-manage-cloudhook/show-dialog-manage-cloudhook"; export class CloudWebhooks extends LitElement { - @property() public hass?: HomeAssistant; + @property({ attribute: false }) public hass?: HomeAssistant; @property() public cloudStatus?: CloudStatusLoggedIn; - @property() private _cloudHooks?: { [webhookId: string]: CloudWebhook }; + @internalProperty() private _cloudHooks?: { + [webhookId: string]: CloudWebhook; + }; - @property() private _localHooks?: Webhook[]; + @internalProperty() private _localHooks?: Webhook[]; - @property() private _progress: string[]; + @internalProperty() private _progress: string[]; constructor() { super(); diff --git a/src/panels/config/cloud/alexa/cloud-alexa.ts b/src/panels/config/cloud/alexa/cloud-alexa.ts index 277d0022d4..3dd625cc6c 100644 --- a/src/panels/config/cloud/alexa/cloud-alexa.ts +++ b/src/panels/config/cloud/alexa/cloud-alexa.ts @@ -6,6 +6,7 @@ import { html, LitElement, property, + internalProperty, TemplateResult, } from "lit-element"; import memoizeOne from "memoize-one"; @@ -46,14 +47,14 @@ const configIsExposed = (config: AlexaEntityConfig) => @customElement("cloud-alexa") class CloudAlexa extends LitElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; @property() public cloudStatus!: CloudStatusLoggedIn; @property({ type: Boolean }) public narrow!: boolean; - @property() private _entities?: AlexaEntity[]; + @internalProperty() private _entities?: AlexaEntity[]; @property() private _entityConfigs: CloudPreferences["alexa_entity_configs"] = {}; diff --git a/src/panels/config/cloud/dialog-manage-cloudhook/dialog-manage-cloudhook.ts b/src/panels/config/cloud/dialog-manage-cloudhook/dialog-manage-cloudhook.ts index 2e54752063..b590848f99 100644 --- a/src/panels/config/cloud/dialog-manage-cloudhook/dialog-manage-cloudhook.ts +++ b/src/panels/config/cloud/dialog-manage-cloudhook/dialog-manage-cloudhook.ts @@ -2,7 +2,13 @@ import "@material/mwc-button"; import "@polymer/paper-dialog-scrollable/paper-dialog-scrollable"; import "@polymer/paper-input/paper-input"; import type { PaperInputElement } from "@polymer/paper-input/paper-input"; -import { css, CSSResult, html, LitElement, property } from "lit-element"; +import { + css, + CSSResult, + html, + LitElement, + internalProperty, +} from "lit-element"; import "../../../../components/dialog/ha-paper-dialog"; import type { HaPaperDialog } from "../../../../components/dialog/ha-paper-dialog"; import { showConfirmationDialog } from "../../../../dialogs/generic/show-dialog-box"; @@ -15,7 +21,7 @@ const inputLabel = "Public URL – Click to copy to clipboard"; export class DialogManageCloudhook extends LitElement { protected hass?: HomeAssistant; - @property() private _params?: WebhookDialogParams; + @internalProperty() private _params?: WebhookDialogParams; public async showDialog(params: WebhookDialogParams) { this._params = params; diff --git a/src/panels/config/cloud/google-assistant/cloud-google-assistant.ts b/src/panels/config/cloud/google-assistant/cloud-google-assistant.ts index ea09102aea..bdf23ec5f5 100644 --- a/src/panels/config/cloud/google-assistant/cloud-google-assistant.ts +++ b/src/panels/config/cloud/google-assistant/cloud-google-assistant.ts @@ -6,6 +6,7 @@ import { html, LitElement, property, + internalProperty, TemplateResult, } from "lit-element"; import memoizeOne from "memoize-one"; @@ -50,13 +51,13 @@ const configIsExposed = (config: GoogleEntityConfig) => @customElement("cloud-google-assistant") class CloudGoogleAssistant extends LitElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; @property() public cloudStatus!: CloudStatusLoggedIn; @property() public narrow!: boolean; - @property() private _entities?: GoogleEntity[]; + @internalProperty() private _entities?: GoogleEntity[]; @property() private _entityConfigs: CloudPreferences["google_entity_configs"] = {}; diff --git a/src/panels/config/cloud/ha-config-cloud.ts b/src/panels/config/cloud/ha-config-cloud.ts index 93d4bef9fd..333eaff674 100644 --- a/src/panels/config/cloud/ha-config-cloud.ts +++ b/src/panels/config/cloud/ha-config-cloud.ts @@ -1,5 +1,5 @@ import { PolymerElement } from "@polymer/polymer"; -import { customElement, property } from "lit-element"; +import { customElement, property, internalProperty } from "lit-element"; import { navigate } from "../../../common/navigate"; import { CloudStatus } from "../../../data/cloud"; import { @@ -16,7 +16,7 @@ const NOT_LOGGED_IN_URLS = ["login", "register", "forgot-password"]; @customElement("ha-config-cloud") class HaConfigCloud extends HassRouterPage { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; @property() public isWide!: boolean; @@ -77,9 +77,9 @@ class HaConfigCloud extends HassRouterPage { }, }; - @property() private _flashMessage = ""; + @internalProperty() private _flashMessage = ""; - @property() private _loginEmail = ""; + @internalProperty() private _loginEmail = ""; private _resolveCloudStatusLoaded!: () => void; diff --git a/src/panels/config/core/ha-config-core-form.ts b/src/panels/config/core/ha-config-core-form.ts index 57dc3327d9..e4b302b139 100644 --- a/src/panels/config/core/ha-config-core-form.ts +++ b/src/panels/config/core/ha-config-core-form.ts @@ -10,6 +10,7 @@ import { html, LitElement, property, + internalProperty, TemplateResult, } from "lit-element"; import { UNIT_C } from "../../../common/const"; @@ -22,17 +23,17 @@ import type { HomeAssistant } from "../../../types"; @customElement("ha-config-core-form") class ConfigCoreForm extends LitElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; - @property() private _working = false; + @internalProperty() private _working = false; - @property() private _location!: [number, number]; + @internalProperty() private _location!: [number, number]; - @property() private _elevation!: string; + @internalProperty() private _elevation!: string; - @property() private _unitSystem!: ConfigUpdateValues["unit_system"]; + @internalProperty() private _unitSystem!: ConfigUpdateValues["unit_system"]; - @property() private _timeZone!: string; + @internalProperty() private _timeZone!: string; protected render(): TemplateResult { const canEdit = ["storage", "default"].includes( diff --git a/src/panels/config/core/ha-config-name-form.ts b/src/panels/config/core/ha-config-name-form.ts index 6543546c67..d8315c6104 100644 --- a/src/panels/config/core/ha-config-name-form.ts +++ b/src/panels/config/core/ha-config-name-form.ts @@ -8,6 +8,7 @@ import { html, LitElement, property, + internalProperty, TemplateResult, } from "lit-element"; import "../../../components/ha-card"; @@ -17,11 +18,11 @@ import type { HomeAssistant } from "../../../types"; @customElement("ha-config-name-form") class ConfigNameForm extends LitElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; - @property() private _working = false; + @internalProperty() private _working = false; - @property() private _name!: ConfigUpdateValues["location_name"]; + @internalProperty() private _name!: ConfigUpdateValues["location_name"]; protected render(): TemplateResult { const canEdit = ["storage", "default"].includes( diff --git a/src/panels/config/core/ha-config-url-form.ts b/src/panels/config/core/ha-config-url-form.ts index 216cd7b947..e63b256e0c 100644 --- a/src/panels/config/core/ha-config-url-form.ts +++ b/src/panels/config/core/ha-config-url-form.ts @@ -8,6 +8,7 @@ import { html, LitElement, property, + internalProperty, TemplateResult, } from "lit-element"; import "../../../components/ha-card"; @@ -17,15 +18,15 @@ import type { HomeAssistant } from "../../../types"; @customElement("ha-config-url-form") class ConfigUrlForm extends LitElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; - @property() private _error?: string; + @internalProperty() private _error?: string; - @property() private _working = false; + @internalProperty() private _working = false; - @property() private _external_url?: string; + @internalProperty() private _external_url?: string; - @property() private _internal_url?: string; + @internalProperty() private _internal_url?: string; protected render(): TemplateResult { const canEdit = ["storage", "default"].includes( diff --git a/src/panels/config/dashboard/ha-config-dashboard.ts b/src/panels/config/dashboard/ha-config-dashboard.ts index 9fdb8add69..33b419c6d5 100644 --- a/src/panels/config/dashboard/ha-config-dashboard.ts +++ b/src/panels/config/dashboard/ha-config-dashboard.ts @@ -24,7 +24,7 @@ import { mdiCloudLock } from "@mdi/js"; @customElement("ha-config-dashboard") class HaConfigDashboard extends LitElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; @property({ type: Boolean, reflect: true }) public narrow!: boolean; diff --git a/src/panels/config/dashboard/ha-config-navigation.ts b/src/panels/config/dashboard/ha-config-navigation.ts index 74c5afcfed..b5ce582e20 100644 --- a/src/panels/config/dashboard/ha-config-navigation.ts +++ b/src/panels/config/dashboard/ha-config-navigation.ts @@ -18,7 +18,7 @@ import { HomeAssistant } from "../../../types"; @customElement("ha-config-navigation") class HaConfigNavigation extends LitElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; @property() public showAdvanced!: boolean; diff --git a/src/panels/config/devices/device-detail/ha-device-automation-card.ts b/src/panels/config/devices/device-detail/ha-device-automation-card.ts index 3549a9b9b8..ba0a8b7d5a 100644 --- a/src/panels/config/devices/device-detail/ha-device-automation-card.ts +++ b/src/panels/config/devices/device-detail/ha-device-automation-card.ts @@ -16,7 +16,7 @@ import { HomeAssistant } from "../../../../types"; export abstract class HaDeviceAutomationCard< T extends DeviceAutomation > extends LitElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; @property() public deviceId?: string; diff --git a/src/panels/config/devices/device-detail/ha-device-automation-dialog.ts b/src/panels/config/devices/device-detail/ha-device-automation-dialog.ts index 28a59b03c4..a7a9b2a661 100644 --- a/src/panels/config/devices/device-detail/ha-device-automation-dialog.ts +++ b/src/panels/config/devices/device-detail/ha-device-automation-dialog.ts @@ -4,6 +4,7 @@ import { html, LitElement, property, + internalProperty, TemplateResult, } from "lit-element"; import "../../../../components/ha-dialog"; @@ -24,15 +25,15 @@ import { DeviceAutomationDialogParams } from "./show-dialog-device-automation"; @customElement("dialog-device-automation") export class DialogDeviceAutomation extends LitElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; - @property() private _triggers: DeviceTrigger[] = []; + @internalProperty() private _triggers: DeviceTrigger[] = []; - @property() private _conditions: DeviceCondition[] = []; + @internalProperty() private _conditions: DeviceCondition[] = []; - @property() private _actions: DeviceAction[] = []; + @internalProperty() private _actions: DeviceAction[] = []; - @property() private _params?: DeviceAutomationDialogParams; + @internalProperty() private _params?: DeviceAutomationDialogParams; public async showDialog(params: DeviceAutomationDialogParams): Promise { this._params = params; diff --git a/src/panels/config/devices/device-detail/ha-device-entities-card.ts b/src/panels/config/devices/device-detail/ha-device-entities-card.ts index a586d15f5a..d37fd2eaf5 100644 --- a/src/panels/config/devices/device-detail/ha-device-entities-card.ts +++ b/src/panels/config/devices/device-detail/ha-device-entities-card.ts @@ -8,6 +8,7 @@ import { html, LitElement, property, + internalProperty, PropertyValues, TemplateResult, } from "lit-element"; @@ -26,11 +27,11 @@ import { HuiErrorCard } from "../../../lovelace/cards/hui-error-card"; @customElement("ha-device-entities-card") export class HaDeviceEntitiesCard extends LitElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; @property() public entities!: EntityRegistryStateEntry[]; - @property() private _showDisabled = false; + @internalProperty() private _showDisabled = false; private _entityRows: Array = []; diff --git a/src/panels/config/devices/device-detail/ha-device-info-card.ts b/src/panels/config/devices/device-detail/ha-device-info-card.ts index 8344df94fa..ae81de81c2 100644 --- a/src/panels/config/devices/device-detail/ha-device-info-card.ts +++ b/src/panels/config/devices/device-detail/ha-device-info-card.ts @@ -17,7 +17,7 @@ import { HomeAssistant } from "../../../../types"; @customElement("ha-device-info-card") export class HaDeviceCard extends LitElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; @property() public device!: DeviceRegistryEntry; diff --git a/src/panels/config/devices/device-detail/integration-elements/mqtt/dialog-mqtt-device-debug-info.ts b/src/panels/config/devices/device-detail/integration-elements/mqtt/dialog-mqtt-device-debug-info.ts index e60a237606..c7173c1a8b 100644 --- a/src/panels/config/devices/device-detail/integration-elements/mqtt/dialog-mqtt-device-debug-info.ts +++ b/src/panels/config/devices/device-detail/integration-elements/mqtt/dialog-mqtt-device-debug-info.ts @@ -5,7 +5,7 @@ import { customElement, html, LitElement, - property, + internalProperty, TemplateResult, } from "lit-element"; import { computeStateName } from "../../../../../../common/entity/compute_state_name"; @@ -29,13 +29,13 @@ import { computeRTLDirection } from "../../../../../../common/util/compute_rtl"; class DialogMQTTDeviceDebugInfo extends LitElement { public hass!: HomeAssistant; - @property() private _params?: MQTTDeviceDebugInfoDialogParams; + @internalProperty() private _params?: MQTTDeviceDebugInfoDialogParams; - @property() private _debugInfo?: MQTTDeviceDebugInfo; + @internalProperty() private _debugInfo?: MQTTDeviceDebugInfo; - @property() private _showAsYaml = true; + @internalProperty() private _showAsYaml = true; - @property() private _showDeserialized = true; + @internalProperty() private _showDeserialized = true; public async showDialog( params: MQTTDeviceDebugInfoDialogParams diff --git a/src/panels/config/devices/device-detail/integration-elements/mqtt/ha-device-actions-mqtt.ts b/src/panels/config/devices/device-detail/integration-elements/mqtt/ha-device-actions-mqtt.ts index fd81b7bbe0..fcdd9bce0c 100644 --- a/src/panels/config/devices/device-detail/integration-elements/mqtt/ha-device-actions-mqtt.ts +++ b/src/panels/config/devices/device-detail/integration-elements/mqtt/ha-device-actions-mqtt.ts @@ -16,7 +16,7 @@ import { HomeAssistant } from "../../../../../../types"; @customElement("ha-device-actions-mqtt") export class HaDeviceActionsMqtt extends LitElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; @property() public device!: DeviceRegistryEntry; diff --git a/src/panels/config/devices/device-detail/integration-elements/mqtt/mqtt-discovery-payload.ts b/src/panels/config/devices/device-detail/integration-elements/mqtt/mqtt-discovery-payload.ts index d132879149..67be52c126 100644 --- a/src/panels/config/devices/device-detail/integration-elements/mqtt/mqtt-discovery-payload.ts +++ b/src/panels/config/devices/device-detail/integration-elements/mqtt/mqtt-discovery-payload.ts @@ -6,6 +6,7 @@ import { html, LitElement, property, + internalProperty, TemplateResult, } from "lit-element"; import { classMap } from "lit-html/directives/class-map"; @@ -18,7 +19,7 @@ class MQTTDiscoveryPayload extends LitElement { @property() public summary!: string; - @property() private _open = false; + @internalProperty() private _open = false; protected render(): TemplateResult { return html` diff --git a/src/panels/config/devices/device-detail/integration-elements/mqtt/mqtt-messages.ts b/src/panels/config/devices/device-detail/integration-elements/mqtt/mqtt-messages.ts index 08952bfedc..1c6e65a8eb 100644 --- a/src/panels/config/devices/device-detail/integration-elements/mqtt/mqtt-messages.ts +++ b/src/panels/config/devices/device-detail/integration-elements/mqtt/mqtt-messages.ts @@ -6,6 +6,7 @@ import { html, LitElement, property, + internalProperty, TemplateResult, } from "lit-element"; import { classMap } from "lit-html/directives/class-map"; @@ -27,11 +28,11 @@ class MQTTMessages extends LitElement { @property() public summary!: string; - @property() private _open = false; + @internalProperty() private _open = false; - @property() private _payloadsJson = new WeakMap(); + @internalProperty() private _payloadsJson = new WeakMap(); - @property() private _showTopic = false; + @internalProperty() private _showTopic = false; protected firstUpdated(): void { this.messages.forEach((message) => { diff --git a/src/panels/config/devices/device-detail/integration-elements/zha/ha-device-actions-zha.ts b/src/panels/config/devices/device-detail/integration-elements/zha/ha-device-actions-zha.ts index 16d47f8b05..d5d98dc68d 100644 --- a/src/panels/config/devices/device-detail/integration-elements/zha/ha-device-actions-zha.ts +++ b/src/panels/config/devices/device-detail/integration-elements/zha/ha-device-actions-zha.ts @@ -4,6 +4,7 @@ import { html, LitElement, property, + internalProperty, TemplateResult, css, PropertyValues, @@ -23,11 +24,11 @@ import { showZHAClusterDialog } from "../../../../integrations/integration-panel @customElement("ha-device-actions-zha") export class HaDeviceActionsZha extends LitElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; @property() public device!: DeviceRegistryEntry; - @property() private _zhaDevice?: ZHADevice; + @internalProperty() private _zhaDevice?: ZHADevice; protected updated(changedProperties: PropertyValues) { if (changedProperties.has("device")) { 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 d84e3ecb0c..3005838eb4 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 @@ -4,6 +4,7 @@ import { html, LitElement, property, + internalProperty, TemplateResult, css, PropertyValues, @@ -16,11 +17,11 @@ import { formatAsPaddedHex } from "../../../../integrations/integration-panels/z @customElement("ha-device-info-zha") export class HaDeviceActionsZha extends LitElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; @property() public device!: DeviceRegistryEntry; - @property() private _zhaDevice?: ZHADevice; + @internalProperty() private _zhaDevice?: ZHADevice; protected updated(changedProperties: PropertyValues) { if (changedProperties.has("device")) { diff --git a/src/panels/config/devices/ha-config-device-page.ts b/src/panels/config/devices/ha-config-device-page.ts index 9987b894cc..fe49cf76fa 100644 --- a/src/panels/config/devices/ha-config-device-page.ts +++ b/src/panels/config/devices/ha-config-device-page.ts @@ -6,6 +6,7 @@ import { html, LitElement, property, + internalProperty, TemplateResult, } from "lit-element"; import { ifDefined } from "lit-html/directives/if-defined"; @@ -50,7 +51,7 @@ export interface EntityRegistryStateEntry extends EntityRegistryEntry { @customElement("ha-config-device-page") export class HaConfigDevicePage extends LitElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; @property() public devices!: DeviceRegistryEntry[]; @@ -70,7 +71,7 @@ export class HaConfigDevicePage extends LitElement { @property() public route!: Route; - @property() private _related?: RelatedResult; + @internalProperty() private _related?: RelatedResult; private _device = memoizeOne( ( diff --git a/src/panels/config/devices/ha-config-devices-dashboard.ts b/src/panels/config/devices/ha-config-devices-dashboard.ts index 673d0ff7f3..884c7c16dc 100644 --- a/src/panels/config/devices/ha-config-devices-dashboard.ts +++ b/src/panels/config/devices/ha-config-devices-dashboard.ts @@ -3,6 +3,7 @@ import { html, LitElement, property, + internalProperty, TemplateResult, } from "lit-element"; import memoizeOne from "memoize-one"; @@ -41,7 +42,7 @@ interface DeviceRowData extends DeviceRegistryEntry { @customElement("ha-config-devices-dashboard") export class HaConfigDeviceDashboard extends LitElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; @property() public narrow = false; @@ -57,7 +58,7 @@ export class HaConfigDeviceDashboard extends LitElement { @property() public route!: Route; - @property() private _searchParms = new URLSearchParams( + @internalProperty() private _searchParms = new URLSearchParams( window.location.search ); diff --git a/src/panels/config/devices/ha-config-devices.ts b/src/panels/config/devices/ha-config-devices.ts index 4b5aca4078..bfdcc55754 100644 --- a/src/panels/config/devices/ha-config-devices.ts +++ b/src/panels/config/devices/ha-config-devices.ts @@ -1,5 +1,10 @@ import { UnsubscribeFunc } from "home-assistant-js-websocket"; -import { customElement, property, PropertyValues } from "lit-element"; +import { + customElement, + property, + internalProperty, + PropertyValues, +} from "lit-element"; import { AreaRegistryEntry, subscribeAreaRegistry, @@ -23,7 +28,7 @@ import "./ha-config-devices-dashboard"; @customElement("ha-config-devices") class HaConfigDevices extends HassRouterPage { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; @property() public narrow!: boolean; @@ -44,13 +49,15 @@ class HaConfigDevices extends HassRouterPage { }, }; - @property() private _configEntries: ConfigEntry[] = []; + @internalProperty() private _configEntries: ConfigEntry[] = []; - @property() private _entityRegistryEntries: EntityRegistryEntry[] = []; + @internalProperty() + private _entityRegistryEntries: EntityRegistryEntry[] = []; - @property() private _deviceRegistryEntries: DeviceRegistryEntry[] = []; + @internalProperty() + private _deviceRegistryEntries: DeviceRegistryEntry[] = []; - @property() private _areas: AreaRegistryEntry[] = []; + @internalProperty() private _areas: AreaRegistryEntry[] = []; private _unsubs?: UnsubscribeFunc[]; diff --git a/src/panels/config/entities/dialog-entity-editor.ts b/src/panels/config/entities/dialog-entity-editor.ts index 4dbbb5b607..a05af41466 100644 --- a/src/panels/config/entities/dialog-entity-editor.ts +++ b/src/panels/config/entities/dialog-entity-editor.ts @@ -9,6 +9,7 @@ import { html, LitElement, property, + internalProperty, TemplateResult, } from "lit-element"; import { cache } from "lit-html/directives/cache"; @@ -42,20 +43,20 @@ interface Tab { @customElement("dialog-entity-editor") export class DialogEntityEditor extends LitElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; - @property() private _params?: EntityRegistryDetailDialogParams; + @internalProperty() private _params?: EntityRegistryDetailDialogParams; - @property() private _entry?: + @internalProperty() private _entry?: | EntityRegistryEntry | ExtEntityRegistryEntry | null; - @property() private _curTab = "tab-settings"; + @internalProperty() private _curTab = "tab-settings"; - @property() private _extraTabs: Tabs = {}; + @internalProperty() private _extraTabs: Tabs = {}; - @property() private _settingsElementTag?: string; + @internalProperty() private _settingsElementTag?: string; private _curTabIndex = 0; 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 dbf2a37a88..e0e8142ca8 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 @@ -5,6 +5,7 @@ import { html, LitElement, property, + internalProperty, PropertyValues, query, TemplateResult, @@ -82,17 +83,17 @@ const HELPERS = { @customElement("entity-settings-helper-tab") export class EntityRegistrySettingsHelper extends LitElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; @property() public entry!: ExtEntityRegistryEntry; - @property() private _error?: string; + @internalProperty() private _error?: string; - @property() private _item?: Helper | null; + @internalProperty() private _item?: Helper | null; - @property() private _submitting?: boolean; + @internalProperty() private _submitting?: boolean; - @property() private _componentLoaded?: boolean; + @internalProperty() private _componentLoaded?: boolean; @query("ha-registry-basic-editor") private _registryEditor?: HaEntityRegistryBasicEditor; diff --git a/src/panels/config/entities/entity-registry-basic-editor.ts b/src/panels/config/entities/entity-registry-basic-editor.ts index 071b8f7232..4b4ac7723d 100644 --- a/src/panels/config/entities/entity-registry-basic-editor.ts +++ b/src/panels/config/entities/entity-registry-basic-editor.ts @@ -5,6 +5,7 @@ import { html, LitElement, property, + internalProperty, PropertyValues, TemplateResult, } from "lit-element"; @@ -21,17 +22,17 @@ import type { HomeAssistant } from "../../../types"; @customElement("ha-registry-basic-editor") export class HaEntityRegistryBasicEditor extends LitElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; @property() public entry!: ExtEntityRegistryEntry; - @property() private _origEntityId!: string; + @internalProperty() private _origEntityId!: string; - @property() private _entityId!: string; + @internalProperty() private _entityId!: string; - @property() private _disabledBy!: string | null; + @internalProperty() private _disabledBy!: string | null; - @property() private _submitting?: boolean; + @internalProperty() private _submitting?: boolean; public async updateEntry(): Promise { this._submitting = true; diff --git a/src/panels/config/entities/entity-registry-settings.ts b/src/panels/config/entities/entity-registry-settings.ts index d5f971dc36..c26c8a631f 100644 --- a/src/panels/config/entities/entity-registry-settings.ts +++ b/src/panels/config/entities/entity-registry-settings.ts @@ -8,6 +8,7 @@ import { html, LitElement, property, + internalProperty, PropertyValues, TemplateResult, } from "lit-element"; @@ -29,21 +30,21 @@ import type { HomeAssistant } from "../../../types"; @customElement("entity-registry-settings") export class EntityRegistrySettings extends LitElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; @property() public entry!: ExtEntityRegistryEntry; - @property() private _name!: string; + @internalProperty() private _name!: string; - @property() private _icon!: string; + @internalProperty() private _icon!: string; - @property() private _entityId!: string; + @internalProperty() private _entityId!: string; - @property() private _disabledBy!: string | null; + @internalProperty() private _disabledBy!: string | null; - @property() private _error?: string; + @internalProperty() private _error?: string; - @property() private _submitting?: boolean; + @internalProperty() private _submitting?: boolean; private _origEntityId!: string; diff --git a/src/panels/config/entities/ha-config-entities.ts b/src/panels/config/entities/ha-config-entities.ts index 729e26cc2a..8d3279acb3 100644 --- a/src/panels/config/entities/ha-config-entities.ts +++ b/src/panels/config/entities/ha-config-entities.ts @@ -12,6 +12,7 @@ import { html, LitElement, property, + internalProperty, query, TemplateResult, } from "lit-element"; @@ -71,7 +72,7 @@ export interface EntityRow extends StateEntity { @customElement("ha-config-entities") export class HaConfigEntities extends SubscribeMixin(LitElement) { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; @property() public isWide!: boolean; @@ -79,25 +80,25 @@ export class HaConfigEntities extends SubscribeMixin(LitElement) { @property() public route!: Route; - @property() private _entities?: EntityRegistryEntry[]; + @internalProperty() private _entities?: EntityRegistryEntry[]; - @property() private _stateEntities: StateEntity[] = []; + @internalProperty() private _stateEntities: StateEntity[] = []; @property() public _entries?: ConfigEntry[]; - @property() private _showDisabled = false; + @internalProperty() private _showDisabled = false; - @property() private _showUnavailable = true; + @internalProperty() private _showUnavailable = true; - @property() private _showReadOnly = true; + @internalProperty() private _showReadOnly = true; - @property() private _filter = ""; + @internalProperty() private _filter = ""; - @property() private _searchParms = new URLSearchParams( + @internalProperty() private _searchParms = new URLSearchParams( window.location.search ); - @property() private _selectedEntities: string[] = []; + @internalProperty() private _selectedEntities: string[] = []; @query("hass-tabs-subpage-data-table") private _dataTable!: HaTabsSubpageDataTable; diff --git a/src/panels/config/ha-panel-config.ts b/src/panels/config/ha-panel-config.ts index c46dd0e967..649e6168ae 100644 --- a/src/panels/config/ha-panel-config.ts +++ b/src/panels/config/ha-panel-config.ts @@ -1,7 +1,12 @@ import "@polymer/paper-item/paper-item"; import "@polymer/paper-item/paper-item-body"; import { PolymerElement } from "@polymer/polymer"; -import { customElement, property, PropertyValues } from "lit-element"; +import { + customElement, + property, + internalProperty, + PropertyValues, +} from "lit-element"; import { isComponentLoaded } from "../../common/config/is_component_loaded"; import { listenMediaQuery } from "../../common/dom/media_query"; import { CloudStatus, fetchCloudStatus } from "../../data/cloud"; @@ -167,7 +172,7 @@ export const configSections: { [name: string]: PageNavigation[] } = { @customElement("ha-panel-config") class HaPanelConfig extends HassRouterPage { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; @property() public narrow!: boolean; @@ -333,11 +338,11 @@ class HaPanelConfig extends HassRouterPage { }, }; - @property() private _wideSidebar = false; + @internalProperty() private _wideSidebar = false; - @property() private _wide = false; + @internalProperty() private _wide = false; - @property() private _cloudStatus?: CloudStatus; + @internalProperty() private _cloudStatus?: CloudStatus; private _listeners: Array<() => void> = []; diff --git a/src/panels/config/helpers/dialog-helper-detail.ts b/src/panels/config/helpers/dialog-helper-detail.ts index b22ca67e77..b752a5037d 100644 --- a/src/panels/config/helpers/dialog-helper-detail.ts +++ b/src/panels/config/helpers/dialog-helper-detail.ts @@ -8,6 +8,7 @@ import { html, LitElement, property, + internalProperty, query, TemplateResult, } from "lit-element"; @@ -40,17 +41,17 @@ const HELPERS = { @customElement("dialog-helper-detail") export class DialogHelperDetail extends LitElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; - @property() private _item?: Helper; + @internalProperty() private _item?: Helper; - @property() private _opened = false; + @internalProperty() private _opened = false; - @property() private _platform?: string; + @internalProperty() private _platform?: string; - @property() private _error?: string; + @internalProperty() private _error?: string; - @property() private _submitting = false; + @internalProperty() private _submitting = false; @query(".form") private _form?: HTMLDivElement; diff --git a/src/panels/config/helpers/forms/ha-input_boolean-form.ts b/src/panels/config/helpers/forms/ha-input_boolean-form.ts index af22fc3b06..54b1fa2b3a 100644 --- a/src/panels/config/helpers/forms/ha-input_boolean-form.ts +++ b/src/panels/config/helpers/forms/ha-input_boolean-form.ts @@ -6,6 +6,7 @@ import { html, LitElement, property, + internalProperty, TemplateResult, } from "lit-element"; import { fireEvent } from "../../../../common/dom/fire_event"; @@ -16,15 +17,15 @@ import { HomeAssistant } from "../../../../types"; @customElement("ha-input_boolean-form") class HaInputBooleanForm extends LitElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; @property() public new?: boolean; private _item?: InputBoolean; - @property() private _name!: string; + @internalProperty() private _name!: string; - @property() private _icon!: string; + @internalProperty() private _icon!: string; set item(item: InputBoolean) { this._item = item; diff --git a/src/panels/config/helpers/forms/ha-input_datetime-form.ts b/src/panels/config/helpers/forms/ha-input_datetime-form.ts index 081f550618..07dfb95eb9 100644 --- a/src/panels/config/helpers/forms/ha-input_datetime-form.ts +++ b/src/panels/config/helpers/forms/ha-input_datetime-form.ts @@ -8,6 +8,7 @@ import { html, LitElement, property, + internalProperty, TemplateResult, } from "lit-element"; import { fireEvent } from "../../../../common/dom/fire_event"; @@ -18,17 +19,17 @@ import { HomeAssistant } from "../../../../types"; @customElement("ha-input_datetime-form") class HaInputDateTimeForm extends LitElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; @property() public new?: boolean; private _item?: InputDateTime; - @property() private _name!: string; + @internalProperty() private _name!: string; - @property() private _icon!: string; + @internalProperty() private _icon!: string; - @property() private _mode!: "date" | "time" | "datetime"; + @internalProperty() private _mode!: "date" | "time" | "datetime"; set item(item: InputDateTime) { this._item = item; diff --git a/src/panels/config/helpers/forms/ha-input_number-form.ts b/src/panels/config/helpers/forms/ha-input_number-form.ts index a6b383348b..ddc675821f 100644 --- a/src/panels/config/helpers/forms/ha-input_number-form.ts +++ b/src/panels/config/helpers/forms/ha-input_number-form.ts @@ -8,6 +8,7 @@ import { html, LitElement, property, + internalProperty, TemplateResult, } from "lit-element"; import { fireEvent } from "../../../../common/dom/fire_event"; @@ -18,26 +19,26 @@ import { HomeAssistant } from "../../../../types"; @customElement("ha-input_number-form") class HaInputNumberForm extends LitElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; @property() public new?: boolean; private _item?: Partial; - @property() private _name!: string; + @internalProperty() private _name!: string; - @property() private _icon!: string; + @internalProperty() private _icon!: string; - @property() private _max?: number; + @internalProperty() private _max?: number; - @property() private _min?: number; + @internalProperty() private _min?: number; - @property() private _mode?: string; + @internalProperty() private _mode?: string; - @property() private _step?: number; + @internalProperty() private _step?: number; // eslint-disable-next-line: variable-name - @property() private _unit_of_measurement?: string; + @internalProperty() private _unit_of_measurement?: string; set item(item: InputNumber) { this._item = item; diff --git a/src/panels/config/helpers/forms/ha-input_select-form.ts b/src/panels/config/helpers/forms/ha-input_select-form.ts index e73eddee5b..eef74de859 100644 --- a/src/panels/config/helpers/forms/ha-input_select-form.ts +++ b/src/panels/config/helpers/forms/ha-input_select-form.ts @@ -11,6 +11,7 @@ import { html, LitElement, property, + internalProperty, query, TemplateResult, } from "lit-element"; @@ -23,17 +24,17 @@ import type { HomeAssistant } from "../../../../types"; @customElement("ha-input_select-form") class HaInputSelectForm extends LitElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; @property() public new?: boolean; private _item?: InputSelect; - @property() private _name!: string; + @internalProperty() private _name!: string; - @property() private _icon!: string; + @internalProperty() private _icon!: string; - @property() private _options: string[] = []; + @internalProperty() private _options: string[] = []; @query("#option_input") private _optionInput?: PaperInputElement; diff --git a/src/panels/config/helpers/forms/ha-input_text-form.ts b/src/panels/config/helpers/forms/ha-input_text-form.ts index 5e2a2c0407..98db37b536 100644 --- a/src/panels/config/helpers/forms/ha-input_text-form.ts +++ b/src/panels/config/helpers/forms/ha-input_text-form.ts @@ -8,6 +8,7 @@ import { html, LitElement, property, + internalProperty, TemplateResult, } from "lit-element"; import { fireEvent } from "../../../../common/dom/fire_event"; @@ -18,23 +19,23 @@ import { HomeAssistant } from "../../../../types"; @customElement("ha-input_text-form") class HaInputTextForm extends LitElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; @property() public new?: boolean; private _item?: InputText; - @property() private _name!: string; + @internalProperty() private _name!: string; - @property() private _icon!: string; + @internalProperty() private _icon!: string; - @property() private _max?: number; + @internalProperty() private _max?: number; - @property() private _min?: number; + @internalProperty() private _min?: number; - @property() private _mode?: string; + @internalProperty() private _mode?: string; - @property() private _pattern?: string; + @internalProperty() private _pattern?: string; set item(item: InputText) { this._item = item; diff --git a/src/panels/config/helpers/ha-config-helpers.ts b/src/panels/config/helpers/ha-config-helpers.ts index 113f7d0655..5297eca681 100644 --- a/src/panels/config/helpers/ha-config-helpers.ts +++ b/src/panels/config/helpers/ha-config-helpers.ts @@ -11,6 +11,7 @@ import { html, LitElement, property, + internalProperty, PropertyValues, TemplateResult, } from "lit-element"; @@ -37,7 +38,7 @@ import { computeRTL } from "../../../common/util/compute_rtl"; @customElement("ha-config-helpers") export class HaConfigHelpers extends LitElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; @property() public isWide!: boolean; @@ -45,7 +46,7 @@ export class HaConfigHelpers extends LitElement { @property() public route!: Route; - @property() private _stateItems: HassEntity[] = []; + @internalProperty() private _stateItems: HassEntity[] = []; private _columns = memoize( (narrow, _language): DataTableColumnContainer => { diff --git a/src/panels/config/info/ha-config-info.ts b/src/panels/config/info/ha-config-info.ts index f1fd86998b..178b8ca0ae 100644 --- a/src/panels/config/info/ha-config-info.ts +++ b/src/panels/config/info/ha-config-info.ts @@ -17,7 +17,7 @@ const JS_TYPE = __BUILD__; const JS_VERSION = __VERSION__; class HaConfigInfo extends LitElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; @property() public narrow!: boolean; diff --git a/src/panels/config/info/integrations-card.ts b/src/panels/config/info/integrations-card.ts index 01390123b5..dd9da6d403 100644 --- a/src/panels/config/info/integrations-card.ts +++ b/src/panels/config/info/integrations-card.ts @@ -5,6 +5,7 @@ import { html, LitElement, property, + internalProperty, TemplateResult, } from "lit-element"; import memoizeOne from "memoize-one"; @@ -19,9 +20,11 @@ import { HomeAssistant } from "../../../types"; @customElement("integrations-card") class IntegrationsCard extends LitElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; - @property() private _manifests?: { [domain: string]: IntegrationManifest }; + @internalProperty() private _manifests?: { + [domain: string]: IntegrationManifest; + }; private _sortedIntegrations = memoizeOne((components: string[]) => { return components.filter((comp) => !comp.includes(".")).sort(); diff --git a/src/panels/config/info/system-health-card.ts b/src/panels/config/info/system-health-card.ts index 4056d28b5c..eafbf533db 100644 --- a/src/panels/config/info/system-health-card.ts +++ b/src/panels/config/info/system-health-card.ts @@ -5,6 +5,7 @@ import { html, LitElement, property, + internalProperty, TemplateResult, } from "lit-element"; import "../../../components/ha-card"; @@ -32,9 +33,9 @@ const sortKeys = (a: string, b: string) => { }; class SystemHealthCard extends LitElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; - @property() private _info?: SystemHealthInfo; + @internalProperty() private _info?: SystemHealthInfo; protected render(): TemplateResult { if (!this.hass) { diff --git a/src/panels/config/integrations/ha-config-integrations.ts b/src/panels/config/integrations/ha-config-integrations.ts index 1db180f47f..33312fa4ed 100644 --- a/src/panels/config/integrations/ha-config-integrations.ts +++ b/src/panels/config/integrations/ha-config-integrations.ts @@ -12,6 +12,7 @@ import { html, LitElement, property, + internalProperty, PropertyValues, TemplateResult, } from "lit-element"; @@ -91,7 +92,7 @@ const groupByIntegration = ( @customElement("ha-config-integrations") class HaConfigIntegrations extends SubscribeMixin(LitElement) { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; @property() public narrow!: boolean; @@ -101,24 +102,28 @@ class HaConfigIntegrations extends SubscribeMixin(LitElement) { @property() public route!: Route; - @property() private _configEntries?: ConfigEntryExtended[]; + @internalProperty() private _configEntries?: ConfigEntryExtended[]; @property() private _configEntriesInProgress: DataEntryFlowProgressExtended[] = []; - @property() private _entityRegistryEntries: EntityRegistryEntry[] = []; + @internalProperty() + private _entityRegistryEntries: EntityRegistryEntry[] = []; - @property() private _deviceRegistryEntries: DeviceRegistryEntry[] = []; + @internalProperty() + private _deviceRegistryEntries: DeviceRegistryEntry[] = []; - @property() private _manifests!: { [domain: string]: IntegrationManifest }; + @internalProperty() private _manifests!: { + [domain: string]: IntegrationManifest; + }; - @property() private _showIgnored = false; + @internalProperty() private _showIgnored = false; - @property() private _searchParms = new URLSearchParams( + @internalProperty() private _searchParms = new URLSearchParams( window.location.hash.substring(1) ); - @property() private _filter?: string; + @internalProperty() private _filter?: string; public hassSubscribe(): UnsubscribeFunc[] { return [ diff --git a/src/panels/config/integrations/ha-integration-card.ts b/src/panels/config/integrations/ha-integration-card.ts index 6beaa4c092..6be9ac8524 100644 --- a/src/panels/config/integrations/ha-integration-card.ts +++ b/src/panels/config/integrations/ha-integration-card.ts @@ -62,7 +62,7 @@ const integrationsWithPanel = { @customElement("ha-integration-card") export class HaIntegrationCard extends LitElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; @property() public domain!: string; 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 17aef88705..e2c166f571 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 @@ -7,6 +7,7 @@ import { html, LitElement, property, + internalProperty, TemplateResult, } from "lit-element"; import "../../../../../components/ha-card"; @@ -20,11 +21,11 @@ import { getConfigEntries } from "../../../../../data/config_entries"; @customElement("mqtt-config-panel") class HaPanelDevMqtt extends LitElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; - @property() private topic = ""; + @internalProperty() private topic = ""; - @property() private payload = ""; + @internalProperty() private payload = ""; private inited = false; diff --git a/src/panels/config/integrations/integration-panels/mqtt/mqtt-subscribe-card.ts b/src/panels/config/integrations/integration-panels/mqtt/mqtt-subscribe-card.ts index 98652360fd..b74a5a76fb 100644 --- a/src/panels/config/integrations/integration-panels/mqtt/mqtt-subscribe-card.ts +++ b/src/panels/config/integrations/integration-panels/mqtt/mqtt-subscribe-card.ts @@ -7,6 +7,7 @@ import { html, LitElement, property, + internalProperty, TemplateResult, } from "lit-element"; import { formatTime } from "../../../../../common/datetime/format_time"; @@ -16,13 +17,13 @@ import { HomeAssistant } from "../../../../../types"; @customElement("mqtt-subscribe-card") class MqttSubscribeCard extends LitElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; - @property() private _topic = ""; + @internalProperty() private _topic = ""; - @property() private _subscribed?: () => void; + @internalProperty() private _subscribed?: () => void; - @property() private _messages: Array<{ + @internalProperty() private _messages: Array<{ id: number; message: MQTTMessage; payload: string; diff --git a/src/panels/config/integrations/integration-panels/zha/dialog-zha-cluster.ts b/src/panels/config/integrations/integration-panels/zha/dialog-zha-cluster.ts index 52898f33f7..9b1b093ff6 100644 --- a/src/panels/config/integrations/integration-panels/zha/dialog-zha-cluster.ts +++ b/src/panels/config/integrations/integration-panels/zha/dialog-zha-cluster.ts @@ -4,6 +4,7 @@ import { html, LitElement, property, + internalProperty, TemplateResult, PropertyValues, } from "lit-element"; @@ -30,15 +31,15 @@ import { sortZHADevices, sortZHAGroups } from "./functions"; @customElement("dialog-zha-cluster") class DialogZHACluster extends LitElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; - @property() private _device?: ZHADevice; + @internalProperty() private _device?: ZHADevice; - @property() private _selectedCluster?: Cluster; + @internalProperty() private _selectedCluster?: Cluster; - @property() private _bindableDevices: ZHADevice[] = []; + @internalProperty() private _bindableDevices: ZHADevice[] = []; - @property() private _groups: ZHAGroup[] = []; + @internalProperty() private _groups: ZHAGroup[] = []; public async showDialog( params: ZHADeviceZigbeeInfoDialogParams diff --git a/src/panels/config/integrations/integration-panels/zha/dialog-zha-device-zigbee-info.ts b/src/panels/config/integrations/integration-panels/zha/dialog-zha-device-zigbee-info.ts index f1a921ddd5..c3af80c7fc 100644 --- a/src/panels/config/integrations/integration-panels/zha/dialog-zha-device-zigbee-info.ts +++ b/src/panels/config/integrations/integration-panels/zha/dialog-zha-device-zigbee-info.ts @@ -4,6 +4,7 @@ import { html, LitElement, property, + internalProperty, TemplateResult, } from "lit-element"; import "../../../../../components/ha-code-editor"; @@ -14,9 +15,9 @@ import { ZHADeviceZigbeeInfoDialogParams } from "./show-dialog-zha-device-zigbee @customElement("dialog-zha-device-zigbee-info") class DialogZHADeviceZigbeeInfo extends LitElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; - @property() private _signature: any; + @internalProperty() private _signature: any; public async showDialog( params: ZHADeviceZigbeeInfoDialogParams diff --git a/src/panels/config/integrations/integration-panels/zha/zha-add-devices-page.ts b/src/panels/config/integrations/integration-panels/zha/zha-add-devices-page.ts index 1575571789..6c2fdcc897 100644 --- a/src/panels/config/integrations/integration-panels/zha/zha-add-devices-page.ts +++ b/src/panels/config/integrations/integration-panels/zha/zha-add-devices-page.ts @@ -8,6 +8,7 @@ import { html, LitElement, property, + internalProperty, TemplateResult, PropertyValues, } from "lit-element"; @@ -23,7 +24,7 @@ import { IronAutogrowTextareaElement } from "@polymer/iron-autogrow-textarea"; @customElement("zha-add-devices-page") class ZHAAddDevicesPage extends LitElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; @property() public narrow?: boolean; @@ -31,17 +32,17 @@ class ZHAAddDevicesPage extends LitElement { @property() public route?: Route; - @property() private _error?: string; + @internalProperty() private _error?: string; - @property() private _discoveredDevices: ZHADevice[] = []; + @internalProperty() private _discoveredDevices: ZHADevice[] = []; - @property() private _formattedEvents = ""; + @internalProperty() private _formattedEvents = ""; - @property() private _active = false; + @internalProperty() private _active = false; - @property() private _showHelp = false; + @internalProperty() private _showHelp = false; - @property() private _showLogs = false; + @internalProperty() private _showLogs = false; private _ieeeAddress?: string; 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 ba1f18e753..a7929f0bda 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 @@ -9,6 +9,7 @@ import { html, LitElement, property, + internalProperty, PropertyValues, query, } from "lit-element"; @@ -37,9 +38,9 @@ export class ZHAAddGroupPage extends LitElement { @property({ type: Array }) public deviceEndpoints: ZHADeviceEndpoint[] = []; - @property() private _processingAdd = false; + @internalProperty() private _processingAdd = false; - @property() private _groupName = ""; + @internalProperty() private _groupName = ""; @query("zha-device-endpoint-data-table") private _zhaDevicesDataTable!: ZHADeviceEndpointDataTable; diff --git a/src/panels/config/integrations/integration-panels/zha/zha-cluster-attributes.ts b/src/panels/config/integrations/integration-panels/zha/zha-cluster-attributes.ts index a21a58505a..b2bb1c76b5 100644 --- a/src/panels/config/integrations/integration-panels/zha/zha-cluster-attributes.ts +++ b/src/panels/config/integrations/integration-panels/zha/zha-cluster-attributes.ts @@ -10,6 +10,7 @@ import { html, LitElement, property, + internalProperty, PropertyValues, TemplateResult, } from "lit-element"; @@ -35,7 +36,7 @@ import { } from "./types"; export class ZHAClusterAttributes extends LitElement { - @property() public hass?: HomeAssistant; + @property({ attribute: false }) public hass?: HomeAssistant; @property() public isWide?: boolean; @@ -45,15 +46,16 @@ export class ZHAClusterAttributes extends LitElement { @property() public selectedCluster?: Cluster; - @property() private _attributes: Attribute[] = []; + @internalProperty() private _attributes: Attribute[] = []; - @property() private _selectedAttributeIndex = -1; + @internalProperty() private _selectedAttributeIndex = -1; - @property() private _attributeValue?: any = ""; + @internalProperty() private _attributeValue?: any = ""; - @property() private _manufacturerCodeOverride?: string | number; + @internalProperty() private _manufacturerCodeOverride?: string | number; - @property() private _setAttributeServiceData?: SetAttributeServiceData; + @internalProperty() + private _setAttributeServiceData?: SetAttributeServiceData; protected updated(changedProperties: PropertyValues): void { if (changedProperties.has("selectedCluster")) { diff --git a/src/panels/config/integrations/integration-panels/zha/zha-cluster-commands.ts b/src/panels/config/integrations/integration-panels/zha/zha-cluster-commands.ts index 623c3cdd82..39fc7727e2 100644 --- a/src/panels/config/integrations/integration-panels/zha/zha-cluster-commands.ts +++ b/src/panels/config/integrations/integration-panels/zha/zha-cluster-commands.ts @@ -9,6 +9,7 @@ import { html, LitElement, property, + internalProperty, PropertyValues, TemplateResult, } from "lit-element"; @@ -32,7 +33,7 @@ import { } from "./types"; export class ZHAClusterCommands extends LitElement { - @property() public hass?: HomeAssistant; + @property({ attribute: false }) public hass?: HomeAssistant; @property() public isWide?: boolean; @@ -40,15 +41,16 @@ export class ZHAClusterCommands extends LitElement { @property() public selectedCluster?: Cluster; - @property() private _showHelp = false; + @internalProperty() private _showHelp = false; - @property() private _commands: Command[] = []; + @internalProperty() private _commands: Command[] = []; - @property() private _selectedCommandIndex = -1; + @internalProperty() private _selectedCommandIndex = -1; - @property() private _manufacturerCodeOverride?: number; + @internalProperty() private _manufacturerCodeOverride?: number; - @property() private _issueClusterCommandServiceData?: IssueCommandServiceData; + @internalProperty() + private _issueClusterCommandServiceData?: IssueCommandServiceData; protected updated(changedProperties: PropertyValues): void { if (changedProperties.has("selectedCluster")) { diff --git a/src/panels/config/integrations/integration-panels/zha/zha-clusters-data-table.ts b/src/panels/config/integrations/integration-panels/zha/zha-clusters-data-table.ts index ad615721b1..3354b0f80f 100644 --- a/src/panels/config/integrations/integration-panels/zha/zha-clusters-data-table.ts +++ b/src/panels/config/integrations/integration-panels/zha/zha-clusters-data-table.ts @@ -25,7 +25,7 @@ export interface ClusterRowData extends Cluster { @customElement("zha-clusters-data-table") export class ZHAClustersDataTable extends LitElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; @property() public narrow = false; diff --git a/src/panels/config/integrations/integration-panels/zha/zha-clusters.ts b/src/panels/config/integrations/integration-panels/zha/zha-clusters.ts index 80789264ea..1f8db25cd0 100644 --- a/src/panels/config/integrations/integration-panels/zha/zha-clusters.ts +++ b/src/panels/config/integrations/integration-panels/zha/zha-clusters.ts @@ -8,6 +8,7 @@ import { html, LitElement, property, + internalProperty, PropertyValues, TemplateResult, } from "lit-element"; @@ -36,7 +37,7 @@ declare global { } export class ZHAClusters extends LitElement { - @property() public hass?: HomeAssistant; + @property({ attribute: false }) public hass?: HomeAssistant; @property() public isWide?: boolean; @@ -44,9 +45,9 @@ export class ZHAClusters extends LitElement { @property() public showHelp = false; - @property() private _selectedClusterIndex = -1; + @internalProperty() private _selectedClusterIndex = -1; - @property() private _clusters: Cluster[] = []; + @internalProperty() private _clusters: Cluster[] = []; protected updated(changedProperties: PropertyValues): void { if (changedProperties.has("selectedDevice")) { diff --git a/src/panels/config/integrations/integration-panels/zha/zha-config-dashboard-router.ts b/src/panels/config/integrations/integration-panels/zha/zha-config-dashboard-router.ts index b6e72c457f..1d87e2e481 100644 --- a/src/panels/config/integrations/integration-panels/zha/zha-config-dashboard-router.ts +++ b/src/panels/config/integrations/integration-panels/zha/zha-config-dashboard-router.ts @@ -8,7 +8,7 @@ import { navigate } from "../../../../../common/navigate"; @customElement("zha-config-dashboard-router") class ZHAConfigDashboardRouter extends HassRouterPage { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; @property() public isWide!: boolean; diff --git a/src/panels/config/integrations/integration-panels/zha/zha-device-binding.ts b/src/panels/config/integrations/integration-panels/zha/zha-device-binding.ts index fbec56baf5..ee3435feca 100644 --- a/src/panels/config/integrations/integration-panels/zha/zha-device-binding.ts +++ b/src/panels/config/integrations/integration-panels/zha/zha-device-binding.ts @@ -10,6 +10,7 @@ import { html, LitElement, property, + internalProperty, PropertyValues, TemplateResult, } from "lit-element"; @@ -24,19 +25,19 @@ import { ItemSelectedEvent } from "./types"; @customElement("zha-device-binding-control") export class ZHADeviceBindingControl extends LitElement { - @property() public hass?: HomeAssistant; + @property({ attribute: false }) public hass?: HomeAssistant; @property() public isWide?: boolean; @property() public selectedDevice?: ZHADevice; - @property() private _showHelp = false; + @internalProperty() private _showHelp = false; - @property() private _bindTargetIndex = -1; + @internalProperty() private _bindTargetIndex = -1; - @property() private bindableDevices: ZHADevice[] = []; + @internalProperty() private bindableDevices: ZHADevice[] = []; - @property() private _deviceToBind?: ZHADevice; + @internalProperty() private _deviceToBind?: ZHADevice; protected updated(changedProperties: PropertyValues): void { if (changedProperties.has("selectedDevice")) { diff --git a/src/panels/config/integrations/integration-panels/zha/zha-device-card.ts b/src/panels/config/integrations/integration-panels/zha/zha-device-card.ts index 0da4c4e0bf..148544ad03 100644 --- a/src/panels/config/integrations/integration-panels/zha/zha-device-card.ts +++ b/src/panels/config/integrations/integration-panels/zha/zha-device-card.ts @@ -8,6 +8,7 @@ import { html, LitElement, property, + internalProperty, TemplateResult, } from "lit-element"; import { fireEvent } from "../../../../../common/dom/fire_event"; @@ -36,13 +37,13 @@ import { getIeeeTail } from "./functions"; @customElement("zha-device-card") class ZHADeviceCard extends SubscribeMixin(LitElement) { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; @property() public device?: ZHADevice; @property({ type: Boolean }) public narrow?: boolean; - @property() private _entities: EntityRegistryEntry[] = []; + @internalProperty() private _entities: EntityRegistryEntry[] = []; private _deviceEntities = memoizeOne( ( diff --git a/src/panels/config/integrations/integration-panels/zha/zha-group-binding.ts b/src/panels/config/integrations/integration-panels/zha/zha-group-binding.ts index d880d0c22f..bbf2306703 100644 --- a/src/panels/config/integrations/integration-panels/zha/zha-group-binding.ts +++ b/src/panels/config/integrations/integration-panels/zha/zha-group-binding.ts @@ -10,6 +10,7 @@ import { html, LitElement, property, + internalProperty, PropertyValues, query, TemplateResult, @@ -36,7 +37,7 @@ import type { ZHAClustersDataTable } from "./zha-clusters-data-table"; @customElement("zha-group-binding-control") export class ZHAGroupBindingControl extends LitElement { - @property() public hass?: HomeAssistant; + @property({ attribute: false }) public hass?: HomeAssistant; @property() public isWide?: boolean; @@ -44,15 +45,15 @@ export class ZHAGroupBindingControl extends LitElement { @property() public selectedDevice?: ZHADevice; - @property() private _showHelp = false; + @internalProperty() private _showHelp = false; - @property() private _bindTargetIndex = -1; + @internalProperty() private _bindTargetIndex = -1; - @property() private groups: ZHAGroup[] = []; + @internalProperty() private groups: ZHAGroup[] = []; - @property() private _selectedClusters: string[] = []; + @internalProperty() private _selectedClusters: string[] = []; - @property() private _clusters: Cluster[] = []; + @internalProperty() private _clusters: Cluster[] = []; private _groupToBind?: ZHAGroup; 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 30d8d09eae..c4a928b669 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 @@ -8,6 +8,7 @@ import { html, LitElement, property, + internalProperty, PropertyValues, query, } from "lit-element"; @@ -45,15 +46,16 @@ export class ZHAGroupPage extends LitElement { @property({ type: Array }) public deviceEndpoints: ZHADeviceEndpoint[] = []; - @property() private _processingAdd = false; + @internalProperty() private _processingAdd = false; - @property() private _processingRemove = false; + @internalProperty() private _processingRemove = false; - @property() private _filteredDeviceEndpoints: ZHADeviceEndpoint[] = []; + @internalProperty() + private _filteredDeviceEndpoints: ZHADeviceEndpoint[] = []; - @property() private _selectedDevicesToAdd: string[] = []; + @internalProperty() private _selectedDevicesToAdd: string[] = []; - @property() private _selectedDevicesToRemove: string[] = []; + @internalProperty() private _selectedDevicesToRemove: string[] = []; @query("#addMembers") private _zhaAddMembersDataTable!: ZHADeviceEndpointDataTable; diff --git a/src/panels/config/integrations/integration-panels/zha/zha-groups-dashboard.ts b/src/panels/config/integrations/integration-panels/zha/zha-groups-dashboard.ts index a344750e00..b96eda6de8 100644 --- a/src/panels/config/integrations/integration-panels/zha/zha-groups-dashboard.ts +++ b/src/panels/config/integrations/integration-panels/zha/zha-groups-dashboard.ts @@ -34,7 +34,7 @@ export interface GroupRowData extends ZHAGroup { @customElement("zha-groups-dashboard") export class ZHAGroupsDashboard extends LitElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; @property({ type: Object }) public route!: Route; diff --git a/src/panels/config/integrations/integration-panels/zwave/zwave-network.ts b/src/panels/config/integrations/integration-panels/zwave/zwave-network.ts index 0f8d7dd256..7d220ba93c 100644 --- a/src/panels/config/integrations/integration-panels/zwave/zwave-network.ts +++ b/src/panels/config/integrations/integration-panels/zwave/zwave-network.ts @@ -8,6 +8,7 @@ import { html, LitElement, property, + internalProperty, TemplateResult, } from "lit-element"; import "../../../../../components/buttons/ha-call-api-button"; @@ -29,15 +30,15 @@ import "../../../ha-config-section"; @customElement("zwave-network") export class ZwaveNetwork extends LitElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; @property() public isWide!: boolean; - @property() private _showHelp = false; + @internalProperty() private _showHelp = false; - @property() private _networkStatus?: ZWaveNetworkStatus; + @internalProperty() private _networkStatus?: ZWaveNetworkStatus; - @property() private _unsubs: Array> = []; + @internalProperty() private _unsubs: Array> = []; public disconnectedCallback(): void { this._unsubscribe(); diff --git a/src/panels/config/integrations/integration-panels/zwave/zwave-node-config.ts b/src/panels/config/integrations/integration-panels/zwave/zwave-node-config.ts index 831ee5a86b..a6326633c8 100644 --- a/src/panels/config/integrations/integration-panels/zwave/zwave-node-config.ts +++ b/src/panels/config/integrations/integration-panels/zwave/zwave-node-config.ts @@ -9,6 +9,7 @@ import { html, LitElement, property, + internalProperty, PropertyValues, TemplateResult, } from "lit-element"; @@ -25,7 +26,7 @@ import { HomeAssistant } from "../../../../../types"; @customElement("zwave-node-config") export class ZwaveNodeConfig extends LitElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; @property() public nodes: ZWaveNode[] = []; @@ -33,13 +34,13 @@ export class ZwaveNodeConfig extends LitElement { @property() public selectedNode = -1; - @property() private _configItem?: ZWaveConfigItem; + @internalProperty() private _configItem?: ZWaveConfigItem; - @property() private _wakeupInput = -1; + @internalProperty() private _wakeupInput = -1; - @property() private _selectedConfigParameter = -1; + @internalProperty() private _selectedConfigParameter = -1; - @property() private _selectedConfigValue: number | string = -1; + @internalProperty() private _selectedConfigValue: number | string = -1; protected render(): TemplateResult { return html` diff --git a/src/panels/config/integrations/integration-panels/zwave/zwave-values.ts b/src/panels/config/integrations/integration-panels/zwave/zwave-values.ts index 5e60dd8c2b..7966f0cdeb 100644 --- a/src/panels/config/integrations/integration-panels/zwave/zwave-values.ts +++ b/src/panels/config/integrations/integration-panels/zwave/zwave-values.ts @@ -8,6 +8,7 @@ import { html, LitElement, property, + internalProperty, TemplateResult, } from "lit-element"; import "../../../../../components/buttons/ha-call-service-button"; @@ -18,11 +19,11 @@ import { HomeAssistant } from "../../../../../types"; @customElement("zwave-values") export class ZwaveValues extends LitElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; @property() public values: ZWaveValue[] = []; - @property() private _selectedValue = -1; + @internalProperty() private _selectedValue = -1; protected render(): TemplateResult { return html` diff --git a/src/panels/config/logs/dialog-system-log-detail.ts b/src/panels/config/logs/dialog-system-log-detail.ts index 01c6ee0355..ad5f28c648 100644 --- a/src/panels/config/logs/dialog-system-log-detail.ts +++ b/src/panels/config/logs/dialog-system-log-detail.ts @@ -5,6 +5,7 @@ import { html, LitElement, property, + internalProperty, TemplateResult, } from "lit-element"; import "../../../components/dialog/ha-paper-dialog"; @@ -23,11 +24,11 @@ import { formatSystemLogTime } from "./util"; import { fireEvent } from "../../../common/dom/fire_event"; class DialogSystemLogDetail extends LitElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; - @property() private _params?: SystemLogDetailDialogParams; + @internalProperty() private _params?: SystemLogDetailDialogParams; - @property() private _manifest?: IntegrationManifest; + @internalProperty() private _manifest?: IntegrationManifest; public async showDialog(params: SystemLogDetailDialogParams): Promise { this._params = params; diff --git a/src/panels/config/logs/error-log-card.ts b/src/panels/config/logs/error-log-card.ts index 916eb2e436..88dac9b2de 100644 --- a/src/panels/config/logs/error-log-card.ts +++ b/src/panels/config/logs/error-log-card.ts @@ -6,15 +6,16 @@ import { html, LitElement, property, + internalProperty, TemplateResult, } from "lit-element"; import { fetchErrorLog } from "../../../data/error_log"; import { HomeAssistant } from "../../../types"; class ErrorLogCard extends LitElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; - @property() private _errorLog?: string; + @internalProperty() private _errorLog?: string; protected render(): TemplateResult { return html` diff --git a/src/panels/config/logs/ha-config-logs.ts b/src/panels/config/logs/ha-config-logs.ts index f1a1bf764a..84247d748c 100644 --- a/src/panels/config/logs/ha-config-logs.ts +++ b/src/panels/config/logs/ha-config-logs.ts @@ -18,7 +18,7 @@ import "../../../layouts/hass-tabs-subpage"; @customElement("ha-config-logs") export class HaConfigLogs extends LitElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; @property() public narrow!: boolean; diff --git a/src/panels/config/logs/system-log-card.ts b/src/panels/config/logs/system-log-card.ts index 9767f8f32f..bd80bbe5bf 100644 --- a/src/panels/config/logs/system-log-card.ts +++ b/src/panels/config/logs/system-log-card.ts @@ -9,6 +9,7 @@ import { html, LitElement, property, + internalProperty, TemplateResult, } from "lit-element"; import "../../../components/buttons/ha-call-service-button"; @@ -26,11 +27,11 @@ import { formatSystemLogTime } from "./util"; @customElement("system-log-card") export class SystemLogCard extends LitElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; public loaded = false; - @property() private _items?: LoggedError[]; + @internalProperty() private _items?: LoggedError[]; public async fetchData(): Promise { this._items = undefined; diff --git a/src/panels/config/lovelace/dashboards/dialog-lovelace-dashboard-detail.ts b/src/panels/config/lovelace/dashboards/dialog-lovelace-dashboard-detail.ts index c7245e99fc..f74377609e 100644 --- a/src/panels/config/lovelace/dashboards/dialog-lovelace-dashboard-detail.ts +++ b/src/panels/config/lovelace/dashboards/dialog-lovelace-dashboard-detail.ts @@ -6,6 +6,7 @@ import { html, LitElement, property, + internalProperty, TemplateResult, } from "lit-element"; import { createCloseHeading } from "../../../../components/ha-dialog"; @@ -28,23 +29,24 @@ import { computeRTLDirection } from "../../../../common/util/compute_rtl"; @customElement("dialog-lovelace-dashboard-detail") export class DialogLovelaceDashboardDetail extends LitElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; - @property() private _params?: LovelaceDashboardDetailsDialogParams; + @internalProperty() private _params?: LovelaceDashboardDetailsDialogParams; - @property() private _urlPath!: LovelaceDashboard["url_path"]; + @internalProperty() private _urlPath!: LovelaceDashboard["url_path"]; - @property() private _showInSidebar!: boolean; + @internalProperty() private _showInSidebar!: boolean; - @property() private _icon!: string; + @internalProperty() private _icon!: string; - @property() private _title!: string; + @internalProperty() private _title!: string; - @property() private _requireAdmin!: LovelaceDashboard["require_admin"]; + @internalProperty() + private _requireAdmin!: LovelaceDashboard["require_admin"]; - @property() private _error?: string; + @internalProperty() private _error?: string; - @property() private _submitting = false; + @internalProperty() private _submitting = false; public async showDialog( params: LovelaceDashboardDetailsDialogParams 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 e39c147483..0bb4575ec5 100644 --- a/src/panels/config/lovelace/dashboards/ha-config-lovelace-dashboards.ts +++ b/src/panels/config/lovelace/dashboards/ha-config-lovelace-dashboards.ts @@ -7,6 +7,7 @@ import { html, LitElement, property, + internalProperty, PropertyValues, TemplateResult, } from "lit-element"; @@ -40,7 +41,7 @@ import { computeRTL } from "../../../../common/util/compute_rtl"; @customElement("ha-config-lovelace-dashboards") export class HaConfigLovelaceDashboards extends LitElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; @property() public isWide!: boolean; @@ -48,7 +49,7 @@ export class HaConfigLovelaceDashboards extends LitElement { @property() public route!: Route; - @property() private _dashboards: LovelaceDashboard[] = []; + @internalProperty() private _dashboards: LovelaceDashboard[] = []; private _columns = memoize( (narrow: boolean, _language, dashboards): DataTableColumnContainer => { diff --git a/src/panels/config/lovelace/ha-config-lovelace.ts b/src/panels/config/lovelace/ha-config-lovelace.ts index 837f1686a2..d67144c571 100644 --- a/src/panels/config/lovelace/ha-config-lovelace.ts +++ b/src/panels/config/lovelace/ha-config-lovelace.ts @@ -23,7 +23,7 @@ export const lovelaceTabs = [ @customElement("ha-config-lovelace") class HaConfigLovelace extends HassRouterPage { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; @property() public narrow!: boolean; diff --git a/src/panels/config/lovelace/resources/dialog-lovelace-resource-detail.ts b/src/panels/config/lovelace/resources/dialog-lovelace-resource-detail.ts index 7613057db6..0603562940 100644 --- a/src/panels/config/lovelace/resources/dialog-lovelace-resource-detail.ts +++ b/src/panels/config/lovelace/resources/dialog-lovelace-resource-detail.ts @@ -9,6 +9,7 @@ import { html, LitElement, property, + internalProperty, TemplateResult, } from "lit-element"; import { createCloseHeading } from "../../../../components/ha-dialog"; @@ -24,17 +25,17 @@ import { LovelaceResourceDetailsDialogParams } from "./show-dialog-lovelace-reso @customElement("dialog-lovelace-resource-detail") export class DialogLovelaceResourceDetail extends LitElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; - @property() private _params?: LovelaceResourceDetailsDialogParams; + @internalProperty() private _params?: LovelaceResourceDetailsDialogParams; - @property() private _url!: LovelaceResource["url"]; + @internalProperty() private _url!: LovelaceResource["url"]; - @property() private _type!: LovelaceResource["type"]; + @internalProperty() private _type!: LovelaceResource["type"]; - @property() private _error?: string; + @internalProperty() private _error?: string; - @property() private _submitting = false; + @internalProperty() private _submitting = false; public async showDialog( params: LovelaceResourceDetailsDialogParams 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 1b31ba3e10..946164b081 100644 --- a/src/panels/config/lovelace/resources/ha-config-lovelace-resources.ts +++ b/src/panels/config/lovelace/resources/ha-config-lovelace-resources.ts @@ -11,6 +11,7 @@ import { html, LitElement, property, + internalProperty, PropertyValues, TemplateResult, } from "lit-element"; @@ -44,7 +45,7 @@ import { computeRTL } from "../../../../common/util/compute_rtl"; @customElement("ha-config-lovelace-resources") export class HaConfigLovelaceRescources extends LitElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; @property() public isWide!: boolean; @@ -52,7 +53,7 @@ export class HaConfigLovelaceRescources extends LitElement { @property() public route!: Route; - @property() private _resources: LovelaceResource[] = []; + @internalProperty() private _resources: LovelaceResource[] = []; private _columns = memoize( (_language): DataTableColumnContainer => { diff --git a/src/panels/config/person/dialog-person-detail.ts b/src/panels/config/person/dialog-person-detail.ts index fa784f1793..b146cf4074 100644 --- a/src/panels/config/person/dialog-person-detail.ts +++ b/src/panels/config/person/dialog-person-detail.ts @@ -6,6 +6,7 @@ import { html, LitElement, property, + internalProperty, TemplateResult, } from "lit-element"; import memoizeOne from "memoize-one"; @@ -21,19 +22,19 @@ import { PersonDetailDialogParams } from "./show-dialog-person-detail"; const includeDomains = ["device_tracker"]; class DialogPersonDetail extends LitElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; - @property() private _name!: string; + @internalProperty() private _name!: string; - @property() private _userId?: string; + @internalProperty() private _userId?: string; - @property() private _deviceTrackers!: string[]; + @internalProperty() private _deviceTrackers!: string[]; - @property() private _error?: string; + @internalProperty() private _error?: string; - @property() private _params?: PersonDetailDialogParams; + @internalProperty() private _params?: PersonDetailDialogParams; - @property() private _submitting = false; + @internalProperty() private _submitting = false; private _deviceTrackersAvailable = memoizeOne((hass) => { return Object.keys(hass.states).some( diff --git a/src/panels/config/person/ha-config-person.ts b/src/panels/config/person/ha-config-person.ts index 41f316d534..479f477dc1 100644 --- a/src/panels/config/person/ha-config-person.ts +++ b/src/panels/config/person/ha-config-person.ts @@ -6,6 +6,7 @@ import { html, LitElement, property, + internalProperty, TemplateResult, } from "lit-element"; import { compare } from "../../../common/string/compare"; @@ -34,7 +35,7 @@ import { mdiPlus } from "@mdi/js"; import { computeRTL } from "../../../common/util/compute_rtl"; class HaConfigPerson extends LitElement { - @property() public hass?: HomeAssistant; + @property({ attribute: false }) public hass?: HomeAssistant; @property() public isWide?: boolean; @@ -42,9 +43,9 @@ class HaConfigPerson extends LitElement { @property() public route!: Route; - @property() private _storageItems?: Person[]; + @internalProperty() private _storageItems?: Person[]; - @property() private _configItems?: Person[]; + @internalProperty() private _configItems?: Person[]; private _usersLoad?: Promise; diff --git a/src/panels/config/scene/ha-config-scene.ts b/src/panels/config/scene/ha-config-scene.ts index ab3b61dadb..3e5d5fe9e7 100644 --- a/src/panels/config/scene/ha-config-scene.ts +++ b/src/panels/config/scene/ha-config-scene.ts @@ -21,7 +21,7 @@ const equal = (a: SceneEntity[], b: SceneEntity[]): boolean => { @customElement("ha-config-scene") class HaConfigScene extends HassRouterPage { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; @property() public narrow!: boolean; diff --git a/src/panels/config/scene/ha-scene-dashboard.ts b/src/panels/config/scene/ha-scene-dashboard.ts index 51a2badf61..8968b324b8 100644 --- a/src/panels/config/scene/ha-scene-dashboard.ts +++ b/src/panels/config/scene/ha-scene-dashboard.ts @@ -31,7 +31,7 @@ import { stateIcon } from "../../../common/entity/state_icon"; @customElement("ha-scene-dashboard") class HaSceneDashboard extends LitElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; @property() public narrow!: boolean; diff --git a/src/panels/config/scene/ha-scene-editor.ts b/src/panels/config/scene/ha-scene-editor.ts index 89a46b3f20..246e0c8c1b 100644 --- a/src/panels/config/scene/ha-scene-editor.ts +++ b/src/panels/config/scene/ha-scene-editor.ts @@ -10,6 +10,7 @@ import { html, LitElement, property, + internalProperty, PropertyValues, TemplateResult, } from "lit-element"; @@ -70,7 +71,7 @@ interface DeviceEntitiesLookup { @customElement("ha-scene-editor") export class HaSceneEditor extends SubscribeMixin(LitElement) { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; @property() public narrow!: boolean; @@ -84,27 +85,29 @@ export class HaSceneEditor extends SubscribeMixin(LitElement) { @property() public showAdvanced!: boolean; - @property() private _dirty = false; + @internalProperty() private _dirty = false; - @property() private _errors?: string; + @internalProperty() private _errors?: string; - @property() private _config?: SceneConfig; + @internalProperty() private _config?: SceneConfig; - @property() private _entities: string[] = []; + @internalProperty() private _entities: string[] = []; - @property() private _devices: string[] = []; + @internalProperty() private _devices: string[] = []; - @property() private _deviceRegistryEntries: DeviceRegistryEntry[] = []; + @internalProperty() + private _deviceRegistryEntries: DeviceRegistryEntry[] = []; - @property() private _entityRegistryEntries: EntityRegistryEntry[] = []; + @internalProperty() + private _entityRegistryEntries: EntityRegistryEntry[] = []; - @property() private _scene?: SceneEntity; + @internalProperty() private _scene?: SceneEntity; private _storedStates: SceneEntities = {}; private _unsubscribeEvents?: () => void; - @property() private _deviceEntityLookup: DeviceEntitiesLookup = {}; + @internalProperty() private _deviceEntityLookup: DeviceEntitiesLookup = {}; private _activateContextId?: string; diff --git a/src/panels/config/script/ha-config-script.ts b/src/panels/config/script/ha-config-script.ts index 0782ece4b3..a1e9643c84 100644 --- a/src/panels/config/script/ha-config-script.ts +++ b/src/panels/config/script/ha-config-script.ts @@ -21,7 +21,7 @@ const equal = (a: ScriptEntity[], b: ScriptEntity[]): boolean => { @customElement("ha-config-script") class HaConfigScript extends HassRouterPage { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; @property() public narrow!: boolean; diff --git a/src/panels/config/script/ha-script-editor.ts b/src/panels/config/script/ha-script-editor.ts index 4617f1a01b..434899d53d 100644 --- a/src/panels/config/script/ha-script-editor.ts +++ b/src/panels/config/script/ha-script-editor.ts @@ -8,9 +8,9 @@ import { html, LitElement, property, + internalProperty, PropertyValues, TemplateResult, - internalProperty, } from "lit-element"; import { classMap } from "lit-html/directives/class-map"; import { computeObjectId } from "../../../common/entity/compute_object_id"; @@ -41,7 +41,7 @@ import { PaperListboxElement } from "@polymer/paper-listbox"; import { slugify } from "../../../common/string/slugify"; export class HaScriptEditor extends LitElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; @property() public scriptEntityId!: string; diff --git a/src/panels/config/script/ha-script-picker.ts b/src/panels/config/script/ha-script-picker.ts index 7135a80db0..ccfad94f8e 100644 --- a/src/panels/config/script/ha-script-picker.ts +++ b/src/panels/config/script/ha-script-picker.ts @@ -29,7 +29,7 @@ import { stateIcon } from "../../../common/entity/state_icon"; @customElement("ha-script-picker") class HaScriptPicker extends LitElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; @property() public scripts!: HassEntity[]; diff --git a/src/panels/config/server_control/ha-config-server-control.ts b/src/panels/config/server_control/ha-config-server-control.ts index 7a06a6a439..a08b26f072 100644 --- a/src/panels/config/server_control/ha-config-server-control.ts +++ b/src/panels/config/server_control/ha-config-server-control.ts @@ -5,6 +5,7 @@ import { configSections } from "../ha-panel-config"; import { LitElement, property, + internalProperty, customElement, html, css, @@ -38,7 +39,7 @@ const reloadableDomains = [ @customElement("ha-config-server-control") export class HaConfigServerControl extends LitElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; @property() public isWide!: boolean; @@ -48,7 +49,7 @@ export class HaConfigServerControl extends LitElement { @property() public showAdvanced!: boolean; - @property() private _validating = false; + @internalProperty() private _validating = false; private _validateLog = ""; diff --git a/src/panels/config/users/dialog-add-user.ts b/src/panels/config/users/dialog-add-user.ts index b9ba84bd87..f9f83566fb 100644 --- a/src/panels/config/users/dialog-add-user.ts +++ b/src/panels/config/users/dialog-add-user.ts @@ -8,6 +8,7 @@ import { html, LitElement, property, + internalProperty, PropertyValues, TemplateResult, } from "lit-element"; @@ -30,22 +31,22 @@ import { computeRTLDirection } from "../../../common/util/compute_rtl"; @customElement("dialog-add-user") export class DialogAddUser extends LitElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; - @property() private _loading = false; + @internalProperty() private _loading = false; // Error message when can't talk to server etc - @property() private _error?: string; + @internalProperty() private _error?: string; - @property() private _params?: AddUserDialogParams; + @internalProperty() private _params?: AddUserDialogParams; - @property() private _name?: string; + @internalProperty() private _name?: string; - @property() private _username?: string; + @internalProperty() private _username?: string; - @property() private _password?: string; + @internalProperty() private _password?: string; - @property() private _isAdmin?: boolean; + @internalProperty() private _isAdmin?: boolean; public showDialog(params: AddUserDialogParams) { this._params = params; diff --git a/src/panels/config/users/dialog-user-detail.ts b/src/panels/config/users/dialog-user-detail.ts index 59015bb07f..504ef0a4b5 100644 --- a/src/panels/config/users/dialog-user-detail.ts +++ b/src/panels/config/users/dialog-user-detail.ts @@ -8,6 +8,7 @@ import { html, LitElement, property, + internalProperty, TemplateResult, } from "lit-element"; import { createCloseHeading } from "../../../components/ha-dialog"; @@ -25,17 +26,17 @@ import { computeRTLDirection } from "../../../common/util/compute_rtl"; @customElement("dialog-user-detail") class DialogUserDetail extends LitElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; - @property() private _name!: string; + @internalProperty() private _name!: string; - @property() private _isAdmin?: boolean; + @internalProperty() private _isAdmin?: boolean; - @property() private _error?: string; + @internalProperty() private _error?: string; - @property() private _params?: UserDetailDialogParams; + @internalProperty() private _params?: UserDetailDialogParams; - @property() private _submitting = false; + @internalProperty() private _submitting = false; public async showDialog(params: UserDetailDialogParams): Promise { this._params = params; diff --git a/src/panels/config/users/ha-config-users.ts b/src/panels/config/users/ha-config-users.ts index cf8d40588d..cedc36b07f 100644 --- a/src/panels/config/users/ha-config-users.ts +++ b/src/panels/config/users/ha-config-users.ts @@ -26,7 +26,7 @@ import { mdiPlus } from "@mdi/js"; @customElement("ha-config-users") export class HaConfigUsers extends LitElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; @property() public _users: User[] = []; diff --git a/src/panels/config/zone/dialog-zone-detail.ts b/src/panels/config/zone/dialog-zone-detail.ts index 8de08f7218..8b1cc43801 100644 --- a/src/panels/config/zone/dialog-zone-detail.ts +++ b/src/panels/config/zone/dialog-zone-detail.ts @@ -6,6 +6,7 @@ import { html, LitElement, property, + internalProperty, TemplateResult, } from "lit-element"; import { fireEvent } from "../../../common/dom/fire_event"; @@ -26,25 +27,25 @@ import { ZoneDetailDialogParams } from "./show-dialog-zone-detail"; import { computeRTLDirection } from "../../../common/util/compute_rtl"; class DialogZoneDetail extends LitElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; - @property() private _name!: string; + @internalProperty() private _name!: string; - @property() private _icon!: string; + @internalProperty() private _icon!: string; - @property() private _latitude!: number; + @internalProperty() private _latitude!: number; - @property() private _longitude!: number; + @internalProperty() private _longitude!: number; - @property() private _passive!: boolean; + @internalProperty() private _passive!: boolean; - @property() private _radius!: number; + @internalProperty() private _radius!: number; - @property() private _error?: string; + @internalProperty() private _error?: string; - @property() private _params?: ZoneDetailDialogParams; + @internalProperty() private _params?: ZoneDetailDialogParams; - @property() private _submitting = false; + @internalProperty() private _submitting = false; public showDialog(params: ZoneDetailDialogParams): void { this._params = params; diff --git a/src/panels/config/zone/ha-config-zone.ts b/src/panels/config/zone/ha-config-zone.ts index a98f041bfe..4dffc11311 100644 --- a/src/panels/config/zone/ha-config-zone.ts +++ b/src/panels/config/zone/ha-config-zone.ts @@ -13,6 +13,7 @@ import { html, LitElement, property, + internalProperty, PropertyValues, query, TemplateResult, @@ -54,7 +55,7 @@ import { computeRTL } from "../../../common/util/compute_rtl"; @customElement("ha-config-zone") export class HaConfigZone extends SubscribeMixin(LitElement) { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; @property() public isWide?: boolean; @@ -62,13 +63,13 @@ export class HaConfigZone extends SubscribeMixin(LitElement) { @property() public route!: Route; - @property() private _storageItems?: Zone[]; + @internalProperty() private _storageItems?: Zone[]; - @property() private _stateItems?: HassEntity[]; + @internalProperty() private _stateItems?: HassEntity[]; - @property() private _activeEntry = ""; + @internalProperty() private _activeEntry = ""; - @property() private _canEditCore = false; + @internalProperty() private _canEditCore = false; @query("ha-locations-editor") private _map?: HaLocationsEditor; diff --git a/src/panels/custom/ha-panel-custom.ts b/src/panels/custom/ha-panel-custom.ts index 9739c79c7e..028cd9b227 100644 --- a/src/panels/custom/ha-panel-custom.ts +++ b/src/panels/custom/ha-panel-custom.ts @@ -16,7 +16,7 @@ declare global { } export class HaPanelCustom extends UpdatingElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; @property() public narrow!: boolean; diff --git a/src/panels/developer-tools/developer-tools-router.ts b/src/panels/developer-tools/developer-tools-router.ts index e7f4e78c2a..903948a168 100644 --- a/src/panels/developer-tools/developer-tools-router.ts +++ b/src/panels/developer-tools/developer-tools-router.ts @@ -5,7 +5,7 @@ import { HomeAssistant } from "../../types"; @customElement("developer-tools-router") class DeveloperToolsRouter extends HassRouterPage { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; @property() public narrow!: boolean; diff --git a/src/panels/developer-tools/event/event-subscribe-card.ts b/src/panels/developer-tools/event/event-subscribe-card.ts index 7e64b3ba34..826eb7689a 100644 --- a/src/panels/developer-tools/event/event-subscribe-card.ts +++ b/src/panels/developer-tools/event/event-subscribe-card.ts @@ -8,6 +8,7 @@ import { html, LitElement, property, + internalProperty, TemplateResult, } from "lit-element"; import { formatTime } from "../../../common/datetime/format_time"; @@ -17,13 +18,16 @@ import { HomeAssistant } from "../../../types"; @customElement("event-subscribe-card") class EventSubscribeCard extends LitElement { - @property() public hass?: HomeAssistant; + @property({ attribute: false }) public hass?: HomeAssistant; - @property() private _eventType = ""; + @internalProperty() private _eventType = ""; - @property() private _subscribed?: () => void; + @internalProperty() private _subscribed?: () => void; - @property() private _events: Array<{ id: number; event: HassEvent }> = []; + @internalProperty() private _events: Array<{ + id: number; + event: HassEvent; + }> = []; private _eventCount = 0; diff --git a/src/panels/developer-tools/ha-panel-developer-tools.ts b/src/panels/developer-tools/ha-panel-developer-tools.ts index b306a5fe33..953d6f83bc 100644 --- a/src/panels/developer-tools/ha-panel-developer-tools.ts +++ b/src/panels/developer-tools/ha-panel-developer-tools.ts @@ -22,7 +22,7 @@ import "./developer-tools-router"; @customElement("ha-panel-developer-tools") class PanelDeveloperTools extends LitElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; @property() public route!: Route; diff --git a/src/panels/history/ha-panel-history.ts b/src/panels/history/ha-panel-history.ts index 21e43a2aa7..08fabe00bf 100644 --- a/src/panels/history/ha-panel-history.ts +++ b/src/panels/history/ha-panel-history.ts @@ -4,7 +4,13 @@ import "@polymer/app-layout/app-toolbar/app-toolbar"; import { computeRTL } from "../../common/util/compute_rtl"; import "../../components/ha-menu-button"; import "../../components/state-history-charts"; -import { LitElement, css, property, PropertyValues } from "lit-element"; +import { + LitElement, + css, + property, + internalProperty, + PropertyValues, +} from "lit-element"; import { html } from "lit-html"; import { haStyle } from "../../resources/styles"; import { HomeAssistant } from "../../types"; @@ -30,7 +36,7 @@ class HaPanelHistory extends LitElement { @property({ reflect: true, type: Boolean }) rtl = false; - @property() private _ranges?: DateRangePickerRanges; + @internalProperty() private _ranges?: DateRangePickerRanges; public constructor() { super(); diff --git a/src/panels/logbook/ha-logbook.ts b/src/panels/logbook/ha-logbook.ts index 1cce036af0..8b6d8bc36a 100644 --- a/src/panels/logbook/ha-logbook.ts +++ b/src/panels/logbook/ha-logbook.ts @@ -21,7 +21,7 @@ import { HomeAssistant } from "../../types"; import { restoreScroll } from "../../common/decorators/restore-scroll"; class HaLogbook extends LitElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; @property() public userIdToName = {}; diff --git a/src/panels/logbook/ha-panel-logbook.ts b/src/panels/logbook/ha-panel-logbook.ts index 8a0cf68b1f..36e0823fa5 100644 --- a/src/panels/logbook/ha-panel-logbook.ts +++ b/src/panels/logbook/ha-panel-logbook.ts @@ -10,6 +10,7 @@ import "./ha-logbook"; import { LitElement, property, + internalProperty, customElement, html, css, @@ -49,7 +50,7 @@ export class HaPanelLogbook extends LitElement { @property({ reflect: true, type: Boolean }) rtl = false; - @property() private _ranges?: DateRangePickerRanges; + @internalProperty() private _ranges?: DateRangePickerRanges; private _fetchUserDone?: Promise; diff --git a/src/panels/lovelace/badges/hui-entity-filter-badge.ts b/src/panels/lovelace/badges/hui-entity-filter-badge.ts index 29edf4ab63..fb7db3d95d 100644 --- a/src/panels/lovelace/badges/hui-entity-filter-badge.ts +++ b/src/panels/lovelace/badges/hui-entity-filter-badge.ts @@ -5,12 +5,17 @@ import { createBadgeElement } from "../create-element/create-badge-element"; import { EntityFilterEntityConfig } from "../entity-rows/types"; import { LovelaceBadge } from "../types"; import { EntityFilterBadgeConfig } from "./types"; -import { UpdatingElement, property, PropertyValues } from "lit-element"; +import { + UpdatingElement, + property, + internalProperty, + PropertyValues, +} from "lit-element"; class EntityFilterBadge extends UpdatingElement implements LovelaceBadge { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; - @property() private _config?: EntityFilterBadgeConfig; + @internalProperty() private _config?: EntityFilterBadgeConfig; private _elements?: LovelaceBadge[]; diff --git a/src/panels/lovelace/badges/hui-error-badge.ts b/src/panels/lovelace/badges/hui-error-badge.ts index 9d1a0a9e6f..3ecec00678 100644 --- a/src/panels/lovelace/badges/hui-error-badge.ts +++ b/src/panels/lovelace/badges/hui-error-badge.ts @@ -4,7 +4,7 @@ import { customElement, html, LitElement, - property, + internalProperty, TemplateResult, } from "lit-element"; import "../../../components/ha-label-badge"; @@ -27,7 +27,7 @@ export const createErrorBadgeConfig = (error) => ({ export class HuiErrorBadge extends LitElement implements LovelaceBadge { public hass?: HomeAssistant; - @property() private _config?: ErrorBadgeConfig; + @internalProperty() private _config?: ErrorBadgeConfig; public setConfig(config: ErrorBadgeConfig): void { this._config = config; diff --git a/src/panels/lovelace/badges/hui-state-label-badge.ts b/src/panels/lovelace/badges/hui-state-label-badge.ts index e87eb1126d..c95258ba0c 100644 --- a/src/panels/lovelace/badges/hui-state-label-badge.ts +++ b/src/panels/lovelace/badges/hui-state-label-badge.ts @@ -19,7 +19,7 @@ import { StateLabelBadgeConfig } from "./types"; @customElement("hui-state-label-badge") export class HuiStateLabelBadge extends LitElement implements LovelaceBadge { - @property() public hass?: HomeAssistant; + @property({ attribute: false }) public hass?: HomeAssistant; @property() protected _config?: StateLabelBadgeConfig; diff --git a/src/panels/lovelace/cards/hui-alarm-panel-card.ts b/src/panels/lovelace/cards/hui-alarm-panel-card.ts index 8fa590cf8f..2137bca09c 100644 --- a/src/panels/lovelace/cards/hui-alarm-panel-card.ts +++ b/src/panels/lovelace/cards/hui-alarm-panel-card.ts @@ -7,6 +7,7 @@ import { html, LitElement, property, + internalProperty, PropertyValues, query, TemplateResult, @@ -69,9 +70,9 @@ class HuiAlarmPanelCard extends LitElement implements LovelaceCard { }; } - @property() public hass?: HomeAssistant; + @property({ attribute: false }) public hass?: HomeAssistant; - @property() private _config?: AlarmPanelCardConfig; + @internalProperty() private _config?: AlarmPanelCardConfig; @query("#alarmCode") private _input?: PaperInputElement; diff --git a/src/panels/lovelace/cards/hui-button-card.ts b/src/panels/lovelace/cards/hui-button-card.ts index 9a65aad8fc..a2662ab7bd 100644 --- a/src/panels/lovelace/cards/hui-button-card.ts +++ b/src/panels/lovelace/cards/hui-button-card.ts @@ -72,9 +72,9 @@ export class HuiButtonCard extends LitElement implements LovelaceCard { }; } - @property() public hass?: HomeAssistant; + @property({ attribute: false }) public hass?: HomeAssistant; - @property() private _config?: ButtonCardConfig; + @internalProperty() private _config?: ButtonCardConfig; @queryAsync("mwc-ripple") private _ripple!: Promise; diff --git a/src/panels/lovelace/cards/hui-empty-state-card.ts b/src/panels/lovelace/cards/hui-empty-state-card.ts index b539111d95..dce740668b 100644 --- a/src/panels/lovelace/cards/hui-empty-state-card.ts +++ b/src/panels/lovelace/cards/hui-empty-state-card.ts @@ -15,7 +15,7 @@ import { EmptyStateCardConfig } from "./types"; @customElement("hui-empty-state-card") export class HuiEmptyStateCard extends LitElement implements LovelaceCard { - @property() public hass?: HomeAssistant; + @property({ attribute: false }) public hass?: HomeAssistant; public getCardSize(): number { return 2; diff --git a/src/panels/lovelace/cards/hui-entities-card.ts b/src/panels/lovelace/cards/hui-entities-card.ts index 4d7dfed43e..2e55a41b39 100644 --- a/src/panels/lovelace/cards/hui-entities-card.ts +++ b/src/panels/lovelace/cards/hui-entities-card.ts @@ -4,7 +4,7 @@ import { customElement, html, LitElement, - property, + internalProperty, PropertyValues, TemplateResult, } from "lit-element"; @@ -53,7 +53,7 @@ class HuiEntitiesCard extends LitElement implements LovelaceCard { return { type: "entities", title: "My Title", entities: foundEntities }; } - @property() private _config?: EntitiesCardConfig; + @internalProperty() private _config?: EntitiesCardConfig; private _hass?: HomeAssistant; diff --git a/src/panels/lovelace/cards/hui-entity-card.ts b/src/panels/lovelace/cards/hui-entity-card.ts index 0b1caa900b..73467c08d5 100644 --- a/src/panels/lovelace/cards/hui-entity-card.ts +++ b/src/panels/lovelace/cards/hui-entity-card.ts @@ -5,6 +5,7 @@ import { html, LitElement, property, + internalProperty, PropertyValues, TemplateResult, } from "lit-element"; @@ -60,9 +61,9 @@ export class HuiEntityCard extends LitElement implements LovelaceCard { }; } - @property() public hass?: HomeAssistant; + @property({ attribute: false }) public hass?: HomeAssistant; - @property() private _config?: EntityCardConfig; + @internalProperty() private _config?: EntityCardConfig; private _footerElement?: HuiErrorCard | LovelaceHeaderFooter; diff --git a/src/panels/lovelace/cards/hui-entity-filter-card.ts b/src/panels/lovelace/cards/hui-entity-filter-card.ts index f207847dfb..ecb8f211f6 100644 --- a/src/panels/lovelace/cards/hui-entity-filter-card.ts +++ b/src/panels/lovelace/cards/hui-entity-filter-card.ts @@ -6,17 +6,22 @@ import { createCardElement } from "../create-element/create-card-element"; import { EntityFilterEntityConfig } from "../entity-rows/types"; import { LovelaceCard } from "../types"; import { EntityFilterCardConfig } from "./types"; -import { property, PropertyValues, UpdatingElement } from "lit-element"; +import { + property, + internalProperty, + PropertyValues, + UpdatingElement, +} from "lit-element"; import { computeCardSize } from "../common/compute-card-size"; class EntityFilterCard extends UpdatingElement implements LovelaceCard { - @property() public hass?: HomeAssistant; + @property({ attribute: false }) public hass?: HomeAssistant; @property() public isPanel = false; @property() public editMode = false; - @property() private _config?: EntityFilterCardConfig; + @internalProperty() private _config?: EntityFilterCardConfig; private _element?: LovelaceCard; diff --git a/src/panels/lovelace/cards/hui-error-card.ts b/src/panels/lovelace/cards/hui-error-card.ts index 2eaadf7dca..9da8f631b7 100644 --- a/src/panels/lovelace/cards/hui-error-card.ts +++ b/src/panels/lovelace/cards/hui-error-card.ts @@ -4,7 +4,7 @@ import { customElement, html, LitElement, - property, + internalProperty, TemplateResult, } from "lit-element"; import { HomeAssistant } from "../../../types"; @@ -16,7 +16,7 @@ import { safeDump } from "js-yaml"; export class HuiErrorCard extends LitElement implements LovelaceCard { public hass?: HomeAssistant; - @property() private _config?: ErrorCardConfig; + @internalProperty() private _config?: ErrorCardConfig; public getCardSize(): number { return 4; diff --git a/src/panels/lovelace/cards/hui-gauge-card.ts b/src/panels/lovelace/cards/hui-gauge-card.ts index d5c1f1fd39..3d2b3ff4b9 100644 --- a/src/panels/lovelace/cards/hui-gauge-card.ts +++ b/src/panels/lovelace/cards/hui-gauge-card.ts @@ -7,6 +7,7 @@ import { html, LitElement, property, + internalProperty, PropertyValues, TemplateResult, query, @@ -63,11 +64,11 @@ class HuiGaugeCard extends LitElement implements LovelaceCard { return { type: "gauge", entity: foundEntities[0] || "" }; } - @property() public hass?: HomeAssistant; + @property({ attribute: false }) public hass?: HomeAssistant; - @property() private _config?: GaugeCardConfig; + @internalProperty() private _config?: GaugeCardConfig; - @property() private _gauge?: any; + @internalProperty() private _gauge?: any; @query("#gauge") private _gaugeElement!: HTMLDivElement; diff --git a/src/panels/lovelace/cards/hui-glance-card.ts b/src/panels/lovelace/cards/hui-glance-card.ts index 4d3d577de6..46b5be3735 100644 --- a/src/panels/lovelace/cards/hui-glance-card.ts +++ b/src/panels/lovelace/cards/hui-glance-card.ts @@ -5,6 +5,7 @@ import { html, LitElement, property, + internalProperty, PropertyValues, TemplateResult, } from "lit-element"; @@ -59,9 +60,9 @@ export class HuiGlanceCard extends LitElement implements LovelaceCard { return { type: "glance", entities: foundEntities }; } - @property() public hass?: HomeAssistant; + @property({ attribute: false }) public hass?: HomeAssistant; - @property() private _config?: GlanceCardConfig; + @internalProperty() private _config?: GlanceCardConfig; private _configEntities?: GlanceConfigEntity[]; diff --git a/src/panels/lovelace/cards/hui-history-graph-card.ts b/src/panels/lovelace/cards/hui-history-graph-card.ts index cfd81c79a5..af5ba94891 100644 --- a/src/panels/lovelace/cards/hui-history-graph-card.ts +++ b/src/panels/lovelace/cards/hui-history-graph-card.ts @@ -5,6 +5,7 @@ import { html, LitElement, property, + internalProperty, PropertyValues, TemplateResult, } from "lit-element"; @@ -46,11 +47,11 @@ export class HuiHistoryGraphCard extends LitElement implements LovelaceCard { return { type: "history-graph", entities: foundEntities }; } - @property() public hass?: HomeAssistant; + @property({ attribute: false }) public hass?: HomeAssistant; - @property() private _stateHistory?: any; + @internalProperty() private _stateHistory?: any; - @property() private _config?: HistoryGraphCardConfig; + @internalProperty() private _config?: HistoryGraphCardConfig; private _configEntities?: EntityConfig[]; diff --git a/src/panels/lovelace/cards/hui-humidifier-card.ts b/src/panels/lovelace/cards/hui-humidifier-card.ts index dd2bd4f7b0..bb583ad366 100644 --- a/src/panels/lovelace/cards/hui-humidifier-card.ts +++ b/src/panels/lovelace/cards/hui-humidifier-card.ts @@ -8,6 +8,7 @@ import { html, LitElement, property, + internalProperty, PropertyValues, svg, TemplateResult, @@ -53,11 +54,11 @@ export class HuiHumidifierCard extends LitElement implements LovelaceCard { return { type: "humidifier", entity: foundEntities[0] || "" }; } - @property() public hass?: HomeAssistant; + @property({ attribute: false }) public hass?: HomeAssistant; - @property() private _config?: HumidifierCardConfig; + @internalProperty() private _config?: HumidifierCardConfig; - @property() private _setHum?: number; + @internalProperty() private _setHum?: number; public getCardSize(): number { return 5; diff --git a/src/panels/lovelace/cards/hui-light-card.ts b/src/panels/lovelace/cards/hui-light-card.ts index b45d14cb1a..51fb22a991 100644 --- a/src/panels/lovelace/cards/hui-light-card.ts +++ b/src/panels/lovelace/cards/hui-light-card.ts @@ -7,6 +7,7 @@ import { html, LitElement, property, + internalProperty, PropertyValues, TemplateResult, } from "lit-element"; @@ -59,9 +60,9 @@ export class HuiLightCard extends LitElement implements LovelaceCard { return { type: "light", entity: foundEntities[0] || "" }; } - @property() public hass?: HomeAssistant; + @property({ attribute: false }) public hass?: HomeAssistant; - @property() private _config?: LightCardConfig; + @internalProperty() private _config?: LightCardConfig; private _brightnessTimout?: number; diff --git a/src/panels/lovelace/cards/hui-map-card.ts b/src/panels/lovelace/cards/hui-map-card.ts index 374e2f335d..7c11427e7a 100644 --- a/src/panels/lovelace/cards/hui-map-card.ts +++ b/src/panels/lovelace/cards/hui-map-card.ts @@ -68,7 +68,7 @@ class HuiMapCard extends LitElement implements LovelaceCard { return { type: "map", entities: foundEntities }; } - @property() public hass?: HomeAssistant; + @property({ attribute: false }) public hass?: HomeAssistant; @property({ type: Boolean, reflect: true }) public isPanel = false; diff --git a/src/panels/lovelace/cards/hui-markdown-card.ts b/src/panels/lovelace/cards/hui-markdown-card.ts index 8c0d6bbfc7..2ea9d6c2dc 100644 --- a/src/panels/lovelace/cards/hui-markdown-card.ts +++ b/src/panels/lovelace/cards/hui-markdown-card.ts @@ -6,6 +6,7 @@ import { html, LitElement, property, + internalProperty, PropertyValues, TemplateResult, } from "lit-element"; @@ -35,13 +36,13 @@ export class HuiMarkdownCard extends LitElement implements LovelaceCard { }; } - @property() public hass?: HomeAssistant; + @property({ attribute: false }) public hass?: HomeAssistant; - @property() private _config?: MarkdownCardConfig; + @internalProperty() private _config?: MarkdownCardConfig; - @property() private _content = ""; + @internalProperty() private _content = ""; - @property() private _unsubRenderTemplate?: Promise; + @internalProperty() private _unsubRenderTemplate?: Promise; public getCardSize(): number { return this._config === undefined diff --git a/src/panels/lovelace/cards/hui-media-control-card.ts b/src/panels/lovelace/cards/hui-media-control-card.ts index 4059abdf48..51528d8d32 100644 --- a/src/panels/lovelace/cards/hui-media-control-card.ts +++ b/src/panels/lovelace/cards/hui-media-control-card.ts @@ -8,6 +8,7 @@ import { html, LitElement, property, + internalProperty, PropertyValues, query, TemplateResult, @@ -188,23 +189,23 @@ export class HuiMediaControlCard extends LitElement implements LovelaceCard { return { type: "media-control", entity: foundEntities[0] || "" }; } - @property() public hass?: HomeAssistant; + @property({ attribute: false }) public hass?: HomeAssistant; - @property() private _config?: MediaControlCardConfig; + @internalProperty() private _config?: MediaControlCardConfig; - @property() private _foregroundColor?: string; + @internalProperty() private _foregroundColor?: string; - @property() private _backgroundColor?: string; + @internalProperty() private _backgroundColor?: string; - @property() private _narrow = false; + @internalProperty() private _narrow = false; - @property() private _veryNarrow = false; + @internalProperty() private _veryNarrow = false; - @property() private _cardHeight = 0; + @internalProperty() private _cardHeight = 0; @query("paper-progress") private _progressBar?: PaperProgressElement; - @property() private _marqueeActive = false; + @internalProperty() private _marqueeActive = false; private _progressInterval?: number; diff --git a/src/panels/lovelace/cards/hui-picture-card.ts b/src/panels/lovelace/cards/hui-picture-card.ts index bda16ed813..479c504ad9 100644 --- a/src/panels/lovelace/cards/hui-picture-card.ts +++ b/src/panels/lovelace/cards/hui-picture-card.ts @@ -38,7 +38,7 @@ export class HuiPictureCard extends LitElement implements LovelaceCard { }; } - @property() public hass?: HomeAssistant; + @property({ attribute: false }) public hass?: HomeAssistant; @property() protected _config?: PictureCardConfig; diff --git a/src/panels/lovelace/cards/hui-picture-elements-card.ts b/src/panels/lovelace/cards/hui-picture-elements-card.ts index 29c78c9650..d189f885bd 100644 --- a/src/panels/lovelace/cards/hui-picture-elements-card.ts +++ b/src/panels/lovelace/cards/hui-picture-elements-card.ts @@ -5,6 +5,7 @@ import { html, LitElement, property, + internalProperty, PropertyValues, TemplateResult, } from "lit-element"; @@ -19,9 +20,9 @@ import { PictureElementsCardConfig } from "./types"; @customElement("hui-picture-elements-card") class HuiPictureElementsCard extends LitElement implements LovelaceCard { - @property() public hass?: HomeAssistant; + @property({ attribute: false }) public hass?: HomeAssistant; - @property() private _elements?: LovelaceElement[]; + @internalProperty() private _elements?: LovelaceElement[]; public static getStubConfig( hass: HomeAssistant, @@ -53,7 +54,7 @@ class HuiPictureElementsCard extends LitElement implements LovelaceCard { }; } - @property() private _config?: PictureElementsCardConfig; + @internalProperty() private _config?: PictureElementsCardConfig; public getCardSize(): number { return 4; diff --git a/src/panels/lovelace/cards/hui-picture-entity-card.ts b/src/panels/lovelace/cards/hui-picture-entity-card.ts index c8bc0e593b..60b1384670 100644 --- a/src/panels/lovelace/cards/hui-picture-entity-card.ts +++ b/src/panels/lovelace/cards/hui-picture-entity-card.ts @@ -5,6 +5,7 @@ import { html, LitElement, property, + internalProperty, PropertyValues, TemplateResult, } from "lit-element"; @@ -58,9 +59,9 @@ class HuiPictureEntityCard extends LitElement implements LovelaceCard { }; } - @property() public hass?: HomeAssistant; + @property({ attribute: false }) public hass?: HomeAssistant; - @property() private _config?: PictureEntityCardConfig; + @internalProperty() private _config?: PictureEntityCardConfig; public getCardSize(): number { return 3; diff --git a/src/panels/lovelace/cards/hui-picture-glance-card.ts b/src/panels/lovelace/cards/hui-picture-glance-card.ts index d298d79c52..45c0ea1516 100644 --- a/src/panels/lovelace/cards/hui-picture-glance-card.ts +++ b/src/panels/lovelace/cards/hui-picture-glance-card.ts @@ -5,6 +5,7 @@ import { html, LitElement, property, + internalProperty, PropertyValues, TemplateResult, } from "lit-element"; @@ -65,9 +66,9 @@ class HuiPictureGlanceCard extends LitElement implements LovelaceCard { }; } - @property() public hass?: HomeAssistant; + @property({ attribute: false }) public hass?: HomeAssistant; - @property() private _config?: PictureGlanceCardConfig; + @internalProperty() private _config?: PictureGlanceCardConfig; private _entitiesDialog?: PictureGlanceEntityConfig[]; diff --git a/src/panels/lovelace/cards/hui-plant-status-card.ts b/src/panels/lovelace/cards/hui-plant-status-card.ts index 95ea0a6209..18ecd2a0ed 100644 --- a/src/panels/lovelace/cards/hui-plant-status-card.ts +++ b/src/panels/lovelace/cards/hui-plant-status-card.ts @@ -6,6 +6,7 @@ import { html, LitElement, property, + internalProperty, PropertyValues, TemplateResult, } from "lit-element"; @@ -57,9 +58,9 @@ class HuiPlantStatusCard extends LitElement implements LovelaceCard { return { type: "plant-status", entity: foundEntities[0] || "" }; } - @property() public hass?: HomeAssistant; + @property({ attribute: false }) public hass?: HomeAssistant; - @property() private _config?: PlantStatusCardConfig; + @internalProperty() private _config?: PlantStatusCardConfig; public getCardSize(): number { return 3; diff --git a/src/panels/lovelace/cards/hui-safe-mode-card.ts b/src/panels/lovelace/cards/hui-safe-mode-card.ts index 133c97e249..ccf58d78ae 100644 --- a/src/panels/lovelace/cards/hui-safe-mode-card.ts +++ b/src/panels/lovelace/cards/hui-safe-mode-card.ts @@ -15,7 +15,7 @@ import { LovelaceCard } from "../types"; @customElement("hui-safe-mode-card") export class HuiSafeModeCard extends LitElement implements LovelaceCard { - @property() public hass?: HomeAssistant; + @property({ attribute: false }) public hass?: HomeAssistant; public getCardSize(): number { return 3; diff --git a/src/panels/lovelace/cards/hui-shopping-list-card.ts b/src/panels/lovelace/cards/hui-shopping-list-card.ts index 85395dfffd..fc1518c945 100644 --- a/src/panels/lovelace/cards/hui-shopping-list-card.ts +++ b/src/panels/lovelace/cards/hui-shopping-list-card.ts @@ -7,6 +7,7 @@ import { html, LitElement, property, + internalProperty, PropertyValues, TemplateResult, } from "lit-element"; @@ -42,13 +43,13 @@ class HuiShoppingListCard extends SubscribeMixin(LitElement) return { type: "shopping-list" }; } - @property() public hass?: HomeAssistant; + @property({ attribute: false }) public hass?: HomeAssistant; - @property() private _config?: ShoppingListCardConfig; + @internalProperty() private _config?: ShoppingListCardConfig; - @property() private _uncheckedItems?: ShoppingListItem[]; + @internalProperty() private _uncheckedItems?: ShoppingListItem[]; - @property() private _checkedItems?: ShoppingListItem[]; + @internalProperty() private _checkedItems?: ShoppingListItem[]; public getCardSize(): number { return (this._config ? (this._config.title ? 1 : 0) : 0) + 3; diff --git a/src/panels/lovelace/cards/hui-stack-card.ts b/src/panels/lovelace/cards/hui-stack-card.ts index 57cb3804d4..0f6d0ebb71 100644 --- a/src/panels/lovelace/cards/hui-stack-card.ts +++ b/src/panels/lovelace/cards/hui-stack-card.ts @@ -4,6 +4,7 @@ import { html, LitElement, property, + internalProperty, PropertyValues, TemplateResult, } from "lit-element"; @@ -25,13 +26,13 @@ export abstract class HuiStackCard extends LitElement implements LovelaceCard { return { cards: [] }; } - @property() public hass?: HomeAssistant; + @property({ attribute: false }) public hass?: HomeAssistant; @property() public editMode?: boolean; @property() protected _cards?: LovelaceCard[]; - @property() private _config?: StackCardConfig; + @internalProperty() private _config?: StackCardConfig; public getCardSize(): number | Promise { return 1; diff --git a/src/panels/lovelace/cards/hui-starting-card.ts b/src/panels/lovelace/cards/hui-starting-card.ts index 2d50bbde62..668cbce764 100644 --- a/src/panels/lovelace/cards/hui-starting-card.ts +++ b/src/panels/lovelace/cards/hui-starting-card.ts @@ -19,7 +19,7 @@ import { STATE_NOT_RUNNING } from "home-assistant-js-websocket"; @customElement("hui-starting-card") export class HuiStartingCard extends LitElement implements LovelaceCard { - @property() public hass?: HomeAssistant; + @property({ attribute: false }) public hass?: HomeAssistant; public getCardSize(): number { return 2; diff --git a/src/panels/lovelace/cards/hui-thermostat-card.ts b/src/panels/lovelace/cards/hui-thermostat-card.ts index 4a2de6b9ac..ea254bd21f 100644 --- a/src/panels/lovelace/cards/hui-thermostat-card.ts +++ b/src/panels/lovelace/cards/hui-thermostat-card.ts @@ -8,6 +8,7 @@ import { html, LitElement, property, + internalProperty, PropertyValues, svg, TemplateResult, @@ -70,11 +71,11 @@ export class HuiThermostatCard extends LitElement implements LovelaceCard { return { type: "thermostat", entity: foundEntities[0] || "" }; } - @property() public hass?: HomeAssistant; + @property({ attribute: false }) public hass?: HomeAssistant; - @property() private _config?: ThermostatCardConfig; + @internalProperty() private _config?: ThermostatCardConfig; - @property() private _setTemp?: number | number[]; + @internalProperty() private _setTemp?: number | number[]; public getCardSize(): number { return 5; diff --git a/src/panels/lovelace/cards/hui-weather-forecast-card.ts b/src/panels/lovelace/cards/hui-weather-forecast-card.ts index f31482d027..0af5d4b979 100644 --- a/src/panels/lovelace/cards/hui-weather-forecast-card.ts +++ b/src/panels/lovelace/cards/hui-weather-forecast-card.ts @@ -5,6 +5,7 @@ import { html, LitElement, property, + internalProperty, PropertyValues, TemplateResult, } from "lit-element"; @@ -62,9 +63,9 @@ class HuiWeatherForecastCard extends LitElement implements LovelaceCard { return { type: "weather-forecast", entity: foundEntities[0] || "" }; } - @property() public hass?: HomeAssistant; + @property({ attribute: false }) public hass?: HomeAssistant; - @property() private _config?: WeatherForecastCardConfig; + @internalProperty() private _config?: WeatherForecastCardConfig; @property({ type: Boolean, reflect: true, attribute: "veryverynarrow" }) private _veryVeryNarrow = false; diff --git a/src/panels/lovelace/components/hui-card-options.ts b/src/panels/lovelace/components/hui-card-options.ts index 0416697a59..595cd12acd 100644 --- a/src/panels/lovelace/components/hui-card-options.ts +++ b/src/panels/lovelace/components/hui-card-options.ts @@ -23,9 +23,9 @@ import { mdiDotsVertical, mdiArrowDown, mdiArrowUp } from "@mdi/js"; @customElement("hui-card-options") export class HuiCardOptions extends LitElement { - @property() public hass?: HomeAssistant; + @property({ attribute: false }) public hass?: HomeAssistant; - @property() public lovelace?: Lovelace; + @property({ attribute: false }) public lovelace?: Lovelace; @property() public path?: [number, number]; diff --git a/src/panels/lovelace/components/hui-conditional-base.ts b/src/panels/lovelace/components/hui-conditional-base.ts index b877b3adfb..867d157def 100644 --- a/src/panels/lovelace/components/hui-conditional-base.ts +++ b/src/panels/lovelace/components/hui-conditional-base.ts @@ -15,7 +15,7 @@ import { LovelaceCard } from "../types"; @customElement("hui-conditional-base") export class HuiConditionalBase extends UpdatingElement { - @property() public hass?: HomeAssistant; + @property({ attribute: false }) public hass?: HomeAssistant; @property() public editMode?: boolean; diff --git a/src/panels/lovelace/components/hui-entities-toggle.ts b/src/panels/lovelace/components/hui-entities-toggle.ts index 757b62856d..35fe8910b5 100644 --- a/src/panels/lovelace/components/hui-entities-toggle.ts +++ b/src/panels/lovelace/components/hui-entities-toggle.ts @@ -5,6 +5,7 @@ import { html, LitElement, property, + internalProperty, PropertyValues, TemplateResult, } from "lit-element"; @@ -21,7 +22,7 @@ class HuiEntitiesToggle extends LitElement { @property() protected hass?: HomeAssistant; - @property() private _toggleEntities?: string[]; + @internalProperty() private _toggleEntities?: string[]; public updated(changedProperties: PropertyValues): void { super.updated(changedProperties); diff --git a/src/panels/lovelace/components/hui-generic-entity-row.ts b/src/panels/lovelace/components/hui-generic-entity-row.ts index ab2a3a8115..5831526e29 100644 --- a/src/panels/lovelace/components/hui-generic-entity-row.ts +++ b/src/panels/lovelace/components/hui-generic-entity-row.ts @@ -26,7 +26,7 @@ import { hasAction } from "../common/has-action"; import { createEntityNotFoundWarning } from "./hui-warning"; class HuiGenericEntityRow extends LitElement { - @property() public hass?: HomeAssistant; + @property({ attribute: false }) public hass?: HomeAssistant; @property() public config?: EntitiesCardEntityConfig; diff --git a/src/panels/lovelace/components/hui-graph-base.ts b/src/panels/lovelace/components/hui-graph-base.ts index 5c88b8f582..b076e02b4d 100644 --- a/src/panels/lovelace/components/hui-graph-base.ts +++ b/src/panels/lovelace/components/hui-graph-base.ts @@ -5,6 +5,7 @@ import { html, LitElement, property, + internalProperty, PropertyValues, svg, TemplateResult, @@ -16,7 +17,7 @@ import { getPath } from "../common/graph/get-path"; export class HuiGraphBase extends LitElement { @property() public coordinates?: any; - @property() private _path?: string; + @internalProperty() private _path?: string; protected render(): TemplateResult { return html` diff --git a/src/panels/lovelace/components/hui-image.ts b/src/panels/lovelace/components/hui-image.ts index cdfc7bfb2f..a2437eda1e 100644 --- a/src/panels/lovelace/components/hui-image.ts +++ b/src/panels/lovelace/components/hui-image.ts @@ -5,6 +5,7 @@ import { html, LitElement, property, + internalProperty, PropertyValues, query, TemplateResult, @@ -26,7 +27,7 @@ export interface StateSpecificConfig { @customElement("hui-image") export class HuiImage extends LitElement { - @property() public hass?: HomeAssistant; + @property({ attribute: false }) public hass?: HomeAssistant; @property() public entity?: string; @@ -44,9 +45,9 @@ export class HuiImage extends LitElement { @property() public stateFilter?: StateSpecificConfig; - @property() private _loadError?: boolean; + @internalProperty() private _loadError?: boolean; - @property() private _cameraImageSrc?: string; + @internalProperty() private _cameraImageSrc?: string; @query("img") private _image!: HTMLImageElement; diff --git a/src/panels/lovelace/components/hui-theme-select-editor.ts b/src/panels/lovelace/components/hui-theme-select-editor.ts index d82289c676..12cbc4fc22 100644 --- a/src/panels/lovelace/components/hui-theme-select-editor.ts +++ b/src/panels/lovelace/components/hui-theme-select-editor.ts @@ -20,7 +20,7 @@ export class HuiThemeSelectEditor extends LitElement { @property() public label?: string; - @property() public hass?: HomeAssistant; + @property({ attribute: false }) public hass?: HomeAssistant; protected render(): TemplateResult { return html` diff --git a/src/panels/lovelace/components/hui-timestamp-display.ts b/src/panels/lovelace/components/hui-timestamp-display.ts index ac753e4405..4aaa8a25eb 100644 --- a/src/panels/lovelace/components/hui-timestamp-display.ts +++ b/src/panels/lovelace/components/hui-timestamp-display.ts @@ -3,6 +3,7 @@ import { html, LitElement, property, + internalProperty, PropertyValues, TemplateResult, } from "lit-element"; @@ -21,7 +22,7 @@ const INTERVAL_FORMAT = ["relative", "total"]; @customElement("hui-timestamp-display") class HuiTimestampDisplay extends LitElement { - @property() public hass?: HomeAssistant; + @property({ attribute: false }) public hass?: HomeAssistant; @property() public ts?: Date; @@ -32,7 +33,7 @@ class HuiTimestampDisplay extends LitElement { | "datetime" | "time"; - @property() private _relative?: string; + @internalProperty() private _relative?: string; private _connected?: boolean; diff --git a/src/panels/lovelace/components/hui-views-list.ts b/src/panels/lovelace/components/hui-views-list.ts index db4e74e1de..6fa320eb41 100644 --- a/src/panels/lovelace/components/hui-views-list.ts +++ b/src/panels/lovelace/components/hui-views-list.ts @@ -6,7 +6,7 @@ import { customElement, html, LitElement, - property, + internalProperty, TemplateResult, } from "lit-element"; import { fireEvent } from "../../../common/dom/fire_event"; @@ -24,9 +24,9 @@ declare global { @customElement("hui-views-list") class HuiViewsList extends LitElement { - @property() private lovelaceConfig?: LovelaceConfig | undefined; + @internalProperty() private lovelaceConfig?: LovelaceConfig | undefined; - @property() private selected?: number | undefined; + @internalProperty() private selected?: number | undefined; protected render(): TemplateResult { if (!this.lovelaceConfig) { diff --git a/src/panels/lovelace/editor/card-editor/hui-card-editor.ts b/src/panels/lovelace/editor/card-editor/hui-card-editor.ts index 74d3d02511..d5cf049076 100644 --- a/src/panels/lovelace/editor/card-editor/hui-card-editor.ts +++ b/src/panels/lovelace/editor/card-editor/hui-card-editor.ts @@ -7,6 +7,7 @@ import { html, LitElement, property, + internalProperty, TemplateResult, query, } from "lit-element"; @@ -50,27 +51,27 @@ export interface UIConfigChangedEvent extends Event { @customElement("hui-card-editor") export class HuiCardEditor extends LitElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; - @property() public lovelace?: LovelaceConfig; + @property({ attribute: false }) public lovelace?: LovelaceConfig; - @property() private _yaml?: string; + @internalProperty() private _yaml?: string; - @property() private _config?: LovelaceCardConfig; + @internalProperty() private _config?: LovelaceCardConfig; - @property() private _configElement?: LovelaceCardEditor; + @internalProperty() private _configElement?: LovelaceCardEditor; - @property() private _configElType?: string; + @internalProperty() private _configElType?: string; - @property() private _GUImode = true; + @internalProperty() private _GUImode = true; // Error: Configuration broken - do not save - @property() private _error?: string; + @internalProperty() private _error?: string; // Warning: GUI editor can't handle configuration - ok to save - @property() private _warning?: string; + @internalProperty() private _warning?: string; - @property() private _loading = false; + @internalProperty() private _loading = false; @query("ha-code-editor") _yamlEditor?: HaCodeEditor; diff --git a/src/panels/lovelace/editor/card-editor/hui-card-picker.ts b/src/panels/lovelace/editor/card-editor/hui-card-picker.ts index e9dab6492d..dce01a77c4 100644 --- a/src/panels/lovelace/editor/card-editor/hui-card-picker.ts +++ b/src/panels/lovelace/editor/card-editor/hui-card-picker.ts @@ -6,6 +6,7 @@ import { html, LitElement, property, + internalProperty, PropertyValues, TemplateResult, } from "lit-element"; @@ -42,23 +43,23 @@ interface CardElement { @customElement("hui-card-picker") export class HuiCardPicker extends LitElement { - @property() public hass?: HomeAssistant; + @property({ attribute: false }) public hass?: HomeAssistant; - @property() private _cards: CardElement[] = []; + @internalProperty() private _cards: CardElement[] = []; public lovelace?: LovelaceConfig; public cardPicked?: (cardConf: LovelaceCardConfig) => void; - @property() private _filter = ""; + @internalProperty() private _filter = ""; private _unusedEntities?: string[]; private _usedEntities?: string[]; - @property() private _width?: number; + @internalProperty() private _width?: number; - @property() private _height?: number; + @internalProperty() private _height?: number; private _filterCards = memoizeOne( (cardElements: CardElement[], filter?: string): CardElement[] => { diff --git a/src/panels/lovelace/editor/card-editor/hui-card-preview.ts b/src/panels/lovelace/editor/card-editor/hui-card-preview.ts index 82599dd271..b91593d643 100644 --- a/src/panels/lovelace/editor/card-editor/hui-card-preview.ts +++ b/src/panels/lovelace/editor/card-editor/hui-card-preview.ts @@ -8,7 +8,7 @@ import { createErrorCardConfig } from "../../create-element/create-element-base" import { property, PropertyValues, UpdatingElement } from "lit-element"; export class HuiCardPreview extends UpdatingElement { - @property() public hass?: HomeAssistant; + @property({ attribute: false }) public hass?: HomeAssistant; @property() public config?: LovelaceCardConfig; diff --git a/src/panels/lovelace/editor/card-editor/hui-dialog-delete-card.ts b/src/panels/lovelace/editor/card-editor/hui-dialog-delete-card.ts index 3d1b64d988..18c8015f3c 100644 --- a/src/panels/lovelace/editor/card-editor/hui-dialog-delete-card.ts +++ b/src/panels/lovelace/editor/card-editor/hui-dialog-delete-card.ts @@ -6,6 +6,7 @@ import { html, LitElement, property, + internalProperty, query, TemplateResult, } from "lit-element"; @@ -22,9 +23,9 @@ import type { DeleteCardDialogParams } from "./show-delete-card-dialog"; export class HuiDialogDeleteCard extends LitElement { @property() protected hass!: HomeAssistant; - @property() private _params?: DeleteCardDialogParams; + @internalProperty() private _params?: DeleteCardDialogParams; - @property() private _cardConfig?: LovelaceCardConfig; + @internalProperty() private _cardConfig?: LovelaceCardConfig; @query("ha-paper-dialog") private _dialog!: HaPaperDialog; diff --git a/src/panels/lovelace/editor/card-editor/hui-dialog-edit-card.ts b/src/panels/lovelace/editor/card-editor/hui-dialog-edit-card.ts index dd718075bf..feac4d8ddc 100755 --- a/src/panels/lovelace/editor/card-editor/hui-dialog-edit-card.ts +++ b/src/panels/lovelace/editor/card-editor/hui-dialog-edit-card.ts @@ -6,6 +6,7 @@ import { html, LitElement, property, + internalProperty, query, TemplateResult, PropertyValues, @@ -45,23 +46,23 @@ declare global { export class HuiDialogEditCard extends LitElement { @property() protected hass!: HomeAssistant; - @property() private _params?: EditCardDialogParams; + @internalProperty() private _params?: EditCardDialogParams; - @property() private _cardConfig?: LovelaceCardConfig; + @internalProperty() private _cardConfig?: LovelaceCardConfig; - @property() private _viewConfig!: LovelaceViewConfig; + @internalProperty() private _viewConfig!: LovelaceViewConfig; - @property() private _saving = false; + @internalProperty() private _saving = false; - @property() private _error?: string; + @internalProperty() private _error?: string; - @property() private _guiModeAvailable? = true; + @internalProperty() private _guiModeAvailable? = true; @query("hui-card-editor") private _cardEditorEl?: HuiCardEditor; - @property() private _GUImode = true; + @internalProperty() private _GUImode = true; - @property() private _documentationURL?: string; + @internalProperty() private _documentationURL?: string; public async showDialog(params: EditCardDialogParams): Promise { this._params = params; diff --git a/src/panels/lovelace/editor/card-editor/hui-dialog-move-card-view.ts b/src/panels/lovelace/editor/card-editor/hui-dialog-move-card-view.ts index c0cfcd9e68..c0e733c531 100644 --- a/src/panels/lovelace/editor/card-editor/hui-dialog-move-card-view.ts +++ b/src/panels/lovelace/editor/card-editor/hui-dialog-move-card-view.ts @@ -5,7 +5,7 @@ import { customElement, html, LitElement, - property, + internalProperty, TemplateResult, } from "lit-element"; import "../../../../components/dialog/ha-paper-dialog"; @@ -17,7 +17,7 @@ import type { MoveCardViewDialogParams } from "./show-move-card-view-dialog"; @customElement("hui-dialog-move-card-view") export class HuiDialogMoveCardView extends LitElement { - @property() private _params?: MoveCardViewDialogParams; + @internalProperty() private _params?: MoveCardViewDialogParams; public async showDialog(params: MoveCardViewDialogParams): Promise { this._params = params; diff --git a/src/panels/lovelace/editor/card-editor/hui-dialog-suggest-card.ts b/src/panels/lovelace/editor/card-editor/hui-dialog-suggest-card.ts index 055e90386a..5664aafda6 100755 --- a/src/panels/lovelace/editor/card-editor/hui-dialog-suggest-card.ts +++ b/src/panels/lovelace/editor/card-editor/hui-dialog-suggest-card.ts @@ -6,6 +6,7 @@ import { html, LitElement, property, + internalProperty, query, TemplateResult, } from "lit-element"; @@ -27,13 +28,13 @@ import { SuggestCardDialogParams } from "./show-suggest-card-dialog"; export class HuiDialogSuggestCard extends LitElement { @property() protected hass!: HomeAssistant; - @property() private _params?: SuggestCardDialogParams; + @internalProperty() private _params?: SuggestCardDialogParams; - @property() private _cardConfig?: LovelaceCardConfig[]; + @internalProperty() private _cardConfig?: LovelaceCardConfig[]; - @property() private _saving = false; + @internalProperty() private _saving = false; - @property() private _yamlMode = false; + @internalProperty() private _yamlMode = false; @query("ha-paper-dialog") private _dialog?: HaPaperDialog; diff --git a/src/panels/lovelace/editor/config-elements/hui-alarm-panel-card-editor.ts b/src/panels/lovelace/editor/config-elements/hui-alarm-panel-card-editor.ts index cc763fa2d8..ac8bc242f3 100644 --- a/src/panels/lovelace/editor/config-elements/hui-alarm-panel-card-editor.ts +++ b/src/panels/lovelace/editor/config-elements/hui-alarm-panel-card-editor.ts @@ -8,6 +8,7 @@ import { html, LitElement, property, + internalProperty, TemplateResult, } from "lit-element"; import { fireEvent } from "../../../../common/dom/fire_event"; @@ -34,9 +35,9 @@ const includeDomains = ["alarm_control_panel"]; @customElement("hui-alarm-panel-card-editor") export class HuiAlarmPanelCardEditor extends LitElement implements LovelaceCardEditor { - @property() public hass?: HomeAssistant; + @property({ attribute: false }) public hass?: HomeAssistant; - @property() private _config?: AlarmPanelCardConfig; + @internalProperty() private _config?: AlarmPanelCardConfig; public setConfig(config: AlarmPanelCardConfig): void { config = cardConfigStruct(config); diff --git a/src/panels/lovelace/editor/config-elements/hui-button-card-editor.ts b/src/panels/lovelace/editor/config-elements/hui-button-card-editor.ts index c76a8ded9c..0e27cedcc3 100644 --- a/src/panels/lovelace/editor/config-elements/hui-button-card-editor.ts +++ b/src/panels/lovelace/editor/config-elements/hui-button-card-editor.ts @@ -4,6 +4,7 @@ import { html, LitElement, property, + internalProperty, TemplateResult, } from "lit-element"; import { fireEvent } from "../../../../common/dom/fire_event"; @@ -44,9 +45,9 @@ const cardConfigStruct = struct({ @customElement("hui-button-card-editor") export class HuiButtonCardEditor extends LitElement implements LovelaceCardEditor { - @property() public hass?: HomeAssistant; + @property({ attribute: false }) public hass?: HomeAssistant; - @property() private _config?: ButtonCardConfig; + @internalProperty() private _config?: ButtonCardConfig; public setConfig(config: ButtonCardConfig): void { config = cardConfigStruct(config); diff --git a/src/panels/lovelace/editor/config-elements/hui-conditional-card-editor.ts b/src/panels/lovelace/editor/config-elements/hui-conditional-card-editor.ts index daf244defb..4957008c07 100644 --- a/src/panels/lovelace/editor/config-elements/hui-conditional-card-editor.ts +++ b/src/panels/lovelace/editor/config-elements/hui-conditional-card-editor.ts @@ -7,6 +7,7 @@ import { html, LitElement, property, + internalProperty, query, TemplateResult, } from "lit-element"; @@ -38,17 +39,17 @@ const cardConfigStruct = struct({ @customElement("hui-conditional-card-editor") export class HuiConditionalCardEditor extends LitElement implements LovelaceCardEditor { - @property() public hass?: HomeAssistant; + @property({ attribute: false }) public hass?: HomeAssistant; - @property() public lovelace?: LovelaceConfig; + @property({ attribute: false }) public lovelace?: LovelaceConfig; - @property() private _config?: ConditionalCardConfig; + @internalProperty() private _config?: ConditionalCardConfig; - @property() private _GUImode = true; + @internalProperty() private _GUImode = true; - @property() private _guiModeAvailable? = true; + @internalProperty() private _guiModeAvailable? = true; - @property() private _cardTab = false; + @internalProperty() private _cardTab = false; @query("hui-card-editor") private _cardEditorEl?: HuiCardEditor; diff --git a/src/panels/lovelace/editor/config-elements/hui-entities-card-editor.ts b/src/panels/lovelace/editor/config-elements/hui-entities-card-editor.ts index 0c4dc796c0..279337710b 100644 --- a/src/panels/lovelace/editor/config-elements/hui-entities-card-editor.ts +++ b/src/panels/lovelace/editor/config-elements/hui-entities-card-editor.ts @@ -6,6 +6,7 @@ import { html, LitElement, property, + internalProperty, TemplateResult, } from "lit-element"; import { fireEvent } from "../../../../common/dom/fire_event"; @@ -46,11 +47,11 @@ const cardConfigStruct = struct({ @customElement("hui-entities-card-editor") export class HuiEntitiesCardEditor extends LitElement implements LovelaceCardEditor { - @property() public hass?: HomeAssistant; + @property({ attribute: false }) public hass?: HomeAssistant; - @property() private _config?: EntitiesCardConfig; + @internalProperty() private _config?: EntitiesCardConfig; - @property() private _configEntities?: EntitiesCardEntityConfig[]; + @internalProperty() private _configEntities?: EntitiesCardEntityConfig[]; public setConfig(config: EntitiesCardConfig): void { config = cardConfigStruct(config); diff --git a/src/panels/lovelace/editor/config-elements/hui-entity-card-editor.ts b/src/panels/lovelace/editor/config-elements/hui-entity-card-editor.ts index 6206f7260a..7e68423aec 100644 --- a/src/panels/lovelace/editor/config-elements/hui-entity-card-editor.ts +++ b/src/panels/lovelace/editor/config-elements/hui-entity-card-editor.ts @@ -4,6 +4,7 @@ import { html, LitElement, property, + internalProperty, TemplateResult, } from "lit-element"; import { fireEvent } from "../../../../common/dom/fire_event"; @@ -34,9 +35,9 @@ const cardConfigStruct = struct({ @customElement("hui-entity-card-editor") export class HuiEntityCardEditor extends LitElement implements LovelaceCardEditor { - @property() public hass?: HomeAssistant; + @property({ attribute: false }) public hass?: HomeAssistant; - @property() private _config?: EntityCardConfig; + @internalProperty() private _config?: EntityCardConfig; public setConfig(config: EntityCardConfig): void { config = cardConfigStruct(config); diff --git a/src/panels/lovelace/editor/config-elements/hui-gauge-card-editor.ts b/src/panels/lovelace/editor/config-elements/hui-gauge-card-editor.ts index bdaa4e0699..4fbb33c88e 100644 --- a/src/panels/lovelace/editor/config-elements/hui-gauge-card-editor.ts +++ b/src/panels/lovelace/editor/config-elements/hui-gauge-card-editor.ts @@ -6,6 +6,7 @@ import { html, LitElement, property, + internalProperty, TemplateResult, } from "lit-element"; import { fireEvent } from "../../../../common/dom/fire_event"; @@ -37,9 +38,9 @@ const includeDomains = ["sensor"]; @customElement("hui-gauge-card-editor") export class HuiGaugeCardEditor extends LitElement implements LovelaceCardEditor { - @property() public hass?: HomeAssistant; + @property({ attribute: false }) public hass?: HomeAssistant; - @property() private _config?: GaugeCardConfig; + @internalProperty() private _config?: GaugeCardConfig; public setConfig(config: GaugeCardConfig): void { config = cardConfigStruct(config); diff --git a/src/panels/lovelace/editor/config-elements/hui-glance-card-editor.ts b/src/panels/lovelace/editor/config-elements/hui-glance-card-editor.ts index 8baa9e8cc4..e7688714f1 100644 --- a/src/panels/lovelace/editor/config-elements/hui-glance-card-editor.ts +++ b/src/panels/lovelace/editor/config-elements/hui-glance-card-editor.ts @@ -6,6 +6,7 @@ import { html, LitElement, property, + internalProperty, TemplateResult, } from "lit-element"; import { fireEvent } from "../../../../common/dom/fire_event"; @@ -43,11 +44,11 @@ const cardConfigStruct = struct({ @customElement("hui-glance-card-editor") export class HuiGlanceCardEditor extends LitElement implements LovelaceCardEditor { - @property() public hass?: HomeAssistant; + @property({ attribute: false }) public hass?: HomeAssistant; - @property() private _config?: GlanceCardConfig; + @internalProperty() private _config?: GlanceCardConfig; - @property() private _configEntities?: ConfigEntity[]; + @internalProperty() private _configEntities?: ConfigEntity[]; public setConfig(config: GlanceCardConfig): void { config = cardConfigStruct(config); diff --git a/src/panels/lovelace/editor/config-elements/hui-history-graph-card-editor.ts b/src/panels/lovelace/editor/config-elements/hui-history-graph-card-editor.ts index 916e8db9ce..6774dd3ef2 100644 --- a/src/panels/lovelace/editor/config-elements/hui-history-graph-card-editor.ts +++ b/src/panels/lovelace/editor/config-elements/hui-history-graph-card-editor.ts @@ -4,6 +4,7 @@ import { html, LitElement, property, + internalProperty, TemplateResult, } from "lit-element"; import { fireEvent } from "../../../../common/dom/fire_event"; @@ -36,11 +37,11 @@ const cardConfigStruct = struct({ @customElement("hui-history-graph-card-editor") export class HuiHistoryGraphCardEditor extends LitElement implements LovelaceCardEditor { - @property() public hass?: HomeAssistant; + @property({ attribute: false }) public hass?: HomeAssistant; - @property() private _config?: HistoryGraphCardConfig; + @internalProperty() private _config?: HistoryGraphCardConfig; - @property() private _configEntities?: EntityConfig[]; + @internalProperty() private _configEntities?: EntityConfig[]; public setConfig(config: HistoryGraphCardConfig): void { config = cardConfigStruct(config); diff --git a/src/panels/lovelace/editor/config-elements/hui-humidifier-card-editor.ts b/src/panels/lovelace/editor/config-elements/hui-humidifier-card-editor.ts index b293953407..4f016f1ead 100644 --- a/src/panels/lovelace/editor/config-elements/hui-humidifier-card-editor.ts +++ b/src/panels/lovelace/editor/config-elements/hui-humidifier-card-editor.ts @@ -4,6 +4,7 @@ import { html, LitElement, property, + internalProperty, TemplateResult, } from "lit-element"; import { fireEvent } from "../../../../common/dom/fire_event"; @@ -28,9 +29,9 @@ const includeDomains = ["humidifier"]; @customElement("hui-humidifier-card-editor") export class HuiHumidifierCardEditor extends LitElement implements LovelaceCardEditor { - @property() public hass?: HomeAssistant; + @property({ attribute: false }) public hass?: HomeAssistant; - @property() private _config?: HumidifierCardConfig; + @internalProperty() private _config?: HumidifierCardConfig; public setConfig(config: HumidifierCardConfig): void { config = cardConfigStruct(config); diff --git a/src/panels/lovelace/editor/config-elements/hui-iframe-card-editor.ts b/src/panels/lovelace/editor/config-elements/hui-iframe-card-editor.ts index cba612b982..fdda725d1c 100644 --- a/src/panels/lovelace/editor/config-elements/hui-iframe-card-editor.ts +++ b/src/panels/lovelace/editor/config-elements/hui-iframe-card-editor.ts @@ -4,6 +4,7 @@ import { html, LitElement, property, + internalProperty, TemplateResult, } from "lit-element"; import { fireEvent } from "../../../../common/dom/fire_event"; @@ -24,9 +25,9 @@ const cardConfigStruct = struct({ @customElement("hui-iframe-card-editor") export class HuiIframeCardEditor extends LitElement implements LovelaceCardEditor { - @property() public hass?: HomeAssistant; + @property({ attribute: false }) public hass?: HomeAssistant; - @property() private _config?: IframeCardConfig; + @internalProperty() private _config?: IframeCardConfig; public setConfig(config: IframeCardConfig): void { config = cardConfigStruct(config); diff --git a/src/panels/lovelace/editor/config-elements/hui-light-card-editor.ts b/src/panels/lovelace/editor/config-elements/hui-light-card-editor.ts index d91f43acfa..3e511e9be5 100644 --- a/src/panels/lovelace/editor/config-elements/hui-light-card-editor.ts +++ b/src/panels/lovelace/editor/config-elements/hui-light-card-editor.ts @@ -4,6 +4,7 @@ import { html, LitElement, property, + internalProperty, TemplateResult, } from "lit-element"; import { fireEvent } from "../../../../common/dom/fire_event"; @@ -39,9 +40,9 @@ const includeDomains = ["light"]; @customElement("hui-light-card-editor") export class HuiLightCardEditor extends LitElement implements LovelaceCardEditor { - @property() public hass?: HomeAssistant; + @property({ attribute: false }) public hass?: HomeAssistant; - @property() private _config?: LightCardConfig; + @internalProperty() private _config?: LightCardConfig; public setConfig(config: LightCardConfig): void { this._config = cardConfigStruct(config); diff --git a/src/panels/lovelace/editor/config-elements/hui-map-card-editor.ts b/src/panels/lovelace/editor/config-elements/hui-map-card-editor.ts index 323c6c8d3b..6f3788cfad 100644 --- a/src/panels/lovelace/editor/config-elements/hui-map-card-editor.ts +++ b/src/panels/lovelace/editor/config-elements/hui-map-card-editor.ts @@ -6,6 +6,7 @@ import { html, LitElement, property, + internalProperty, TemplateResult, } from "lit-element"; import { fireEvent } from "../../../../common/dom/fire_event"; @@ -41,11 +42,11 @@ const cardConfigStruct = struct({ @customElement("hui-map-card-editor") export class HuiMapCardEditor extends LitElement implements LovelaceCardEditor { - @property() public hass?: HomeAssistant; + @property({ attribute: false }) public hass?: HomeAssistant; - @property() private _config?: MapCardConfig; + @internalProperty() private _config?: MapCardConfig; - @property() private _configEntities?: EntityConfig[]; + @internalProperty() private _configEntities?: EntityConfig[]; public setConfig(config: MapCardConfig): void { config = cardConfigStruct(config); diff --git a/src/panels/lovelace/editor/config-elements/hui-markdown-card-editor.ts b/src/panels/lovelace/editor/config-elements/hui-markdown-card-editor.ts index b98e9076c5..250cd4583f 100644 --- a/src/panels/lovelace/editor/config-elements/hui-markdown-card-editor.ts +++ b/src/panels/lovelace/editor/config-elements/hui-markdown-card-editor.ts @@ -5,6 +5,7 @@ import { html, LitElement, property, + internalProperty, TemplateResult, } from "lit-element"; import { fireEvent } from "../../../../common/dom/fire_event"; @@ -26,9 +27,9 @@ const cardConfigStruct = struct({ @customElement("hui-markdown-card-editor") export class HuiMarkdownCardEditor extends LitElement implements LovelaceCardEditor { - @property() public hass?: HomeAssistant; + @property({ attribute: false }) public hass?: HomeAssistant; - @property() private _config?: MarkdownCardConfig; + @internalProperty() private _config?: MarkdownCardConfig; public setConfig(config: MarkdownCardConfig): void { config = cardConfigStruct(config); diff --git a/src/panels/lovelace/editor/config-elements/hui-media-control-card-editor.ts b/src/panels/lovelace/editor/config-elements/hui-media-control-card-editor.ts index 6169664dda..4b80b6d36c 100644 --- a/src/panels/lovelace/editor/config-elements/hui-media-control-card-editor.ts +++ b/src/panels/lovelace/editor/config-elements/hui-media-control-card-editor.ts @@ -3,6 +3,7 @@ import { html, LitElement, property, + internalProperty, TemplateResult, } from "lit-element"; import { fireEvent } from "../../../../common/dom/fire_event"; @@ -23,9 +24,9 @@ const includeDomains = ["media_player"]; @customElement("hui-media-control-card-editor") export class HuiMediaControlCardEditor extends LitElement implements LovelaceCardEditor { - @property() public hass?: HomeAssistant; + @property({ attribute: false }) public hass?: HomeAssistant; - @property() private _config?: MediaControlCardConfig; + @internalProperty() private _config?: MediaControlCardConfig; public setConfig(config: MediaControlCardConfig): void { config = cardConfigStruct(config); diff --git a/src/panels/lovelace/editor/config-elements/hui-picture-card-editor.ts b/src/panels/lovelace/editor/config-elements/hui-picture-card-editor.ts index 8828484b30..914fa0a9e4 100644 --- a/src/panels/lovelace/editor/config-elements/hui-picture-card-editor.ts +++ b/src/panels/lovelace/editor/config-elements/hui-picture-card-editor.ts @@ -4,6 +4,7 @@ import { html, LitElement, property, + internalProperty, TemplateResult, } from "lit-element"; import { fireEvent } from "../../../../common/dom/fire_event"; @@ -32,9 +33,9 @@ const cardConfigStruct = struct({ @customElement("hui-picture-card-editor") export class HuiPictureCardEditor extends LitElement implements LovelaceCardEditor { - @property() public hass?: HomeAssistant; + @property({ attribute: false }) public hass?: HomeAssistant; - @property() private _config?: PictureCardConfig; + @internalProperty() private _config?: PictureCardConfig; public setConfig(config: PictureCardConfig): void { config = cardConfigStruct(config); diff --git a/src/panels/lovelace/editor/config-elements/hui-picture-entity-card-editor.ts b/src/panels/lovelace/editor/config-elements/hui-picture-entity-card-editor.ts index fc592e5863..52d23ef79a 100644 --- a/src/panels/lovelace/editor/config-elements/hui-picture-entity-card-editor.ts +++ b/src/panels/lovelace/editor/config-elements/hui-picture-entity-card-editor.ts @@ -7,6 +7,7 @@ import { html, LitElement, property, + internalProperty, TemplateResult, } from "lit-element"; import { fireEvent } from "../../../../common/dom/fire_event"; @@ -48,9 +49,9 @@ const includeDomains = ["camera"]; @customElement("hui-picture-entity-card-editor") export class HuiPictureEntityCardEditor extends LitElement implements LovelaceCardEditor { - @property() public hass?: HomeAssistant; + @property({ attribute: false }) public hass?: HomeAssistant; - @property() private _config?: PictureEntityCardConfig; + @internalProperty() private _config?: PictureEntityCardConfig; public setConfig(config: PictureEntityCardConfig): void { config = cardConfigStruct(config); diff --git a/src/panels/lovelace/editor/config-elements/hui-picture-glance-card-editor.ts b/src/panels/lovelace/editor/config-elements/hui-picture-glance-card-editor.ts index 1dfc60265d..f569ed7c8b 100644 --- a/src/panels/lovelace/editor/config-elements/hui-picture-glance-card-editor.ts +++ b/src/panels/lovelace/editor/config-elements/hui-picture-glance-card-editor.ts @@ -7,6 +7,7 @@ import { html, LitElement, property, + internalProperty, TemplateResult, } from "lit-element"; import { fireEvent } from "../../../../common/dom/fire_event"; @@ -48,11 +49,11 @@ const includeDomains = ["camera"]; @customElement("hui-picture-glance-card-editor") export class HuiPictureGlanceCardEditor extends LitElement implements LovelaceCardEditor { - @property() public hass?: HomeAssistant; + @property({ attribute: false }) public hass?: HomeAssistant; - @property() private _config?: PictureGlanceCardConfig; + @internalProperty() private _config?: PictureGlanceCardConfig; - @property() private _configEntities?: EntityConfig[]; + @internalProperty() private _configEntities?: EntityConfig[]; public setConfig(config: PictureGlanceCardConfig): void { config = cardConfigStruct(config); diff --git a/src/panels/lovelace/editor/config-elements/hui-plant-status-card-editor.ts b/src/panels/lovelace/editor/config-elements/hui-plant-status-card-editor.ts index 8a274250c5..bbb6fa187d 100644 --- a/src/panels/lovelace/editor/config-elements/hui-plant-status-card-editor.ts +++ b/src/panels/lovelace/editor/config-elements/hui-plant-status-card-editor.ts @@ -4,6 +4,7 @@ import { html, LitElement, property, + internalProperty, TemplateResult, } from "lit-element"; import { fireEvent } from "../../../../common/dom/fire_event"; @@ -29,9 +30,9 @@ const includeDomains = ["plant"]; @customElement("hui-plant-status-card-editor") export class HuiPlantStatusCardEditor extends LitElement implements LovelaceCardEditor { - @property() public hass?: HomeAssistant; + @property({ attribute: false }) public hass?: HomeAssistant; - @property() private _config?: PlantStatusCardConfig; + @internalProperty() private _config?: PlantStatusCardConfig; public setConfig(config: PlantStatusCardConfig): void { config = cardConfigStruct(config); diff --git a/src/panels/lovelace/editor/config-elements/hui-sensor-card-editor.ts b/src/panels/lovelace/editor/config-elements/hui-sensor-card-editor.ts index 458e877e78..2fd1614bdc 100644 --- a/src/panels/lovelace/editor/config-elements/hui-sensor-card-editor.ts +++ b/src/panels/lovelace/editor/config-elements/hui-sensor-card-editor.ts @@ -7,6 +7,7 @@ import { html, LitElement, property, + internalProperty, TemplateResult, } from "lit-element"; import { fireEvent } from "../../../../common/dom/fire_event"; @@ -38,9 +39,9 @@ const includeDomains = ["sensor"]; @customElement("hui-sensor-card-editor") export class HuiSensorCardEditor extends LitElement implements LovelaceCardEditor { - @property() public hass?: HomeAssistant; + @property({ attribute: false }) public hass?: HomeAssistant; - @property() private _config?: SensorCardConfig; + @internalProperty() private _config?: SensorCardConfig; public setConfig(config: SensorCardConfig): void { config = cardConfigStruct(config); diff --git a/src/panels/lovelace/editor/config-elements/hui-shopping-list-editor.ts b/src/panels/lovelace/editor/config-elements/hui-shopping-list-editor.ts index 830b47182c..ac28efea07 100644 --- a/src/panels/lovelace/editor/config-elements/hui-shopping-list-editor.ts +++ b/src/panels/lovelace/editor/config-elements/hui-shopping-list-editor.ts @@ -6,6 +6,7 @@ import { html, LitElement, property, + internalProperty, TemplateResult, } from "lit-element"; import { isComponentLoaded } from "../../../../common/config/is_component_loaded"; @@ -26,9 +27,9 @@ const cardConfigStruct = struct({ @customElement("hui-shopping-list-card-editor") export class HuiShoppingListEditor extends LitElement implements LovelaceCardEditor { - @property() public hass?: HomeAssistant; + @property({ attribute: false }) public hass?: HomeAssistant; - @property() private _config?: ShoppingListCardConfig; + @internalProperty() private _config?: ShoppingListCardConfig; public setConfig(config: ShoppingListCardConfig): void { config = cardConfigStruct(config); diff --git a/src/panels/lovelace/editor/config-elements/hui-stack-card-editor.ts b/src/panels/lovelace/editor/config-elements/hui-stack-card-editor.ts index 33c0cfbeb3..3f748c1a80 100644 --- a/src/panels/lovelace/editor/config-elements/hui-stack-card-editor.ts +++ b/src/panels/lovelace/editor/config-elements/hui-stack-card-editor.ts @@ -8,6 +8,7 @@ import { html, LitElement, property, + internalProperty, query, TemplateResult, } from "lit-element"; @@ -33,17 +34,17 @@ const cardConfigStruct = struct({ @customElement("hui-stack-card-editor") export class HuiStackCardEditor extends LitElement implements LovelaceCardEditor { - @property() public hass?: HomeAssistant; + @property({ attribute: false }) public hass?: HomeAssistant; - @property() public lovelace?: LovelaceConfig; + @property({ attribute: false }) public lovelace?: LovelaceConfig; - @property() private _config?: StackCardConfig; + @internalProperty() private _config?: StackCardConfig; - @property() private _selectedCard = 0; + @internalProperty() private _selectedCard = 0; - @property() private _GUImode = true; + @internalProperty() private _GUImode = true; - @property() private _guiModeAvailable? = true; + @internalProperty() private _guiModeAvailable? = true; @query("hui-card-editor") private _cardEditorEl?: HuiCardEditor; diff --git a/src/panels/lovelace/editor/config-elements/hui-thermostat-card-editor.ts b/src/panels/lovelace/editor/config-elements/hui-thermostat-card-editor.ts index 0ce99f1323..fadb869a02 100644 --- a/src/panels/lovelace/editor/config-elements/hui-thermostat-card-editor.ts +++ b/src/panels/lovelace/editor/config-elements/hui-thermostat-card-editor.ts @@ -4,6 +4,7 @@ import { html, LitElement, property, + internalProperty, TemplateResult, } from "lit-element"; import { fireEvent } from "../../../../common/dom/fire_event"; @@ -28,9 +29,9 @@ const includeDomains = ["climate"]; @customElement("hui-thermostat-card-editor") export class HuiThermostatCardEditor extends LitElement implements LovelaceCardEditor { - @property() public hass?: HomeAssistant; + @property({ attribute: false }) public hass?: HomeAssistant; - @property() private _config?: ThermostatCardConfig; + @internalProperty() private _config?: ThermostatCardConfig; public setConfig(config: ThermostatCardConfig): void { config = cardConfigStruct(config); diff --git a/src/panels/lovelace/editor/config-elements/hui-weather-forecast-card-editor.ts b/src/panels/lovelace/editor/config-elements/hui-weather-forecast-card-editor.ts index cb589aad3d..cca45d1ed6 100644 --- a/src/panels/lovelace/editor/config-elements/hui-weather-forecast-card-editor.ts +++ b/src/panels/lovelace/editor/config-elements/hui-weather-forecast-card-editor.ts @@ -3,6 +3,7 @@ import { html, LitElement, property, + internalProperty, TemplateResult, } from "lit-element"; import { fireEvent } from "../../../../common/dom/fire_event"; @@ -32,9 +33,9 @@ const includeDomains = ["weather"]; @customElement("hui-weather-forecast-card-editor") export class HuiWeatherForecastCardEditor extends LitElement implements LovelaceCardEditor { - @property() public hass?: HomeAssistant; + @property({ attribute: false }) public hass?: HomeAssistant; - @property() private _config?: WeatherForecastCardConfig; + @internalProperty() private _config?: WeatherForecastCardConfig; public setConfig(config: WeatherForecastCardConfig): void { config = cardConfigStruct(config); diff --git a/src/panels/lovelace/editor/hui-dialog-save-config.ts b/src/panels/lovelace/editor/hui-dialog-save-config.ts index 10a52e52fb..83c46f3593 100644 --- a/src/panels/lovelace/editor/hui-dialog-save-config.ts +++ b/src/panels/lovelace/editor/hui-dialog-save-config.ts @@ -8,6 +8,7 @@ import { html, LitElement, property, + internalProperty, query, TemplateResult, } from "lit-element"; @@ -27,13 +28,13 @@ const EMPTY_CONFIG = { views: [] }; @customElement("hui-dialog-save-config") export class HuiSaveConfig extends LitElement { - @property() public hass?: HomeAssistant; + @property({ attribute: false }) public hass?: HomeAssistant; - @property() private _params?: SaveDialogParams; + @internalProperty() private _params?: SaveDialogParams; - @property() private _emptyConfig = false; + @internalProperty() private _emptyConfig = false; - @property() private _saving: boolean; + @internalProperty() private _saving: boolean; @query("ha-paper-dialog") private _dialog?: HaPaperDialog; diff --git a/src/panels/lovelace/editor/lovelace-editor/hui-dialog-edit-lovelace.ts b/src/panels/lovelace/editor/lovelace-editor/hui-dialog-edit-lovelace.ts index 21ebb28342..5ff5cf67e2 100644 --- a/src/panels/lovelace/editor/lovelace-editor/hui-dialog-edit-lovelace.ts +++ b/src/panels/lovelace/editor/lovelace-editor/hui-dialog-edit-lovelace.ts @@ -7,6 +7,7 @@ import { html, LitElement, property, + internalProperty, TemplateResult, } from "lit-element"; import "../../../../components/dialog/ha-paper-dialog"; @@ -20,9 +21,9 @@ import "./hui-lovelace-editor"; @customElement("hui-dialog-edit-lovelace") export class HuiDialogEditLovelace extends LitElement { - @property() public hass?: HomeAssistant; + @property({ attribute: false }) public hass?: HomeAssistant; - @property() private _lovelace?: Lovelace; + @internalProperty() private _lovelace?: Lovelace; private _config?: LovelaceConfig; diff --git a/src/panels/lovelace/editor/lovelace-editor/hui-lovelace-editor.ts b/src/panels/lovelace/editor/lovelace-editor/hui-lovelace-editor.ts index 1e78a531ec..0d806692a3 100644 --- a/src/panels/lovelace/editor/lovelace-editor/hui-lovelace-editor.ts +++ b/src/panels/lovelace/editor/lovelace-editor/hui-lovelace-editor.ts @@ -22,7 +22,7 @@ declare global { @customElement("hui-lovelace-editor") export class HuiLovelaceEditor extends LitElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; @property() public config?: LovelaceConfig; diff --git a/src/panels/lovelace/editor/select-view/hui-dialog-select-view.ts b/src/panels/lovelace/editor/select-view/hui-dialog-select-view.ts index a9b90a0d2b..b398002490 100644 --- a/src/panels/lovelace/editor/select-view/hui-dialog-select-view.ts +++ b/src/panels/lovelace/editor/select-view/hui-dialog-select-view.ts @@ -2,7 +2,7 @@ import { customElement, html, LitElement, - property, + internalProperty, TemplateResult, } from "lit-element"; import { toggleAttribute } from "../../../../common/dom/toggle_attribute"; @@ -14,7 +14,7 @@ import type { SelectViewDialogParams } from "./show-select-view-dialog"; @customElement("hui-dialog-select-view") export class HuiDialogSelectView extends LitElement { - @property() private _params?: SelectViewDialogParams; + @internalProperty() private _params?: SelectViewDialogParams; public async showDialog(params: SelectViewDialogParams): Promise { this._params = params; diff --git a/src/panels/lovelace/editor/unused-entities/hui-unused-entities.ts b/src/panels/lovelace/editor/unused-entities/hui-unused-entities.ts index e7b58f3342..28f114ae97 100644 --- a/src/panels/lovelace/editor/unused-entities/hui-unused-entities.ts +++ b/src/panels/lovelace/editor/unused-entities/hui-unused-entities.ts @@ -6,6 +6,7 @@ import { html, LitElement, property, + internalProperty, PropertyValues, TemplateResult, } from "lit-element"; @@ -36,15 +37,15 @@ import { mdiPlus } from "@mdi/js"; @customElement("hui-unused-entities") export class HuiUnusedEntities extends LitElement { - @property() public lovelace?: Lovelace; + @property({ attribute: false }) public lovelace?: Lovelace; - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; @property() public narrow?: boolean; - @property() private _unusedEntities: string[] = []; + @internalProperty() private _unusedEntities: string[] = []; - @property() private _selectedEntities: string[] = []; + @internalProperty() private _selectedEntities: string[] = []; private get _config(): LovelaceConfig { return this.lovelace!.config; diff --git a/src/panels/lovelace/editor/view-editor/hui-dialog-edit-view.ts b/src/panels/lovelace/editor/view-editor/hui-dialog-edit-view.ts index 2029584f8f..325af14287 100644 --- a/src/panels/lovelace/editor/view-editor/hui-dialog-edit-view.ts +++ b/src/panels/lovelace/editor/view-editor/hui-dialog-edit-view.ts @@ -10,6 +10,7 @@ import { html, LitElement, property, + internalProperty, TemplateResult, } from "lit-element"; import { fireEvent, HASSDomEvent } from "../../../../common/dom/fire_event"; @@ -43,19 +44,19 @@ import { EditViewDialogParams } from "./show-edit-view-dialog"; @customElement("hui-dialog-edit-view") export class HuiDialogEditView extends LitElement { - @property() public hass?: HomeAssistant; + @property({ attribute: false }) public hass?: HomeAssistant; - @property() private _params?: EditViewDialogParams; + @internalProperty() private _params?: EditViewDialogParams; - @property() private _config?: LovelaceViewConfig; + @internalProperty() private _config?: LovelaceViewConfig; - @property() private _badges?: LovelaceBadgeConfig[]; + @internalProperty() private _badges?: LovelaceBadgeConfig[]; - @property() private _cards?: LovelaceCardConfig[]; + @internalProperty() private _cards?: LovelaceCardConfig[]; - @property() private _saving = false; + @internalProperty() private _saving = false; - @property() private _curTab?: string; + @internalProperty() private _curTab?: string; private _curTabIndex = 0; diff --git a/src/panels/lovelace/editor/view-editor/hui-view-editor.ts b/src/panels/lovelace/editor/view-editor/hui-view-editor.ts index 4bcceddb4a..5be3a4a4f8 100644 --- a/src/panels/lovelace/editor/view-editor/hui-view-editor.ts +++ b/src/panels/lovelace/editor/view-editor/hui-view-editor.ts @@ -6,6 +6,7 @@ import { html, LitElement, property, + internalProperty, TemplateResult, } from "lit-element"; import { fireEvent } from "../../../../common/dom/fire_event"; @@ -30,11 +31,11 @@ declare global { @customElement("hui-view-editor") export class HuiViewEditor extends LitElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; @property() public isNew!: boolean; - @property() private _config!: LovelaceViewConfig; + @internalProperty() private _config!: LovelaceViewConfig; private _suggestedPath = false; diff --git a/src/panels/lovelace/editor/view-editor/hui-view-visibility-editor.ts b/src/panels/lovelace/editor/view-editor/hui-view-visibility-editor.ts index 361a28ba73..8bb8f62f07 100644 --- a/src/panels/lovelace/editor/view-editor/hui-view-visibility-editor.ts +++ b/src/panels/lovelace/editor/view-editor/hui-view-visibility-editor.ts @@ -7,6 +7,7 @@ import { html, LitElement, property, + internalProperty, PropertyValues, TemplateResult, } from "lit-element"; @@ -34,13 +35,13 @@ export class HuiViewVisibilityEditor extends LitElement { this._config.visible === undefined ? true : this._config.visible; } - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; @property() public _config!: LovelaceViewConfig; - @property() private _users!: User[]; + @internalProperty() private _users!: User[]; - @property() private _visible!: boolean | ShowViewConfig[]; + @internalProperty() private _visible!: boolean | ShowViewConfig[]; private _sortedUsers = memoizeOne((users: User[]) => { return users.sort((a, b) => compare(a.name, b.name)); diff --git a/src/panels/lovelace/elements/hui-icon-element.ts b/src/panels/lovelace/elements/hui-icon-element.ts index 5acfffce73..82e7a7fc39 100644 --- a/src/panels/lovelace/elements/hui-icon-element.ts +++ b/src/panels/lovelace/elements/hui-icon-element.ts @@ -4,7 +4,7 @@ import { customElement, html, LitElement, - property, + internalProperty, TemplateResult, } from "lit-element"; import { ifDefined } from "lit-html/directives/if-defined"; @@ -21,7 +21,7 @@ import { IconElementConfig, LovelaceElement } from "./types"; export class HuiIconElement extends LitElement implements LovelaceElement { public hass?: HomeAssistant; - @property() private _config?: IconElementConfig; + @internalProperty() private _config?: IconElementConfig; public setConfig(config: IconElementConfig): void { if (!config.icon) { diff --git a/src/panels/lovelace/elements/hui-image-element.ts b/src/panels/lovelace/elements/hui-image-element.ts index 9192007704..a42c7bab8f 100644 --- a/src/panels/lovelace/elements/hui-image-element.ts +++ b/src/panels/lovelace/elements/hui-image-element.ts @@ -5,6 +5,7 @@ import { html, LitElement, property, + internalProperty, TemplateResult, } from "lit-element"; import { ifDefined } from "lit-html/directives/if-defined"; @@ -19,9 +20,9 @@ import { ImageElementConfig, LovelaceElement } from "./types"; @customElement("hui-image-element") export class HuiImageElement extends LitElement implements LovelaceElement { - @property() public hass?: HomeAssistant; + @property({ attribute: false }) public hass?: HomeAssistant; - @property() private _config?: ImageElementConfig; + @internalProperty() private _config?: ImageElementConfig; public setConfig(config: ImageElementConfig): void { if (!config) { diff --git a/src/panels/lovelace/elements/hui-service-button-element.ts b/src/panels/lovelace/elements/hui-service-button-element.ts index b6acdcb407..08f0988818 100644 --- a/src/panels/lovelace/elements/hui-service-button-element.ts +++ b/src/panels/lovelace/elements/hui-service-button-element.ts @@ -4,7 +4,7 @@ import { customElement, html, LitElement, - property, + internalProperty, TemplateResult, } from "lit-element"; import "../../../components/buttons/ha-call-service-button"; @@ -16,7 +16,7 @@ export class HuiServiceButtonElement extends LitElement implements LovelaceElement { public hass?: HomeAssistant; - @property() private _config?: ServiceButtonElementConfig; + @internalProperty() private _config?: ServiceButtonElementConfig; private _domain?: string; diff --git a/src/panels/lovelace/elements/hui-state-badge-element.ts b/src/panels/lovelace/elements/hui-state-badge-element.ts index 221d9f2249..2a008921fa 100644 --- a/src/panels/lovelace/elements/hui-state-badge-element.ts +++ b/src/panels/lovelace/elements/hui-state-badge-element.ts @@ -3,6 +3,7 @@ import { html, LitElement, property, + internalProperty, PropertyValues, TemplateResult, } from "lit-element"; @@ -22,9 +23,9 @@ import { createEntityNotFoundWarning } from "../components/hui-warning"; @customElement("hui-state-badge-element") export class HuiStateBadgeElement extends LitElement implements LovelaceElement { - @property() public hass?: HomeAssistant; + @property({ attribute: false }) public hass?: HomeAssistant; - @property() private _config?: StateBadgeElementConfig; + @internalProperty() private _config?: StateBadgeElementConfig; public setConfig(config: StateBadgeElementConfig): void { if (!config.entity) { diff --git a/src/panels/lovelace/elements/hui-state-icon-element.ts b/src/panels/lovelace/elements/hui-state-icon-element.ts index 9d24fbeda2..d4a1a2eba1 100644 --- a/src/panels/lovelace/elements/hui-state-icon-element.ts +++ b/src/panels/lovelace/elements/hui-state-icon-element.ts @@ -5,6 +5,7 @@ import { html, LitElement, property, + internalProperty, PropertyValues, TemplateResult, } from "lit-element"; @@ -23,9 +24,9 @@ import { createEntityNotFoundWarning } from "../components/hui-warning"; @customElement("hui-state-icon-element") export class HuiStateIconElement extends LitElement implements LovelaceElement { - @property() public hass?: HomeAssistant; + @property({ attribute: false }) public hass?: HomeAssistant; - @property() private _config?: StateIconElementConfig; + @internalProperty() private _config?: StateIconElementConfig; public setConfig(config: StateIconElementConfig): void { if (!config.entity) { diff --git a/src/panels/lovelace/elements/hui-state-label-element.ts b/src/panels/lovelace/elements/hui-state-label-element.ts index 32132dcf99..08de7d4516 100644 --- a/src/panels/lovelace/elements/hui-state-label-element.ts +++ b/src/panels/lovelace/elements/hui-state-label-element.ts @@ -5,6 +5,7 @@ import { html, LitElement, property, + internalProperty, PropertyValues, TemplateResult, } from "lit-element"; @@ -23,9 +24,9 @@ import { createEntityNotFoundWarning } from "../components/hui-warning"; @customElement("hui-state-label-element") class HuiStateLabelElement extends LitElement implements LovelaceElement { - @property() public hass?: HomeAssistant; + @property({ attribute: false }) public hass?: HomeAssistant; - @property() private _config?: StateLabelElementConfig; + @internalProperty() private _config?: StateLabelElementConfig; public setConfig(config: StateLabelElementConfig): void { if (!config.entity) { 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 2343b2cc51..a229fa71f6 100644 --- a/src/panels/lovelace/entity-rows/hui-climate-entity-row.ts +++ b/src/panels/lovelace/entity-rows/hui-climate-entity-row.ts @@ -5,6 +5,7 @@ import { html, LitElement, property, + internalProperty, PropertyValues, TemplateResult, } from "lit-element"; @@ -17,9 +18,9 @@ import { EntityConfig, LovelaceRow } from "./types"; @customElement("hui-climate-entity-row") class HuiClimateEntityRow extends LitElement implements LovelaceRow { - @property() public hass?: HomeAssistant; + @property({ attribute: false }) public hass?: HomeAssistant; - @property() private _config?: EntityConfig; + @internalProperty() private _config?: EntityConfig; public setConfig(config: EntityConfig): void { if (!config || !config.entity) { 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 d257601360..da8530541e 100644 --- a/src/panels/lovelace/entity-rows/hui-cover-entity-row.ts +++ b/src/panels/lovelace/entity-rows/hui-cover-entity-row.ts @@ -5,6 +5,7 @@ import { html, LitElement, property, + internalProperty, PropertyValues, TemplateResult, } from "lit-element"; @@ -19,9 +20,9 @@ import { EntityConfig, LovelaceRow } from "./types"; @customElement("hui-cover-entity-row") class HuiCoverEntityRow extends LitElement implements LovelaceRow { - @property() public hass?: HomeAssistant; + @property({ attribute: false }) public hass?: HomeAssistant; - @property() private _config?: EntityConfig; + @internalProperty() private _config?: EntityConfig; public setConfig(config: EntityConfig): void { if (!config) { 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 20d57c97d0..04d1f817a0 100644 --- a/src/panels/lovelace/entity-rows/hui-group-entity-row.ts +++ b/src/panels/lovelace/entity-rows/hui-group-entity-row.ts @@ -3,6 +3,7 @@ import { html, LitElement, property, + internalProperty, PropertyValues, TemplateResult, } from "lit-element"; @@ -17,9 +18,9 @@ import { EntityConfig, LovelaceRow } from "./types"; @customElement("hui-group-entity-row") class HuiGroupEntityRow extends LitElement implements LovelaceRow { - @property() public hass?: HomeAssistant; + @property({ attribute: false }) public hass?: HomeAssistant; - @property() private _config?: EntityConfig; + @internalProperty() private _config?: EntityConfig; public setConfig(config: EntityConfig): void { if (!config) { 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 01202c5d24..f878c33985 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 @@ -3,6 +3,7 @@ import { html, LitElement, property, + internalProperty, PropertyValues, TemplateResult, } from "lit-element"; @@ -20,9 +21,9 @@ import { createEntityNotFoundWarning } from "../components/hui-warning"; @customElement("hui-input-datetime-entity-row") class HuiInputDatetimeEntityRow extends LitElement implements LovelaceRow { - @property() public hass?: HomeAssistant; + @property({ attribute: false }) public hass?: HomeAssistant; - @property() private _config?: EntityConfig; + @internalProperty() private _config?: EntityConfig; public setConfig(config: EntityConfig): void { if (!config) { 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 5bc440d065..775626dede 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 @@ -6,6 +6,7 @@ import { html, LitElement, property, + internalProperty, PropertyValues, TemplateResult, } from "lit-element"; @@ -21,9 +22,9 @@ import { createEntityNotFoundWarning } from "../components/hui-warning"; @customElement("hui-input-number-entity-row") class HuiInputNumberEntityRow extends LitElement implements LovelaceRow { - @property() public hass?: HomeAssistant; + @property({ attribute: false }) public hass?: HomeAssistant; - @property() private _config?: EntityConfig; + @internalProperty() private _config?: EntityConfig; private _loaded?: boolean; 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 1c686028c1..e7e19aa8ff 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 @@ -7,6 +7,7 @@ import { html, LitElement, property, + internalProperty, PropertyValues, TemplateResult, } from "lit-element"; @@ -33,9 +34,9 @@ import { LovelaceRow } from "./types"; @customElement("hui-input-select-entity-row") class HuiInputSelectEntityRow extends LitElement implements LovelaceRow { - @property() public hass?: HomeAssistant; + @property({ attribute: false }) public hass?: HomeAssistant; - @property() private _config?: EntitiesCardEntityConfig; + @internalProperty() private _config?: EntitiesCardEntityConfig; public setConfig(config: EntitiesCardEntityConfig): void { if (!config || !config.entity) { 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 dc9e69366d..a503aa1c1f 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 @@ -4,6 +4,7 @@ import { html, LitElement, property, + internalProperty, PropertyValues, TemplateResult, } from "lit-element"; @@ -17,9 +18,9 @@ import { EntityConfig, LovelaceRow } from "./types"; @customElement("hui-input-text-entity-row") class HuiInputTextEntityRow extends LitElement implements LovelaceRow { - @property() public hass?: HomeAssistant; + @property({ attribute: false }) public hass?: HomeAssistant; - @property() private _config?: EntityConfig; + @internalProperty() private _config?: EntityConfig; public setConfig(config: EntityConfig): void { if (!config) { 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 cb9c74d262..1645638750 100644 --- a/src/panels/lovelace/entity-rows/hui-lock-entity-row.ts +++ b/src/panels/lovelace/entity-rows/hui-lock-entity-row.ts @@ -6,6 +6,7 @@ import { html, LitElement, property, + internalProperty, PropertyValues, TemplateResult, } from "lit-element"; @@ -18,9 +19,9 @@ import { EntityConfig, LovelaceRow } from "./types"; @customElement("hui-lock-entity-row") class HuiLockEntityRow extends LitElement implements LovelaceRow { - @property() public hass?: HomeAssistant; + @property({ attribute: false }) public hass?: HomeAssistant; - @property() private _config?: EntityConfig; + @internalProperty() private _config?: EntityConfig; public setConfig(config: EntityConfig): void { if (!config) { 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 76ebd5366c..e1d132ebd4 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 @@ -7,6 +7,7 @@ import { html, LitElement, property, + internalProperty, PropertyValues, TemplateResult, } from "lit-element"; @@ -37,13 +38,13 @@ import { computeStateDisplay } from "../../../common/entity/compute_state_displa @customElement("hui-media-player-entity-row") class HuiMediaPlayerEntityRow extends LitElement implements LovelaceRow { - @property() public hass?: HomeAssistant; + @property({ attribute: false }) public hass?: HomeAssistant; - @property() private _config?: EntityConfig; + @internalProperty() private _config?: EntityConfig; - @property() private _narrow?: boolean = false; + @internalProperty() private _narrow?: boolean = false; - @property() private _veryNarrow?: boolean = false; + @internalProperty() private _veryNarrow?: boolean = false; private _resizeObserver?: ResizeObserver; 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 0da4b598aa..5e1f778a49 100644 --- a/src/panels/lovelace/entity-rows/hui-scene-entity-row.ts +++ b/src/panels/lovelace/entity-rows/hui-scene-entity-row.ts @@ -6,6 +6,7 @@ import { html, LitElement, property, + internalProperty, PropertyValues, TemplateResult, } from "lit-element"; @@ -20,9 +21,9 @@ import { ActionRowConfig, LovelaceRow } from "./types"; @customElement("hui-scene-entity-row") class HuiSceneEntityRow extends LitElement implements LovelaceRow { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; - @property() private _config?: ActionRowConfig; + @internalProperty() private _config?: ActionRowConfig; public setConfig(config: ActionRowConfig): void { if (!config) { 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 06a49f68c1..1bddffbdbd 100644 --- a/src/panels/lovelace/entity-rows/hui-script-entity-row.ts +++ b/src/panels/lovelace/entity-rows/hui-script-entity-row.ts @@ -6,6 +6,7 @@ import { html, LitElement, property, + internalProperty, PropertyValues, TemplateResult, } from "lit-element"; @@ -19,9 +20,9 @@ import { canExcecute, ScriptEntity } from "../../../data/script"; @customElement("hui-script-entity-row") class HuiScriptEntityRow extends LitElement implements LovelaceRow { - @property() public hass?: HomeAssistant; + @property({ attribute: false }) public hass?: HomeAssistant; - @property() private _config?: ActionRowConfig; + @internalProperty() private _config?: ActionRowConfig; public setConfig(config: ActionRowConfig): void { if (!config) { 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 f479c25695..64882b2e28 100644 --- a/src/panels/lovelace/entity-rows/hui-sensor-entity-row.ts +++ b/src/panels/lovelace/entity-rows/hui-sensor-entity-row.ts @@ -5,6 +5,7 @@ import { html, LitElement, property, + internalProperty, PropertyValues, TemplateResult, } from "lit-element"; @@ -28,9 +29,9 @@ interface SensorEntityConfig extends EntitiesCardEntityConfig { @customElement("hui-sensor-entity-row") class HuiSensorEntityRow extends LitElement implements LovelaceRow { - @property() public hass?: HomeAssistant; + @property({ attribute: false }) public hass?: HomeAssistant; - @property() private _config?: SensorEntityConfig; + @internalProperty() private _config?: SensorEntityConfig; public setConfig(config: SensorEntityConfig): void { if (!config) { 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 de9eeb0fce..ece1924787 100644 --- a/src/panels/lovelace/entity-rows/hui-text-entity-row.ts +++ b/src/panels/lovelace/entity-rows/hui-text-entity-row.ts @@ -5,6 +5,7 @@ import { html, LitElement, property, + internalProperty, PropertyValues, TemplateResult, } from "lit-element"; @@ -25,9 +26,9 @@ import { EntitiesCardEntityConfig } from "../cards/types"; @customElement("hui-text-entity-row") class HuiTextEntityRow extends LitElement implements LovelaceRow { - @property() public hass?: HomeAssistant; + @property({ attribute: false }) public hass?: HomeAssistant; - @property() private _config?: EntitiesCardEntityConfig; + @internalProperty() private _config?: EntitiesCardEntityConfig; public setConfig(config: EntitiesCardEntityConfig): void { if (!config) { diff --git a/src/panels/lovelace/entity-rows/hui-timer-entity-row.ts b/src/panels/lovelace/entity-rows/hui-timer-entity-row.ts index b99596eddf..e744313f26 100644 --- a/src/panels/lovelace/entity-rows/hui-timer-entity-row.ts +++ b/src/panels/lovelace/entity-rows/hui-timer-entity-row.ts @@ -4,6 +4,7 @@ import { html, LitElement, property, + internalProperty, PropertyValues, TemplateResult, } from "lit-element"; @@ -17,11 +18,11 @@ import { EntityConfig } from "./types"; @customElement("hui-timer-entity-row") class HuiTimerEntityRow extends LitElement { - @property() public hass?: HomeAssistant; + @property({ attribute: false }) public hass?: HomeAssistant; - @property() private _config?: EntityConfig; + @internalProperty() private _config?: EntityConfig; - @property() private _timeRemaining?: number; + @internalProperty() private _timeRemaining?: number; private _interval?: number; 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 661281fe9f..30e13cf265 100644 --- a/src/panels/lovelace/entity-rows/hui-toggle-entity-row.ts +++ b/src/panels/lovelace/entity-rows/hui-toggle-entity-row.ts @@ -3,6 +3,7 @@ import { html, LitElement, property, + internalProperty, PropertyValues, TemplateResult, } from "lit-element"; @@ -17,9 +18,9 @@ import { EntityConfig, LovelaceRow } from "./types"; @customElement("hui-toggle-entity-row") class HuiToggleEntityRow extends LitElement implements LovelaceRow { - @property() public hass?: HomeAssistant; + @property({ attribute: false }) public hass?: HomeAssistant; - @property() private _config?: EntityConfig; + @internalProperty() private _config?: EntityConfig; public setConfig(config: EntityConfig): void { if (!config) { diff --git a/src/panels/lovelace/entity-rows/hui-weather-entity-row.ts b/src/panels/lovelace/entity-rows/hui-weather-entity-row.ts index 7af231937c..8570fc71a6 100644 --- a/src/panels/lovelace/entity-rows/hui-weather-entity-row.ts +++ b/src/panels/lovelace/entity-rows/hui-weather-entity-row.ts @@ -5,6 +5,7 @@ import { html, LitElement, property, + internalProperty, PropertyValues, TemplateResult, } from "lit-element"; @@ -37,9 +38,9 @@ import { stateIcon } from "../../../common/entity/state_icon"; @customElement("hui-weather-entity-row") class HuiWeatherEntityRow extends LitElement implements LovelaceRow { - @property() public hass?: HomeAssistant; + @property({ attribute: false }) public hass?: HomeAssistant; - @property() private _config?: EntitiesCardEntityConfig; + @internalProperty() private _config?: EntitiesCardEntityConfig; public setConfig(config: EntitiesCardEntityConfig): void { if (!config?.entity) { diff --git a/src/panels/lovelace/ha-panel-lovelace.ts b/src/panels/lovelace/ha-panel-lovelace.ts index 0e802519ce..bb3cce1f15 100644 --- a/src/panels/lovelace/ha-panel-lovelace.ts +++ b/src/panels/lovelace/ha-panel-lovelace.ts @@ -4,6 +4,7 @@ import { html, LitElement, property, + internalProperty, PropertyValues, TemplateResult, } from "lit-element"; @@ -39,20 +40,20 @@ let resourcesLoaded = false; class LovelacePanel extends LitElement { @property() public panel?: PanelInfo; - @property() public hass?: HomeAssistant; + @property({ attribute: false }) public hass?: HomeAssistant; @property() public narrow?: boolean; @property() public route?: Route; - @property() private _columns?: number; + @internalProperty() private _columns?: number; @property() private _state?: "loading" | "loaded" | "error" | "yaml-editor" = "loading"; - @property() private _errorMsg?: string; + @internalProperty() private _errorMsg?: string; - @property() private lovelace?: Lovelace; + @internalProperty() private lovelace?: Lovelace; private mqls?: MediaQueryList[]; diff --git a/src/panels/lovelace/header-footer/hui-buttons-header-footer.ts b/src/panels/lovelace/header-footer/hui-buttons-header-footer.ts index 93547d9b58..8364a33e9c 100644 --- a/src/panels/lovelace/header-footer/hui-buttons-header-footer.ts +++ b/src/panels/lovelace/header-footer/hui-buttons-header-footer.ts @@ -19,7 +19,7 @@ export class HuiButtonsHeaderFooter extends LitElement return { entities: [] }; } - @property() public hass?: HomeAssistant; + @property({ attribute: false }) public hass?: HomeAssistant; private _configEntities?: EntityConfig[]; diff --git a/src/panels/lovelace/header-footer/hui-graph-header-footer.ts b/src/panels/lovelace/header-footer/hui-graph-header-footer.ts index 8df6820d5f..8cbda2ed3e 100644 --- a/src/panels/lovelace/header-footer/hui-graph-header-footer.ts +++ b/src/panels/lovelace/header-footer/hui-graph-header-footer.ts @@ -7,6 +7,7 @@ import { html, LitElement, property, + internalProperty, PropertyValues, TemplateResult, } from "lit-element"; @@ -28,11 +29,11 @@ export class HuiGraphHeaderFooter extends LitElement return {}; } - @property() public hass?: HomeAssistant; + @property({ attribute: false }) public hass?: HomeAssistant; @property() protected _config?: GraphHeaderFooterConfig; - @property() private _coordinates?: number[][]; + @internalProperty() private _coordinates?: number[][]; private _date?: Date; diff --git a/src/panels/lovelace/header-footer/hui-picture-header-footer.ts b/src/panels/lovelace/header-footer/hui-picture-header-footer.ts index 7b68151317..7b00580748 100644 --- a/src/panels/lovelace/header-footer/hui-picture-header-footer.ts +++ b/src/panels/lovelace/header-footer/hui-picture-header-footer.ts @@ -31,7 +31,7 @@ export class HuiPictureHeaderFooter extends LitElement }; } - @property() public hass?: HomeAssistant; + @property({ attribute: false }) public hass?: HomeAssistant; @property() protected _config?: PictureHeaderFooterConfig; diff --git a/src/panels/lovelace/hui-editor.ts b/src/panels/lovelace/hui-editor.ts index 29e893ecba..c970e07b05 100644 --- a/src/panels/lovelace/hui-editor.ts +++ b/src/panels/lovelace/hui-editor.ts @@ -12,6 +12,7 @@ import { html, LitElement, property, + internalProperty, TemplateResult, } from "lit-element"; import { classMap } from "lit-html/directives/class-map"; @@ -36,15 +37,15 @@ const lovelaceStruct = struct.interface({ @customElement("hui-editor") class LovelaceFullConfigEditor extends LitElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; - @property() public lovelace?: Lovelace; + @property({ attribute: false }) public lovelace?: Lovelace; @property() public closeEditor?: () => void; - @property() private _saving?: boolean; + @internalProperty() private _saving?: boolean; - @property() private _changed?: boolean; + @internalProperty() private _changed?: boolean; private _generation = 1; diff --git a/src/panels/lovelace/hui-root.ts b/src/panels/lovelace/hui-root.ts index 54f248ef80..f8cadcee0b 100644 --- a/src/panels/lovelace/hui-root.ts +++ b/src/panels/lovelace/hui-root.ts @@ -19,6 +19,7 @@ import { html, LitElement, property, + internalProperty, PropertyValues, TemplateResult, } from "lit-element"; @@ -59,9 +60,9 @@ import type { HUIPanelView } from "./views/hui-panel-view"; import { HUIView } from "./views/hui-view"; class HUIRoot extends LitElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; - @property() public lovelace?: Lovelace; + @property({ attribute: false }) public lovelace?: Lovelace; @property() public columns?: number; @@ -69,7 +70,7 @@ class HUIRoot extends LitElement { @property() public route?: { path: string; prefix: string }; - @property() private _curView?: number | "hass-unused-entities"; + @internalProperty() private _curView?: number | "hass-unused-entities"; private _viewCache?: { [viewId: string]: HUIView }; diff --git a/src/panels/lovelace/special-rows/hui-attribute-row.ts b/src/panels/lovelace/special-rows/hui-attribute-row.ts index 29d611a3cd..1a6399fcc8 100644 --- a/src/panels/lovelace/special-rows/hui-attribute-row.ts +++ b/src/panels/lovelace/special-rows/hui-attribute-row.ts @@ -5,6 +5,7 @@ import { html, LitElement, property, + internalProperty, PropertyValues, TemplateResult, } from "lit-element"; @@ -16,9 +17,9 @@ import { createEntityNotFoundWarning } from "../components/hui-warning"; @customElement("hui-attribute-row") class HuiAttributeRow extends LitElement implements LovelaceRow { - @property() public hass?: HomeAssistant; + @property({ attribute: false }) public hass?: HomeAssistant; - @property() private _config?: AttributeRowConfig; + @internalProperty() private _config?: AttributeRowConfig; public setConfig(config: AttributeRowConfig): void { if (!config) { diff --git a/src/panels/lovelace/special-rows/hui-button-row.ts b/src/panels/lovelace/special-rows/hui-button-row.ts index a0cb5d7af8..5e55e125e5 100644 --- a/src/panels/lovelace/special-rows/hui-button-row.ts +++ b/src/panels/lovelace/special-rows/hui-button-row.ts @@ -5,7 +5,7 @@ import { customElement, html, LitElement, - property, + internalProperty, TemplateResult, } from "lit-element"; import "../../../components/ha-icon"; @@ -20,7 +20,7 @@ import { ButtonRowConfig, LovelaceRow } from "../entity-rows/types"; export class HuiButtonRow extends LitElement implements LovelaceRow { public hass?: HomeAssistant; - @property() private _config?: ButtonRowConfig; + @internalProperty() private _config?: ButtonRowConfig; public setConfig(config: ButtonRowConfig): void { if (!config) { diff --git a/src/panels/lovelace/special-rows/hui-buttons-row.ts b/src/panels/lovelace/special-rows/hui-buttons-row.ts index 9f7acf77bd..67ba91fb58 100644 --- a/src/panels/lovelace/special-rows/hui-buttons-row.ts +++ b/src/panels/lovelace/special-rows/hui-buttons-row.ts @@ -20,7 +20,7 @@ export class HuiButtonsRow extends LitElement implements LovelaceRow { return { entities: [] }; } - @property() public hass?: HomeAssistant; + @property({ attribute: false }) public hass?: HomeAssistant; private _configEntities?: EntityConfig[]; diff --git a/src/panels/lovelace/special-rows/hui-cast-row.ts b/src/panels/lovelace/special-rows/hui-cast-row.ts index e99263e0f5..db4bb01788 100644 --- a/src/panels/lovelace/special-rows/hui-cast-row.ts +++ b/src/panels/lovelace/special-rows/hui-cast-row.ts @@ -6,6 +6,7 @@ import { html, LitElement, property, + internalProperty, TemplateResult, PropertyValues, } from "lit-element"; @@ -21,13 +22,13 @@ import { CastConfig, LovelaceRow } from "../entity-rows/types"; @customElement("hui-cast-row") class HuiCastRow extends LitElement implements LovelaceRow { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; - @property() private _config?: CastConfig; + @internalProperty() private _config?: CastConfig; - @property() private _castManager?: CastManager | null; + @internalProperty() private _castManager?: CastManager | null; - @property() private _noHTTPS = false; + @internalProperty() private _noHTTPS = false; public setConfig(config: CastConfig): void { if (!config || config.view === undefined || config.view === null) { diff --git a/src/panels/lovelace/special-rows/hui-divider-row.ts b/src/panels/lovelace/special-rows/hui-divider-row.ts index 7ee5e22be0..aaf4127b3a 100644 --- a/src/panels/lovelace/special-rows/hui-divider-row.ts +++ b/src/panels/lovelace/special-rows/hui-divider-row.ts @@ -2,7 +2,7 @@ import { customElement, html, LitElement, - property, + internalProperty, TemplateResult, } from "lit-element"; import { HomeAssistant } from "../../../types"; @@ -12,7 +12,7 @@ import { DividerConfig, LovelaceRow } from "../entity-rows/types"; class HuiDividerRow extends LitElement implements LovelaceRow { public hass?: HomeAssistant; - @property() private _config?: DividerConfig; + @internalProperty() private _config?: DividerConfig; public setConfig(config): void { if (!config) { diff --git a/src/panels/lovelace/special-rows/hui-section-row.ts b/src/panels/lovelace/special-rows/hui-section-row.ts index d671784d2d..43900825d3 100644 --- a/src/panels/lovelace/special-rows/hui-section-row.ts +++ b/src/panels/lovelace/special-rows/hui-section-row.ts @@ -4,7 +4,7 @@ import { customElement, html, LitElement, - property, + internalProperty, TemplateResult, } from "lit-element"; import "../../../components/ha-icon"; @@ -15,7 +15,7 @@ import { LovelaceRow, SectionConfig } from "../entity-rows/types"; class HuiSectionRow extends LitElement implements LovelaceRow { public hass?: HomeAssistant; - @property() private _config?: SectionConfig; + @internalProperty() private _config?: SectionConfig; public setConfig(config: SectionConfig): void { if (!config) { diff --git a/src/panels/lovelace/special-rows/hui-text-row.ts b/src/panels/lovelace/special-rows/hui-text-row.ts index f526070893..d2b0786a9d 100644 --- a/src/panels/lovelace/special-rows/hui-text-row.ts +++ b/src/panels/lovelace/special-rows/hui-text-row.ts @@ -4,7 +4,7 @@ import { customElement, html, LitElement, - property, + internalProperty, TemplateResult, } from "lit-element"; import "../../../components/ha-icon"; @@ -12,7 +12,7 @@ import { LovelaceRow, TextConfig } from "../entity-rows/types"; @customElement("hui-text-row") class HuiTextRow extends LitElement implements LovelaceRow { - @property() private _config?: TextConfig; + @internalProperty() private _config?: TextConfig; public setConfig(config: TextConfig): void { if (!config || !config.name || !config.text) { diff --git a/src/panels/lovelace/special-rows/hui-weblink-row.ts b/src/panels/lovelace/special-rows/hui-weblink-row.ts index e510734689..1e278c0d37 100644 --- a/src/panels/lovelace/special-rows/hui-weblink-row.ts +++ b/src/panels/lovelace/special-rows/hui-weblink-row.ts @@ -4,7 +4,7 @@ import { customElement, html, LitElement, - property, + internalProperty, TemplateResult, } from "lit-element"; import "../../../components/ha-icon"; @@ -15,7 +15,7 @@ import { LovelaceRow, WeblinkConfig } from "../entity-rows/types"; class HuiWeblinkRow extends LitElement implements LovelaceRow { public hass?: HomeAssistant; - @property() private _config?: WeblinkConfig; + @internalProperty() private _config?: WeblinkConfig; public setConfig(config: WeblinkConfig): void { if (!config || !config.url) { diff --git a/src/panels/lovelace/views/hui-panel-view.ts b/src/panels/lovelace/views/hui-panel-view.ts index ede0363fb4..87feecb634 100644 --- a/src/panels/lovelace/views/hui-panel-view.ts +++ b/src/panels/lovelace/views/hui-panel-view.ts @@ -14,9 +14,9 @@ let editCodeLoaded = false; @customElement("hui-panel-view") export class HUIPanelView extends UpdatingElement { - @property() public hass?: HomeAssistant; + @property({ attribute: false }) public hass?: HomeAssistant; - @property() public lovelace?: Lovelace; + @property({ attribute: false }) public lovelace?: Lovelace; @property() public config?: LovelaceViewConfig; diff --git a/src/panels/lovelace/views/hui-view.ts b/src/panels/lovelace/views/hui-view.ts index ed5a68cc43..49279ef253 100644 --- a/src/panels/lovelace/views/hui-view.ts +++ b/src/panels/lovelace/views/hui-view.ts @@ -2,6 +2,7 @@ import { html, LitElement, property, + internalProperty, PropertyValues, TemplateResult, CSSResult, @@ -49,17 +50,17 @@ const getColumnIndex = (columnSizes: number[], size: number) => { }; export class HUIView extends LitElement { - @property() public hass?: HomeAssistant; + @property({ attribute: false }) public hass?: HomeAssistant; - @property() public lovelace?: Lovelace; + @property({ attribute: false }) public lovelace?: Lovelace; @property({ type: Number }) public columns?: number; @property({ type: Number }) public index?: number; - @property() private _cards: Array = []; + @internalProperty() private _cards: Array = []; - @property() private _badges: LovelaceBadge[] = []; + @internalProperty() private _badges: LovelaceBadge[] = []; private _createColumnsIteration = 0; diff --git a/src/panels/profile/ha-advanced-mode-row.ts b/src/panels/profile/ha-advanced-mode-row.ts index 77df00c329..a7e40b16cf 100644 --- a/src/panels/profile/ha-advanced-mode-row.ts +++ b/src/panels/profile/ha-advanced-mode-row.ts @@ -18,7 +18,7 @@ import "./ha-settings-row"; @customElement("ha-advanced-mode-row") class AdvancedModeRow extends LitElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; @property() public narrow!: boolean; diff --git a/src/panels/profile/ha-force-narrow-row.ts b/src/panels/profile/ha-force-narrow-row.ts index 27da08586d..edf8c5e19c 100644 --- a/src/panels/profile/ha-force-narrow-row.ts +++ b/src/panels/profile/ha-force-narrow-row.ts @@ -13,7 +13,7 @@ import "./ha-settings-row"; @customElement("ha-force-narrow-row") class HaForcedNarrowRow extends LitElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; @property() public narrow!: boolean; diff --git a/src/panels/profile/ha-panel-profile.ts b/src/panels/profile/ha-panel-profile.ts index e5837150f4..d783e37260 100644 --- a/src/panels/profile/ha-panel-profile.ts +++ b/src/panels/profile/ha-panel-profile.ts @@ -11,6 +11,7 @@ import { html, LitElement, property, + internalProperty, TemplateResult, } from "lit-element"; import { fireEvent } from "../../common/dom/fire_event"; @@ -38,13 +39,13 @@ import "./ha-set-vibrate-row"; import "./ha-set-suspend-row"; class HaPanelProfile extends LitElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; @property() public narrow!: boolean; - @property() private _refreshTokens?: unknown[]; + @internalProperty() private _refreshTokens?: unknown[]; - @property() private _coreUserData?: CoreFrontendUserData | null; + @internalProperty() private _coreUserData?: CoreFrontendUserData | null; private _unsubCoreData?: UnsubscribeFunc; diff --git a/src/panels/profile/ha-pick-dashboard-row.ts b/src/panels/profile/ha-pick-dashboard-row.ts index 53331c5792..33fde87943 100644 --- a/src/panels/profile/ha-pick-dashboard-row.ts +++ b/src/panels/profile/ha-pick-dashboard-row.ts @@ -5,6 +5,7 @@ import { html, LitElement, property, + internalProperty, PropertyValues, TemplateResult, } from "lit-element"; @@ -16,11 +17,11 @@ import "./ha-settings-row"; @customElement("ha-pick-dashboard-row") class HaPickDashboardRow extends LitElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; @property() public narrow!: boolean; - @property() private _dashboards: LovelaceDashboard[] = []; + @internalProperty() private _dashboards: LovelaceDashboard[] = []; protected firstUpdated(changedProps: PropertyValues) { super.firstUpdated(changedProps); diff --git a/src/panels/profile/ha-set-suspend-row.ts b/src/panels/profile/ha-set-suspend-row.ts index d4c4d30b69..a2ead43255 100644 --- a/src/panels/profile/ha-set-suspend-row.ts +++ b/src/panels/profile/ha-set-suspend-row.ts @@ -26,7 +26,7 @@ declare global { @customElement("ha-set-suspend-row") class HaSetSuspendRow extends LitElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; @property() public narrow!: boolean; diff --git a/src/panels/profile/ha-set-vibrate-row.ts b/src/panels/profile/ha-set-vibrate-row.ts index 2075b1a4f1..e232c510ae 100644 --- a/src/panels/profile/ha-set-vibrate-row.ts +++ b/src/panels/profile/ha-set-vibrate-row.ts @@ -14,7 +14,7 @@ import "./ha-settings-row"; @customElement("ha-set-vibrate-row") class HaSetVibrateRow extends LitElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; @property() public narrow!: boolean; diff --git a/src/state-summary/state-card-input_select.ts b/src/state-summary/state-card-input_select.ts index 5e55755447..6e2e9f7130 100644 --- a/src/state-summary/state-card-input_select.ts +++ b/src/state-summary/state-card-input_select.ts @@ -21,7 +21,7 @@ import type { HomeAssistant, InputSelectEntity } from "../types"; @customElement("state-card-input_select") class StateCardInputSelect extends LitElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; @property() public stateObj!: InputSelectEntity; diff --git a/src/state-summary/state-card-script.ts b/src/state-summary/state-card-script.ts index da04bff86a..35e653bad1 100644 --- a/src/state-summary/state-card-script.ts +++ b/src/state-summary/state-card-script.ts @@ -16,7 +16,7 @@ import { canExcecute, ScriptEntity } from "../data/script"; @customElement("state-card-script") export class StateCardScript extends LitElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; @property() public stateObj!: HassEntity; diff --git a/src/state/hass-base-mixin.ts b/src/state/hass-base-mixin.ts index 75c3174dc8..1d9b09d4ee 100644 --- a/src/state/hass-base-mixin.ts +++ b/src/state/hass-base-mixin.ts @@ -3,7 +3,7 @@ import { LitElement, property } from "lit-element"; import { HomeAssistant } from "../types"; export class HassBaseEl extends LitElement { - @property() public hass?: HomeAssistant; + @property({ attribute: false }) public hass?: HomeAssistant; protected _pendingHass: Partial = {};