From 7534ecd2f28961a47007605201fb729edac8a7bf Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Tue, 23 Jun 2020 09:38:55 -0700 Subject: [PATCH 01/46] 20200623.1 (#6216) --- setup.py | 2 +- src/components/ha-circular-progress.ts | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index bdc1cc932a..17e217a328 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ from setuptools import setup, find_packages setup( name="home-assistant-frontend", - version="20200623.0", + version="20200623.1", description="The Home Assistant frontend", url="https://github.com/home-assistant/home-assistant-polymer", author="The Home Assistant Authors", diff --git a/src/components/ha-circular-progress.ts b/src/components/ha-circular-progress.ts index c15ce80fd4..e219f52e47 100644 --- a/src/components/ha-circular-progress.ts +++ b/src/components/ha-circular-progress.ts @@ -7,6 +7,7 @@ import { customElement, unsafeCSS, SVGTemplateResult, + css, } from "lit-element"; // @ts-ignore import progressStyles from "@material/circular-progress/dist/mdc.circular-progress.min.css"; @@ -74,7 +75,14 @@ export class HaCircularProgress extends LitElement { } static get styles() { - return unsafeCSS(progressStyles); + return [ + unsafeCSS(progressStyles), + css` + :host { + text-align: initial; + } + `, + ]; } } From a8a8cafd2bcaaad8dfa9be2e62390279f42cd666 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Mon, 6 Jul 2020 03:57:15 -0700 Subject: [PATCH 02/46] Fix logbook showing user names (#6327) Co-authored-by: Bram Kragten --- src/panels/logbook/ha-panel-logbook.ts | 42 +++++++++++++++++++++----- 1 file changed, 34 insertions(+), 8 deletions(-) diff --git a/src/panels/logbook/ha-panel-logbook.ts b/src/panels/logbook/ha-panel-logbook.ts index 62eebaad51..8a0cf68b1f 100644 --- a/src/panels/logbook/ha-panel-logbook.ts +++ b/src/panels/logbook/ha-panel-logbook.ts @@ -18,6 +18,7 @@ import { import { HomeAssistant } from "../../types"; import { haStyle } from "../../resources/styles"; import { fetchUsers } from "../../data/user"; +import { fetchPersons } from "../../data/person"; import { clearLogbookCache, getLogbookData, @@ -132,7 +133,7 @@ export class HaPanelLogbook extends LitElement { super.firstUpdated(changedProps); this.hass.loadBackendTranslation("title"); - this._fetchUserDone = this._fetchUsers(); + this._fetchUserDone = this._fetchUserNames(); const today = new Date(); today.setHours(0, 0, 0, 0); @@ -197,13 +198,38 @@ export class HaPanelLogbook extends LitElement { } } - private async _fetchUsers() { - const users = await fetchUsers(this.hass); - const userid_to_name = {}; - users.forEach((user) => { - userid_to_name[user.id] = user.name; - }); - this._userIdToName = userid_to_name; + private async _fetchUserNames() { + const userIdToName = {}; + + // Start loading all the data + const personProm = fetchPersons(this.hass); + const userProm = this.hass.user!.is_admin && fetchUsers(this.hass); + + // Process persons + const persons = await personProm; + + for (const person of persons.storage) { + if (person.user_id) { + userIdToName[person.user_id] = person.name; + } + } + for (const person of persons.config) { + if (person.user_id) { + userIdToName[person.user_id] = person.name; + } + } + + // Process users + if (userProm) { + const users = await userProm; + for (const user of users) { + if (!(user.id in userIdToName)) { + userIdToName[user.id] = user.name; + } + } + } + + this._userIdToName = userIdToName; } private _dateRangeChanged(ev) { From a8e8c1ce5d00d07698f3c94bdf6458a85c858393 Mon Sep 17 00:00:00 2001 From: Christopher Masto Date: Mon, 6 Jul 2020 03:39:54 -0400 Subject: [PATCH 03/46] Fix missing UI elements in Z-Wave panel (#6299) (#6336) This broke in d94df728e55bdf947791e1a73d9d6fbfd41e4d2e and prevents use of the group association and protection controls. --- .../integrations/integration-panels/zwave/zwave-groups.js | 3 ++- .../integration-panels/zwave/zwave-node-protection.js | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/panels/config/integrations/integration-panels/zwave/zwave-groups.js b/src/panels/config/integrations/integration-panels/zwave/zwave-groups.js index 102567a289..94037f1e03 100644 --- a/src/panels/config/integrations/integration-panels/zwave/zwave-groups.js +++ b/src/panels/config/integrations/integration-panels/zwave/zwave-groups.js @@ -7,9 +7,10 @@ import { PolymerElement } from "@polymer/polymer/polymer-element"; import { computeStateName } from "../../../../../common/entity/compute_state_name"; import "../../../../../components/buttons/ha-call-service-button"; import "../../../../../components/ha-card"; +import LocalizeMixin from "../../../../../mixins/localize-mixin"; import "../../../../../styles/polymer-ha-style"; -class ZwaveGroups extends PolymerElement { +class ZwaveGroups extends LocalizeMixin(PolymerElement) { static get template() { return html` - - -
[[computeTitle(stateObj)]]
-
- - -
-
- `; - } - - static get properties() { - return { - hass: Object, - stateObj: { - type: Object, - observer: "stateObjObserver", - }, - inDialog: { - type: Boolean, - value: false, - }, - stateHistory: Object, - stateHistoryLoading: Boolean, - cacheConfig: { - type: Object, - value: { - refresh: 0, - cacheKey: null, - hoursToShow: 24, - }, - }, - }; - } - - stateObjObserver(stateObj) { - if (!stateObj) return; - if ( - this.cacheConfig.cacheKey !== stateObj.entity_id || - this.cacheConfig.refresh !== (stateObj.attributes.refresh || 0) || - this.cacheConfig.hoursToShow !== (stateObj.attributes.hours_to_show || 24) - ) { - this.cacheConfig = { - refresh: stateObj.attributes.refresh || 0, - cacheKey: stateObj.entity_id, - hoursToShow: stateObj.attributes.hours_to_show || 24, - }; - } - } - - computeTitle(stateObj) { - return computeStateName(stateObj); - } - - computeContentClass(inDialog) { - return inDialog ? "" : "content"; - } - - computeHistoryEntities(stateObj) { - return stateObj.attributes.entity_id; - } - - computeElevation(inDialog) { - return inDialog ? 0 : 1; - } - - cardTapped(ev) { - const mq = window.matchMedia("(min-width: 610px) and (min-height: 550px)"); - if (mq.matches) { - ev.stopPropagation(); - this.fire("hass-more-info", { entityId: this.stateObj.entity_id }); - } - } -} -customElements.define("ha-history_graph-card", HaHistoryGraphCard); diff --git a/src/common/const.ts b/src/common/const.ts index b801ae37fc..dc2bf20595 100644 --- a/src/common/const.ts +++ b/src/common/const.ts @@ -22,7 +22,6 @@ export const DOMAINS_WITH_CARD = [ "timer", "vacuum", "water_heater", - "weblink", ]; /** Domains with separate more info dialog. */ @@ -36,7 +35,6 @@ export const DOMAINS_WITH_MORE_INFO = [ "cover", "fan", "group", - "history_graph", "humidifier", "input_datetime", "light", @@ -58,16 +56,10 @@ export const DOMAINS_HIDE_MORE_INFO = [ "input_select", "input_text", "scene", - "weblink", ]; /** Domains that should have the history hidden in the more info dialog. */ -export const DOMAINS_MORE_INFO_NO_HISTORY = [ - "camera", - "configurator", - "history_graph", - "scene", -]; +export const DOMAINS_MORE_INFO_NO_HISTORY = ["camera", "configurator", "scene"]; /** States that we consider "off". */ export const STATES_OFF = ["closed", "locked", "off"]; diff --git a/src/common/entity/domain_icon.ts b/src/common/entity/domain_icon.ts index 866b3a5afc..82b8795454 100644 --- a/src/common/entity/domain_icon.ts +++ b/src/common/entity/domain_icon.ts @@ -20,7 +20,6 @@ const fixedIcons = { fan: "hass:fan", google_assistant: "hass:google-assistant", group: "hass:google-circles-communities", - history_graph: "hass:chart-line", homeassistant: "hass:home-assistant", homekit: "hass:home-automation", humidifier: "hass:air-humidifier", @@ -49,7 +48,6 @@ const fixedIcons = { vacuum: "hass:robot-vacuum", water_heater: "hass:thermometer", weather: "hass:weather-cloudy", - weblink: "hass:open-in-new", zone: "hass:map-marker-radius", }; diff --git a/src/data/entity.ts b/src/data/entity.ts index 80f4e7c820..f8dc2efe42 100644 --- a/src/data/entity.ts +++ b/src/data/entity.ts @@ -17,7 +17,6 @@ export const ENTITY_COMPONENT_DOMAINS = [ "fan", "geo_location", "group", - "history_graph", "image_processing", "input_boolean", "input_datetime", diff --git a/src/data/ha-state-history-data.js b/src/data/ha-state-history-data.js deleted file mode 100644 index bcce4509f8..0000000000 --- a/src/data/ha-state-history-data.js +++ /dev/null @@ -1,178 +0,0 @@ -import { timeOut } from "@polymer/polymer/lib/utils/async"; -import { Debouncer } from "@polymer/polymer/lib/utils/debounce"; -/* eslint-plugin-disable lit */ -import { PolymerElement } from "@polymer/polymer/polymer-element"; -import LocalizeMixin from "../mixins/localize-mixin"; -import { getRecent, getRecentWithCache } from "./cached-history"; -import { computeHistory, fetchDate } from "./history"; - -/* - * @appliesMixin LocalizeMixin - */ -class HaStateHistoryData extends LocalizeMixin(PolymerElement) { - static get properties() { - return { - hass: { - type: Object, - observer: "hassChanged", - }, - - filterType: String, - - cacheConfig: Object, - - startTime: Date, - endTime: Date, - - entityId: String, - - isLoading: { - type: Boolean, - value: true, - readOnly: true, - notify: true, - }, - - data: { - type: Object, - value: null, - readOnly: true, - notify: true, - }, - }; - } - - static get observers() { - return [ - "filterChangedDebouncer(filterType, entityId, startTime, endTime, cacheConfig, localize)", - ]; - } - - connectedCallback() { - super.connectedCallback(); - this.filterChangedDebouncer( - this.filterType, - this.entityId, - this.startTime, - this.endTime, - this.cacheConfig, - this.localize - ); - } - - disconnectedCallback() { - if (this._refreshTimeoutId) { - window.clearInterval(this._refreshTimeoutId); - this._refreshTimeoutId = null; - } - super.disconnectedCallback(); - } - - hassChanged(newHass, oldHass) { - if (!oldHass && !this._madeFirstCall) { - this.filterChangedDebouncer( - this.filterType, - this.entityId, - this.startTime, - this.endTime, - this.cacheConfig, - this.localize - ); - } - } - - filterChangedDebouncer(...args) { - this._debounceFilterChanged = Debouncer.debounce( - this._debounceFilterChanged, - timeOut.after(0), - () => { - this.filterChanged(...args); - } - ); - } - - filterChanged( - filterType, - entityId, - startTime, - endTime, - cacheConfig, - localize - ) { - if (!this.hass) { - return; - } - if (cacheConfig && !cacheConfig.cacheKey) { - return; - } - if (!localize) { - return; - } - this._madeFirstCall = true; - const language = this.hass.language; - let data; - - if (filterType === "date") { - if (!startTime || !endTime) return; - - data = fetchDate(this.hass, startTime, endTime).then((dateHistory) => - computeHistory(this.hass, dateHistory, localize, language) - ); - } else if (filterType === "recent-entity") { - if (!entityId) return; - if (cacheConfig) { - data = this.getRecentWithCacheRefresh( - entityId, - cacheConfig, - localize, - language - ); - } else { - data = getRecent( - this.hass, - entityId, - startTime, - endTime, - localize, - language - ); - } - } else { - return; - } - this._setIsLoading(true); - - data.then((stateHistory) => { - this._setData(stateHistory); - this._setIsLoading(false); - }); - } - - getRecentWithCacheRefresh(entityId, cacheConfig, localize, language) { - if (this._refreshTimeoutId) { - window.clearInterval(this._refreshTimeoutId); - this._refreshTimeoutId = null; - } - if (cacheConfig.refresh) { - this._refreshTimeoutId = window.setInterval(() => { - getRecentWithCache( - this.hass, - entityId, - cacheConfig, - localize, - language - ).then((stateHistory) => { - this._setData({ ...stateHistory }); - }); - }, cacheConfig.refresh * 1000); - } - return getRecentWithCache( - this.hass, - entityId, - cacheConfig, - localize, - language - ); - } -} -customElements.define("ha-state-history-data", HaStateHistoryData); diff --git a/src/dialogs/more-info/controls/more-info-history_graph.js b/src/dialogs/more-info/controls/more-info-history_graph.js deleted file mode 100644 index febd00b62f..0000000000 --- a/src/dialogs/more-info/controls/more-info-history_graph.js +++ /dev/null @@ -1,33 +0,0 @@ -import { html } from "@polymer/polymer/lib/utils/html-tag"; -/* eslint-plugin-disable lit */ -import { PolymerElement } from "@polymer/polymer/polymer-element"; -import "../../../cards/ha-history_graph-card"; -import "../../../components/ha-attributes"; - -class MoreInfoHistoryGraph extends PolymerElement { - static get template() { - return html` - - - - - `; - } - - static get properties() { - return { - hass: Object, - stateObj: Object, - }; - } -} -customElements.define("more-info-history_graph", MoreInfoHistoryGraph); diff --git a/src/dialogs/more-info/ha-more-info-dialog.ts b/src/dialogs/more-info/ha-more-info-dialog.ts index 97fcf8a565..fb68cc7eec 100644 --- a/src/dialogs/more-info/ha-more-info-dialog.ts +++ b/src/dialogs/more-info/ha-more-info-dialog.ts @@ -29,7 +29,7 @@ import { computeDomain } from "../../common/entity/compute_domain"; import { mdiClose, mdiCog, mdiPencil } from "@mdi/js"; import { HistoryResult } from "../../data/history"; -const DOMAINS_NO_INFO = ["camera", "configurator", "history_graph"]; +const DOMAINS_NO_INFO = ["camera", "configurator"]; const EDITABLE_DOMAINS_WITH_ID = ["scene", "automation"]; const EDITABLE_DOMAINS = ["script"]; @@ -288,7 +288,6 @@ export class MoreInfoDialog extends LitElement { width: auto; } - ha-dialog[data-domain="history_graph"] .content, :host([large]) .content { width: calc(90vw - 48px); } diff --git a/src/dialogs/more-info/more-info-content.ts b/src/dialogs/more-info/more-info-content.ts index ceee8e630f..2038fb014b 100644 --- a/src/dialogs/more-info/more-info-content.ts +++ b/src/dialogs/more-info/more-info-content.ts @@ -13,7 +13,6 @@ import "./controls/more-info-cover"; import "./controls/more-info-default"; import "./controls/more-info-fan"; import "./controls/more-info-group"; -import "./controls/more-info-history_graph"; import "./controls/more-info-humidifier"; import "./controls/more-info-input_datetime"; import "./controls/more-info-light"; diff --git a/src/panels/lovelace/cards/hui-history-graph-card.ts b/src/panels/lovelace/cards/hui-history-graph-card.ts index f0c992e30c..cfd81c79a5 100644 --- a/src/panels/lovelace/cards/hui-history-graph-card.ts +++ b/src/panels/lovelace/cards/hui-history-graph-card.ts @@ -148,7 +148,7 @@ export class HuiHistoryGraphCard extends LitElement implements LovelaceCard { } private async _getStateHistory(): Promise { - this._stateHistory = getRecentWithCache( + this._stateHistory = await getRecentWithCache( this.hass!, this._cacheConfig!.cacheKey, this._cacheConfig!, diff --git a/src/panels/lovelace/common/generate-lovelace-config.ts b/src/panels/lovelace/common/generate-lovelace-config.ts index cc6b24611c..b5301d37f9 100644 --- a/src/panels/lovelace/common/generate-lovelace-config.ts +++ b/src/panels/lovelace/common/generate-lovelace-config.ts @@ -43,7 +43,7 @@ import { ThermostatCardConfig, } from "../cards/types"; import { processEditorEntities } from "../editor/process-editor-entities"; -import { LovelaceRowConfig, WeblinkConfig } from "../entity-rows/types"; +import { LovelaceRowConfig } from "../entity-rows/types"; const DEFAULT_VIEW_ENTITY_ID = "group.default_view"; const DOMAINS_BADGES = [ @@ -143,15 +143,6 @@ export const computeCards = ( entity: entityId, }; cards.push(cardConfig); - } else if (domain === "history_graph" && stateObj) { - const cardConfig = { - type: "history-graph", - entities: stateObj.attributes.entity_id, - hours_to_show: stateObj.attributes.hours_to_show, - title: stateObj.attributes.friendly_name, - refresh_interval: stateObj.attributes.refresh, - }; - cards.push(cardConfig); } else if (domain === "humidifier") { const cardConfig: HumidifierCardConfig = { type: "humidifier", @@ -182,15 +173,6 @@ export const computeCards = ( entity: entityId, }; cards.push(cardConfig); - } else if (domain === "weblink" && stateObj) { - const conf: WeblinkConfig = { - type: "weblink", - url: stateObj.state, - }; - if ("icon" in stateObj.attributes) { - conf.icon = stateObj.attributes.icon; - } - entities.push(conf); } else if ( domain === "sensor" && stateObj?.attributes.device_class === SENSOR_DEVICE_CLASS_BATTERY diff --git a/src/state-summary/state-card-content.js b/src/state-summary/state-card-content.js index 22375c13f7..026b6287cb 100644 --- a/src/state-summary/state-card-content.js +++ b/src/state-summary/state-card-content.js @@ -17,7 +17,6 @@ import "./state-card-timer"; import "./state-card-toggle"; import "./state-card-vacuum"; import "./state-card-water_heater"; -import "./state-card-weblink"; class StateCardContent extends PolymerElement { static get properties() { diff --git a/src/state-summary/state-card-weblink.js b/src/state-summary/state-card-weblink.js deleted file mode 100644 index aeb233b61f..0000000000 --- a/src/state-summary/state-card-weblink.js +++ /dev/null @@ -1,61 +0,0 @@ -import { html } from "@polymer/polymer/lib/utils/html-tag"; -/* eslint-plugin-disable lit */ -import { PolymerElement } from "@polymer/polymer/polymer-element"; -import { computeStateName } from "../common/entity/compute_state_name"; -import "../components/entity/state-badge"; - -class StateCardWeblink extends PolymerElement { - static get template() { - return html` - - - ${this.stateBadgeTemplate} - [[_computeStateName(stateObj)]] - `; - } - - static get stateBadgeTemplate() { - return html` `; - } - - static get properties() { - return { - stateObj: Object, - inDialog: { - type: Boolean, - value: false, - }, - }; - } - - ready() { - super.ready(); - this.addEventListener("click", (ev) => this.onTap(ev)); - } - - _computeStateName(stateObj) { - return computeStateName(stateObj); - } - - onTap(ev) { - ev.stopPropagation(); - ev.preventDefault(); - window.open(this.stateObj.state, "_blank"); - } -} -customElements.define("state-card-weblink", StateCardWeblink); From 98656b004450d5d9a6c9cbcb72926715773e6723 Mon Sep 17 00:00:00 2001 From: Bram Kragten Date: Tue, 14 Jul 2020 18:20:15 +0200 Subject: [PATCH 10/46] Little clean up (#6377) --- src/components/ha-card.ts | 2 +- src/entrypoints/app.ts | 2 -- src/panels/config/cloud/alexa/cloud-alexa.ts | 2 +- .../config/cloud/google-assistant/cloud-google-assistant.ts | 2 +- src/panels/lovelace/cards/hui-alarm-panel-card.ts | 2 +- src/panels/lovelace/editor/card-editor/hui-card-picker.ts | 2 +- src/resources/styles.ts | 2 +- 7 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/components/ha-card.ts b/src/components/ha-card.ts index 9d48bca2cb..8b2cbd8292 100644 --- a/src/components/ha-card.ts +++ b/src/components/ha-card.ts @@ -19,7 +19,7 @@ class HaCard extends LitElement { :host { background: var( --ha-card-background, - var(--paper-card-background-color, white) + var(--card-background-color, white) ); border-radius: var(--ha-card-border-radius, 4px); box-shadow: var( diff --git a/src/entrypoints/app.ts b/src/entrypoints/app.ts index 934affb498..bb4b54b6e7 100644 --- a/src/entrypoints/app.ts +++ b/src/entrypoints/app.ts @@ -5,8 +5,6 @@ import "../layouts/home-assistant"; import "../util/legacy-support"; setPassiveTouchGestures(true); -/* LastPass createElement workaround. See #428 */ -document.createElement = Document.prototype.createElement; (window as any).frontendVersion = __VERSION__; diff --git a/src/panels/config/cloud/alexa/cloud-alexa.ts b/src/panels/config/cloud/alexa/cloud-alexa.ts index 5a3ae1ebd2..277d0022d4 100644 --- a/src/panels/config/cloud/alexa/cloud-alexa.ts +++ b/src/panels/config/cloud/alexa/cloud-alexa.ts @@ -323,7 +323,7 @@ class CloudAlexa extends LitElement { color: var(--primary-text-color); background-color: var( --ha-card-background, - var(--paper-card-background-color, white) + var(--card-background-color, white) ); padding: 16px 8px; text-align: center; 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 84e3c77d1c..ea09102aea 100644 --- a/src/panels/config/cloud/google-assistant/cloud-google-assistant.ts +++ b/src/panels/config/cloud/google-assistant/cloud-google-assistant.ts @@ -361,7 +361,7 @@ class CloudGoogleAssistant extends LitElement { color: var(--primary-text-color); background-color: var( --ha-card-background, - var(--paper-card-background-color, white) + var(--card-background-color, white) ); padding: 16px 8px; text-align: center; diff --git a/src/panels/lovelace/cards/hui-alarm-panel-card.ts b/src/panels/lovelace/cards/hui-alarm-panel-card.ts index bcb4343481..8fa590cf8f 100644 --- a/src/panels/lovelace/cards/hui-alarm-panel-card.ts +++ b/src/panels/lovelace/cards/hui-alarm-panel-card.ts @@ -280,7 +280,7 @@ class HuiAlarmPanelCard extends LitElement implements LovelaceCard { ha-label-badge { --ha-label-badge-color: var(--alarm-state-color); --label-badge-text-color: var(--alarm-state-color); - --label-badge-background-color: var(--paper-card-background-color); + --label-badge-background-color: var(--card-background-color); color: var(--alarm-state-color); position: absolute; right: 12px; 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 ab87b56caa..e9dab6492d 100644 --- a/src/panels/lovelace/editor/card-editor/hui-card-picker.ts +++ b/src/panels/lovelace/editor/card-editor/hui-card-picker.ts @@ -266,7 +266,7 @@ export class HuiCardPicker extends LitElement { text-align: center; background: var( --ha-card-background, - var(--paper-card-background-color, white) + var(--card-background-color, white) ); border-radius: 0 0 4px 4px; border-bottom: 1px solid var(--divider-color); diff --git a/src/resources/styles.ts b/src/resources/styles.ts index 9eeeb4821d..6cd52a0db8 100644 --- a/src/resources/styles.ts +++ b/src/resources/styles.ts @@ -21,7 +21,6 @@ export const derivedStyles = { "label-badge-grey": "var(--paper-grey-500)", "label-badge-background-color": "var(--card-background-color)", "label-badge-text-color": "rgba(var(--rgb-primary-text-color), 0.8)", - "paper-card-background-color": "var(--card-background-color)", "paper-listbox-background-color": "var(--card-background-color)", "paper-item-icon-color": "var(--state-icon-color)", "paper-item-icon-active-color": "var(--state-icon-active-color)", @@ -49,6 +48,7 @@ export const derivedStyles = { "material-secondary-background-color": "var(--secondary-background-color)", "mdc-checkbox-unchecked-color": "rgba(var(--rgb-primary-text-color), 0.54)", "mdc-checkbox-disabled-color": "var(--disabled-text-color)", + "mdc-tab-text-label-color-default": "var(--primary-text-color)", }; export const haStyle = css` From e70a3e09bfe09d493f2c5fede0cacf261b36a5df Mon Sep 17 00:00:00 2001 From: Bram Kragten Date: Tue, 14 Jul 2020 19:48:11 +0200 Subject: [PATCH 11/46] Change UI of script entities (#6371) --- src/data/script.ts | 20 +++++ src/panels/config/script/ha-script-editor.ts | 5 +- .../entity-rows/hui-script-entity-row.ts | 60 +++++++++------ src/state-summary/state-card-script.js | 74 ------------------ src/state-summary/state-card-script.ts | 77 +++++++++++++++++++ src/translations/en.json | 4 +- 6 files changed, 138 insertions(+), 102 deletions(-) delete mode 100644 src/state-summary/state-card-script.js create mode 100644 src/state-summary/state-card-script.ts diff --git a/src/data/script.ts b/src/data/script.ts index 5fdbbcfa46..81f8292f24 100644 --- a/src/data/script.ts +++ b/src/data/script.ts @@ -7,9 +7,15 @@ import { navigate } from "../common/navigate"; import { HomeAssistant } from "../types"; import { Condition } from "./automation"; +export const MODES = ["single", "restart", "queued", "parallel"]; +export const MODES_MAX = ["queued", "parallel"]; + export interface ScriptEntity extends HassEntityBase { attributes: HassEntityAttributeBase & { last_triggered: string; + mode: "single" | "restart" | "queued" | "parallel"; + current?: number; + max?: number; }; } @@ -66,6 +72,20 @@ export const triggerScript = ( variables?: {} ) => hass.callService("script", computeObjectId(entityId), variables); +export const canExcecute = (state: ScriptEntity) => { + if (state.state === "off") { + return true; + } + if ( + state.state === "on" && + MODES_MAX.includes(state.attributes.mode) && + state.attributes.current! < state.attributes.max! + ) { + return true; + } + return false; +}; + export const deleteScript = (hass: HomeAssistant, objectId: string) => hass.callApi("DELETE", `config/script/config/${objectId}`); diff --git a/src/panels/config/script/ha-script-editor.ts b/src/panels/config/script/ha-script-editor.ts index be5422de69..68f334383a 100644 --- a/src/panels/config/script/ha-script-editor.ts +++ b/src/panels/config/script/ha-script-editor.ts @@ -22,6 +22,8 @@ import { deleteScript, getScriptEditorInitData, ScriptConfig, + MODES, + MODES_MAX, } from "../../../data/script"; import { showConfirmationDialog } from "../../../dialogs/generic/show-dialog-box"; import "../../../layouts/ha-app-layout"; @@ -35,9 +37,6 @@ import "../../../components/ha-svg-icon"; import { mdiContentSave } from "@mdi/js"; import { PaperListboxElement } from "@polymer/paper-listbox"; -const MODES = ["single", "restart", "queued", "parallel"]; -const MODES_MAX = ["queued", "parallel"]; - export class HaScriptEditor extends LitElement { @property() public hass!: HomeAssistant; 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 1105b6216e..06a49f68c1 100644 --- a/src/panels/lovelace/entity-rows/hui-script-entity-row.ts +++ b/src/panels/lovelace/entity-rows/hui-script-entity-row.ts @@ -9,17 +9,17 @@ import { PropertyValues, TemplateResult, } from "lit-element"; -import "../../../components/entity/ha-entity-toggle"; import { UNAVAILABLE_STATES } from "../../../data/entity"; import { HomeAssistant } from "../../../types"; import { hasConfigOrEntityChanged } from "../common/has-changed"; import "../components/hui-generic-entity-row"; import { createEntityNotFoundWarning } from "../components/hui-warning"; import { ActionRowConfig, LovelaceRow } from "./types"; +import { canExcecute, ScriptEntity } from "../../../data/script"; @customElement("hui-script-entity-row") class HuiScriptEntityRow extends LitElement implements LovelaceRow { - public hass?: HomeAssistant; + @property() public hass?: HomeAssistant; @property() private _config?: ActionRowConfig; @@ -39,7 +39,7 @@ class HuiScriptEntityRow extends LitElement implements LovelaceRow { return html``; } - const stateObj = this.hass.states[this._config.entity]; + const stateObj = this.hass.states[this._config.entity] as ScriptEntity; if (!stateObj) { return html` @@ -51,39 +51,51 @@ class HuiScriptEntityRow extends LitElement implements LovelaceRow { return html` - ${stateObj.attributes.can_cancel - ? html` - - ` - : html` - - ${this._config.action_name || - this.hass!.localize("ui.card.script.execute")} - - `} + ${stateObj.state === "on" + ? html` + ${(stateObj.attributes.current || 0) > 0 + ? this.hass.localize( + "ui.card.script.cancel_multiple", + "number", + stateObj.attributes.current + ) + : this.hass.localize("ui.card.script.cancel")} + ` + : ""} + ${stateObj.state === "off" || stateObj.attributes.max + ? html` + ${this._config.action_name || + this.hass!.localize("ui.card.script.execute")} + ` + : ""} `; } static get styles(): CSSResult { return css` - mwc-button { + mwc-button:last-child { margin-right: -0.57em; } `; } - private _callService(ev): void { + private _cancelScript(ev): void { ev.stopPropagation(); - this.hass!.callService("script", "turn_on", { + this._callService("turn_off"); + } + + private _executeScript(ev): void { + ev.stopPropagation(); + this._callService("turn_on"); + } + + private _callService(service: string): void { + this.hass!.callService("script", service, { entity_id: this._config!.entity, }); } diff --git a/src/state-summary/state-card-script.js b/src/state-summary/state-card-script.js deleted file mode 100644 index 462467b363..0000000000 --- a/src/state-summary/state-card-script.js +++ /dev/null @@ -1,74 +0,0 @@ -import "@material/mwc-button"; -import "@polymer/iron-flex-layout/iron-flex-layout-classes"; -import { html } from "@polymer/polymer/lib/utils/html-tag"; -/* eslint-plugin-disable lit */ -import { PolymerElement } from "@polymer/polymer/polymer-element"; -import "../components/entity/ha-entity-toggle"; -import "../components/entity/state-info"; -import LocalizeMixin from "../mixins/localize-mixin"; - -/* - * @appliesMixin LocalizeMixin - */ -class StateCardScript extends LocalizeMixin(PolymerElement) { - static get template() { - return html` - - - -
- ${this.stateInfoTemplate} - - -
- `; - } - - static get stateInfoTemplate() { - return html` - - `; - } - - static get properties() { - return { - hass: Object, - stateObj: Object, - inDialog: { - type: Boolean, - value: false, - }, - }; - } - - fireScript(ev) { - ev.stopPropagation(); - this.hass.callService("script", "turn_on", { - entity_id: this.stateObj.entity_id, - }); - } -} -customElements.define("state-card-script", StateCardScript); diff --git a/src/state-summary/state-card-script.ts b/src/state-summary/state-card-script.ts new file mode 100644 index 0000000000..da04bff86a --- /dev/null +++ b/src/state-summary/state-card-script.ts @@ -0,0 +1,77 @@ +import "@material/mwc-button"; +import "../components/entity/ha-entity-toggle"; +import "../components/entity/state-info"; +import { HomeAssistant } from "../types"; +import { + html, + customElement, + LitElement, + property, + CSSResult, +} from "lit-element"; +import { HassEntity } from "home-assistant-js-websocket"; +import { haStyle } from "../resources/styles"; +import { UNAVAILABLE_STATES } from "../data/entity"; +import { canExcecute, ScriptEntity } from "../data/script"; + +@customElement("state-card-script") +export class StateCardScript extends LitElement { + @property() public hass!: HomeAssistant; + + @property() public stateObj!: HassEntity; + + @property({ type: Boolean }) public inDialog = false; + + protected render() { + const stateObj = this.stateObj as ScriptEntity; + return html` +
+ + ${stateObj.state === "on" + ? html` + ${(stateObj.attributes.current || 0) > 0 + ? this.hass.localize( + "ui.card.script.cancel_multiple", + "number", + stateObj.attributes.current + ) + : this.hass.localize("ui.card.script.cancel")} + ` + : ""} + ${stateObj.state === "off" || stateObj.attributes.max + ? html` + ${this.hass!.localize("ui.card.script.execute")} + ` + : ""} +
+ `; + } + + private _cancelScript(ev: Event) { + ev.stopPropagation(); + this._callService("turn_off"); + } + + private _executeScript(ev: Event) { + ev.stopPropagation(); + this._callService("turn_on"); + } + + private _callService(service: string): void { + this.hass.callService("script", service, { + entity_id: this.stateObj.entity_id, + }); + } + + static get styles(): CSSResult { + return haStyle; + } +} diff --git a/src/translations/en.json b/src/translations/en.json index c6fb6c4a17..9010307a42 100755 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -188,7 +188,9 @@ "activate": "Activate" }, "script": { - "execute": "Execute" + "execute": "Execute", + "cancel": "Cancel", + "cancel_multiple": "Cancel {number}" }, "service": { "run": "Run" From d1dd8231cd4c28406ad87522fccebc3d98108181 Mon Sep 17 00:00:00 2001 From: Bram Kragten Date: Tue, 14 Jul 2020 21:58:24 +0200 Subject: [PATCH 12/46] Allow to set an id and icon when creating new script (#6373) Co-authored-by: Paulus Schoutsen --- src/common/string/slugify.ts | 16 ++--- src/data/script.ts | 1 + src/panels/config/script/ha-script-editor.ts | 70 ++++++++++++++++++-- src/panels/config/script/ha-script-picker.ts | 7 ++ src/translations/en.json | 4 ++ 5 files changed, 85 insertions(+), 13 deletions(-) diff --git a/src/common/string/slugify.ts b/src/common/string/slugify.ts index 05c6f3352c..a5f0c134cb 100644 --- a/src/common/string/slugify.ts +++ b/src/common/string/slugify.ts @@ -1,19 +1,19 @@ // https://gist.github.com/hagemann/382adfc57adbd5af078dc93feef01fe1 -export const slugify = (value: string) => { +export const slugify = (value: string, delimiter = "-") => { const a = "àáäâãåăæąçćčđďèéěėëêęğǵḧìíïîįłḿǹńňñòóöôœøṕŕřßşśšșťțùúüûǘůűūųẃẍÿýźžż·/_,:;"; - const b = - "aaaaaaaaacccddeeeeeeegghiiiiilmnnnnooooooprrsssssttuuuuuuuuuwxyyzzz------"; + const b = `aaaaaaaaacccddeeeeeeegghiiiiilmnnnnooooooprrsssssttuuuuuuuuuwxyyzzz${delimiter}${delimiter}${delimiter}${delimiter}${delimiter}${delimiter}`; const p = new RegExp(a.split("").join("|"), "g"); return value .toString() .toLowerCase() - .replace(/\s+/g, "-") // Replace spaces with - + .replace(/\s+/g, delimiter) // Replace spaces with delimiter .replace(p, (c) => b.charAt(a.indexOf(c))) // Replace special characters - .replace(/&/g, "-and-") // Replace & with 'and' + .replace(/&/g, `${delimiter}and${delimiter}`) // Replace & with 'and' .replace(/[^\w-]+/g, "") // Remove all non-word characters - .replace(/--+/g, "-") // Replace multiple - with single - - .replace(/^-+/, "") // Trim - from start of text - .replace(/-+$/, ""); // Trim - from end of text + .replace(/-/, delimiter) // Replace - with delimiter + .replace(new RegExp(`/${delimiter}${delimiter}+/`, "g"), delimiter) // Replace multiple delimiters with single delimiter + .replace(new RegExp(`/^${delimiter}+/`), "") // Trim delimiter from start of text + .replace(new RegExp(`/-+$/`), ""); // Trim delimiter from end of text }; diff --git a/src/data/script.ts b/src/data/script.ts index 81f8292f24..2a2cf1912c 100644 --- a/src/data/script.ts +++ b/src/data/script.ts @@ -22,6 +22,7 @@ export interface ScriptEntity extends HassEntityBase { export interface ScriptConfig { alias: string; sequence: Action[]; + icon?: string; mode?: "single" | "restart" | "queued" | "parallel"; max?: number; } diff --git a/src/panels/config/script/ha-script-editor.ts b/src/panels/config/script/ha-script-editor.ts index 68f334383a..4617f1a01b 100644 --- a/src/panels/config/script/ha-script-editor.ts +++ b/src/panels/config/script/ha-script-editor.ts @@ -10,12 +10,14 @@ import { property, PropertyValues, TemplateResult, + internalProperty, } from "lit-element"; import { classMap } from "lit-html/directives/class-map"; import { computeObjectId } from "../../../common/entity/compute_object_id"; import { navigate } from "../../../common/navigate"; import { computeRTL } from "../../../common/util/compute_rtl"; import "../../../components/ha-card"; +import "../../../components/ha-icon-input"; import "@material/mwc-fab"; import { Action, @@ -36,6 +38,7 @@ import { configSections } from "../ha-panel-config"; import "../../../components/ha-svg-icon"; import { mdiContentSave } from "@mdi/js"; import { PaperListboxElement } from "@polymer/paper-listbox"; +import { slugify } from "../../../common/string/slugify"; export class HaScriptEditor extends LitElement { @property() public hass!: HomeAssistant; @@ -48,11 +51,15 @@ export class HaScriptEditor extends LitElement { @property() public narrow!: boolean; - @property() private _config?: ScriptConfig; + @internalProperty() private _config?: ScriptConfig; - @property() private _dirty?: boolean; + @internalProperty() private _entityId?: string; - @property() private _errors?: string; + @internalProperty() private _idError = false; + + @internalProperty() private _dirty?: boolean; + + @internalProperty() private _errors?: string; protected render(): TemplateResult { return html` @@ -107,9 +114,32 @@ export class HaScriptEditor extends LitElement { name="alias" .value=${this._config.alias} @value-changed=${this._valueChanged} + @change=${this._aliasChanged} > - + + + ${!this.scriptEntityId + ? html` + ` + : ""}

${this.hass.localize( "ui.panel.config.script.editor.modes.description", @@ -283,6 +313,30 @@ export class HaScriptEditor extends LitElement { this._dirty = true; } + private _aliasChanged(ev: CustomEvent) { + if (this.scriptEntityId || this._entityId) { + return; + } + const aliasSlugify = slugify((ev.target as any).value, "_"); + let id = aliasSlugify; + let i = 2; + while (this.hass.states[`script.${id}`]) { + id = `${aliasSlugify}_${i}`; + i++; + } + this._entityId = id; + } + + private _idChanged(ev: CustomEvent) { + ev.stopPropagation(); + this._entityId = (ev.target as any).value; + if (this.hass.states[`script.${this._entityId}`]) { + this._idError = true; + } else { + this._idError = false; + } + } + private _valueChanged(ev: CustomEvent) { ev.stopPropagation(); const target = ev.target as any; @@ -337,9 +391,15 @@ export class HaScriptEditor extends LitElement { } private _saveScript(): void { + if (this._idError) { + this._errors = this.hass.localize( + "ui.panel.config.script.editor.id_already_exists_save_error" + ); + return; + } const id = this.scriptEntityId ? computeObjectId(this.scriptEntityId) - : Date.now(); + : this._entityId || Date.now(); this.hass!.callApi("POST", "config/script/config/" + id, this._config).then( () => { this._dirty = false; diff --git a/src/panels/config/script/ha-script-picker.ts b/src/panels/config/script/ha-script-picker.ts index 8fba4004ba..7135a80db0 100644 --- a/src/panels/config/script/ha-script-picker.ts +++ b/src/panels/config/script/ha-script-picker.ts @@ -25,6 +25,7 @@ import { showToast } from "../../../util/toast"; import { configSections } from "../ha-panel-config"; import "../../../components/ha-svg-icon"; import { mdiPlus } from "@mdi/js"; +import { stateIcon } from "../../../common/entity/state_icon"; @customElement("ha-script-picker") class HaScriptPicker extends LitElement { @@ -43,6 +44,7 @@ class HaScriptPicker extends LitElement { return { ...script, name: computeStateName(script), + icon: stateIcon(script), }; }); }); @@ -65,6 +67,11 @@ class HaScriptPicker extends LitElement { > `, }, + icon: { + title: "", + type: "icon", + template: (icon) => html` `, + }, name: { title: this.hass.localize( "ui.panel.config.script.picker.headers.name" diff --git a/src/translations/en.json b/src/translations/en.json index 9010307a42..cd2f1eb8a9 100755 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -1080,6 +1080,10 @@ }, "editor": { "alias": "Name", + "icon": "Icon", + "id": "Entity ID", + "id_already_exists_save_error": "You can't save this script because the ID is not unique, pick another ID or leave it blank to automatically generate one.", + "id_already_exists": "This ID already exists", "introduction": "Use scripts to execute a sequence of actions.", "header": "Script: {name}", "default_name": "New Script", From 90e14762e36b42bd64c40ef26443d01c48bbfdef Mon Sep 17 00:00:00 2001 From: Bram Kragten Date: Tue, 14 Jul 2020 21:58:40 +0200 Subject: [PATCH 13/46] Fix double toolbars on error/loading in dev tools (#6380) --- cast/src/launcher/layout/hc-cast.ts | 4 +- cast/src/launcher/layout/hc-connect.ts | 4 +- hassio/src/addon-store/hassio-addon-store.ts | 4 +- .../hassio-addon-documentation-tab.ts | 4 +- hassio/src/system/hassio-supervisor-log.ts | 4 +- src/layouts/hass-error-screen.ts | 49 +++++++++++++---- src/layouts/hass-loading-screen.ts | 52 +++++++++++++------ src/layouts/hass-router-page.ts | 12 +++-- src/layouts/hass-subpage.ts | 5 +- src/layouts/loading-screen.ts | 33 ------------ .../developer-tools/developer-tools-router.ts | 12 +++++ .../ha-panel-developer-tools.ts | 10 ++-- 12 files changed, 115 insertions(+), 78 deletions(-) delete mode 100644 src/layouts/loading-screen.ts diff --git a/cast/src/launcher/layout/hc-cast.ts b/cast/src/launcher/layout/hc-cast.ts index 099c7f70be..32139fa557 100644 --- a/cast/src/launcher/layout/hc-cast.ts +++ b/cast/src/launcher/layout/hc-cast.ts @@ -28,7 +28,7 @@ import { getLovelaceCollection, LovelaceConfig, } from "../../../../src/data/lovelace"; -import "../../../../src/layouts/loading-screen"; +import "../../../../src/layouts/hass-loading-screen"; import { generateDefaultViewConfig } from "../../../../src/panels/lovelace/common/generate-lovelace-config"; import "./hc-layout"; import "@material/mwc-button/mwc-button"; @@ -47,7 +47,7 @@ class HcCast extends LitElement { protected render(): TemplateResult { if (this.lovelaceConfig === undefined) { - return html` > `; + return html` > `; } const error = diff --git a/cast/src/launcher/layout/hc-connect.ts b/cast/src/launcher/layout/hc-connect.ts index 048a69f403..2aa72385e9 100644 --- a/cast/src/launcher/layout/hc-connect.ts +++ b/cast/src/launcher/layout/hc-connect.ts @@ -27,7 +27,7 @@ import { saveTokens, } from "../../../../src/common/auth/token_storage"; import "../../../../src/components/ha-icon"; -import "../../../../src/layouts/loading-screen"; +import "../../../../src/layouts/hass-loading-screen"; import { registerServiceWorker } from "../../../../src/util/register-service-worker"; import "./hc-layout"; @@ -98,7 +98,7 @@ export class HcConnect extends LitElement { } if (this.castManager === undefined || this.loading) { - return html` `; + return html` `; } if (this.castManager === null) { diff --git a/hassio/src/addon-store/hassio-addon-store.ts b/hassio/src/addon-store/hassio-addon-store.ts index 80f210b6e3..88dfb115c6 100644 --- a/hassio/src/addon-store/hassio-addon-store.ts +++ b/hassio/src/addon-store/hassio-addon-store.ts @@ -19,7 +19,7 @@ import { reloadHassioAddons, } from "../../../src/data/hassio/addon"; import "../../../src/layouts/hass-tabs-subpage"; -import "../../../src/layouts/loading-screen"; +import "../../../src/layouts/hass-loading-screen"; import { HomeAssistant, Route } from "../../../src/types"; import { showRepositoriesDialog } from "../dialogs/repositories/show-dialog-repositories"; import { supervisorTabs } from "../hassio-tabs"; @@ -108,7 +108,7 @@ class HassioAddonStore extends LitElement { ${repos.length === 0 - ? html`` + ? html`` : html`

diff --git a/hassio/src/system/hassio-supervisor-log.ts b/hassio/src/system/hassio-supervisor-log.ts index af3b94665d..d9f3218a7a 100644 --- a/hassio/src/system/hassio-supervisor-log.ts +++ b/hassio/src/system/hassio-supervisor-log.ts @@ -13,7 +13,7 @@ import { } from "lit-element"; import "../../../src/components/ha-card"; import { fetchHassioLogs } from "../../../src/data/hassio/supervisor"; -import "../../../src/layouts/loading-screen"; +import "../../../src/layouts/hass-loading-screen"; import { haStyle } from "../../../src/resources/styles"; import { HomeAssistant } from "../../../src/types"; import "../components/hassio-ansi-to-html"; @@ -98,7 +98,7 @@ class HassioSupervisorLog extends LitElement { ? html`` - : html``} + : html``}
Refresh diff --git a/src/layouts/hass-error-screen.ts b/src/layouts/hass-error-screen.ts index f8838eff85..eab453b29e 100644 --- a/src/layouts/hass-error-screen.ts +++ b/src/layouts/hass-error-screen.ts @@ -12,29 +12,56 @@ import "./hass-subpage"; @customElement("hass-error-screen") class HassErrorScreen extends LitElement { - @property() - public error?: string; + @property({ type: Boolean }) public toolbar = true; + + @property() public error?: string; protected render(): TemplateResult { return html` - -
-

${this.error}

- - go back - -
-
+ ${this.toolbar + ? html`
+ +
` + : ""} +
+

${this.error}

+ + go back + +
`; } - private _backTapped(): void { + private _handleBack(): void { history.back(); } static get styles(): CSSResultArray { return [ css` + :host { + display: block; + height: 100%; + background-color: var(--primary-background-color); + } + .toolbar { + display: flex; + align-items: center; + font-size: 20px; + height: 65px; + padding: 0 16px; + pointer-events: none; + background-color: var(--app-header-background-color); + font-weight: 400; + color: var(--app-header-text-color, white); + border-bottom: var(--app-header-border-bottom, none); + box-sizing: border-box; + } + ha-icon-button-arrow-prev { + pointer-events: auto; + } .content { height: calc(100% - 64px); display: flex; diff --git a/src/layouts/hass-loading-screen.ts b/src/layouts/hass-loading-screen.ts index 83021927d9..c8cdf24d97 100644 --- a/src/layouts/hass-loading-screen.ts +++ b/src/layouts/hass-loading-screen.ts @@ -16,7 +16,10 @@ import { HomeAssistant } from "../types"; @customElement("hass-loading-screen") class HassLoadingScreen extends LitElement { - @property({ type: Boolean }) public rootnav? = false; + @property({ type: Boolean, attribute: "no-toolbar" }) + public noToolbar = false; + + @property({ type: Boolean }) public rootnav = false; @property() public hass?: HomeAssistant; @@ -24,20 +27,22 @@ class HassLoadingScreen extends LitElement { protected render(): TemplateResult { return html` - - ${this.rootnav - ? html` - - ` - : html` - - `} - + ${this.noToolbar + ? "" + : html`
+ ${this.rootnav + ? html` + + ` + : html` + + `} +
`}
@@ -57,6 +62,23 @@ class HassLoadingScreen extends LitElement { height: 100%; background-color: var(--primary-background-color); } + .toolbar { + display: flex; + align-items: center; + font-size: 20px; + height: 65px; + padding: 0 16px; + pointer-events: none; + background-color: var(--app-header-background-color); + font-weight: 400; + color: var(--app-header-text-color, white); + border-bottom: var(--app-header-border-bottom, none); + box-sizing: border-box; + } + ha-menu-button, + ha-icon-button-arrow-prev { + pointer-events: auto; + } .content { height: calc(100% - 64px); display: flex; diff --git a/src/layouts/hass-router-page.ts b/src/layouts/hass-router-page.ts index d463b86ca6..450e331a73 100644 --- a/src/layouts/hass-router-page.ts +++ b/src/layouts/hass-router-page.ts @@ -169,9 +169,9 @@ export class HassRouterPage extends UpdatingElement { } // Show error screen - const errorEl = document.createElement("hass-error-screen"); - errorEl.error = `Error while loading page ${newPage}.`; - this.appendChild(errorEl); + this.appendChild( + this.createErrorScreen(`Error while loading page ${newPage}.`) + ); }); // If we don't show loading screen, just show the panel. @@ -252,6 +252,12 @@ export class HassRouterPage extends UpdatingElement { return document.createElement("hass-loading-screen"); } + protected createErrorScreen(error: string) { + const errorEl = document.createElement("hass-error-screen"); + errorEl.error = error; + return errorEl; + } + /** * Rebuild the current panel. * diff --git a/src/layouts/hass-subpage.ts b/src/layouts/hass-subpage.ts index 4eb7a3153e..2039b7654f 100644 --- a/src/layouts/hass-subpage.ts +++ b/src/layouts/hass-subpage.ts @@ -36,7 +36,7 @@ class HassSubpage extends LitElement { class=${classMap({ hidden: !this.showBackButton })} > -
${this.header}
+
${this.header}
@@ -74,7 +74,6 @@ class HassSubpage extends LitElement { box-sizing: border-box; } - ha-menu-button, ha-icon-button-arrow-prev, ::slotted([slot="toolbar-icon"]) { pointer-events: auto; @@ -84,7 +83,7 @@ class HassSubpage extends LitElement { visibility: hidden; } - [main-title] { + .main-title { margin: 0 0 0 24px; line-height: 20px; flex-grow: 1; diff --git a/src/layouts/loading-screen.ts b/src/layouts/loading-screen.ts deleted file mode 100644 index 5d0270c261..0000000000 --- a/src/layouts/loading-screen.ts +++ /dev/null @@ -1,33 +0,0 @@ -import { - css, - CSSResult, - customElement, - html, - LitElement, - TemplateResult, -} from "lit-element"; -import "../components/ha-circular-progress"; - -@customElement("loading-screen") -class LoadingScreen extends LitElement { - protected render(): TemplateResult { - return html` `; - } - - static get styles(): CSSResult { - return css` - :host { - height: 100%; - display: flex; - align-items: center; - justify-content: center; - } - `; - } -} - -declare global { - interface HTMLElementTagNameMap { - "loading-screen": LoadingScreen; - } -} diff --git a/src/panels/developer-tools/developer-tools-router.ts b/src/panels/developer-tools/developer-tools-router.ts index 26337446b3..e7f4e78c2a 100644 --- a/src/panels/developer-tools/developer-tools-router.ts +++ b/src/panels/developer-tools/developer-tools-router.ts @@ -40,6 +40,18 @@ class DeveloperToolsRouter extends HassRouterPage { }, }; + protected createLoadingScreen() { + const loadingScreen = super.createLoadingScreen(); + loadingScreen.noToolbar = true; + return loadingScreen; + } + + protected createErrorScreen(error: string) { + const errorEl = super.createErrorScreen(error); + errorEl.toolbar = false; + return errorEl; + } + protected updatePageEl(el) { if ("setProperties" in el) { // As long as we have Polymer pages diff --git a/src/panels/developer-tools/ha-panel-developer-tools.ts b/src/panels/developer-tools/ha-panel-developer-tools.ts index 98542c9365..b306a5fe33 100644 --- a/src/panels/developer-tools/ha-panel-developer-tools.ts +++ b/src/panels/developer-tools/ha-panel-developer-tools.ts @@ -1,6 +1,6 @@ -import "@polymer/app-layout/app-header-layout/app-header-layout"; import "@polymer/app-layout/app-header/app-header"; import "@polymer/app-layout/app-toolbar/app-toolbar"; +import "../../layouts/ha-app-layout"; import "../../components/ha-icon-button"; import "@polymer/paper-tabs/paper-tab"; import "@polymer/paper-tabs/paper-tabs"; @@ -36,7 +36,7 @@ class PanelDeveloperTools extends LitElement { protected render(): TemplateResult { const page = this._page; return html` - + - + `; } @@ -107,6 +107,10 @@ class PanelDeveloperTools extends LitElement { color: var(--primary-text-color); --paper-card-header-color: var(--primary-text-color); } + developer-tools-router { + display: block; + height: calc(100vh - 112px); + } paper-tabs { margin-left: 12px; --paper-tabs-selection-bar-color: #fff; From 8b3b40e6276c90c9499076d02201cd4fa15656f0 Mon Sep 17 00:00:00 2001 From: Ian Richardson Date: Tue, 14 Jul 2020 16:26:21 -0500 Subject: [PATCH 14/46] Button Card: Option to show state (#6383) --- src/panels/lovelace/cards/hui-button-card.ts | 16 +++++++++++++ src/panels/lovelace/cards/types.ts | 1 + .../config-elements/hui-button-card-editor.ts | 23 +++++++++++++++++-- 3 files changed, 38 insertions(+), 2 deletions(-) diff --git a/src/panels/lovelace/cards/hui-button-card.ts b/src/panels/lovelace/cards/hui-button-card.ts index 0e6bc2d874..9a65aad8fc 100644 --- a/src/panels/lovelace/cards/hui-button-card.ts +++ b/src/panels/lovelace/cards/hui-button-card.ts @@ -36,6 +36,7 @@ import { hasAction } from "../common/has-action"; import { createEntityNotFoundWarning } from "../components/hui-warning"; import { LovelaceCard, LovelaceCardEditor } from "../types"; import { ButtonCardConfig } from "./types"; +import { computeStateDisplay } from "../../../common/entity/compute_state_display"; @customElement("hui-button-card") export class HuiButtonCard extends LitElement implements LovelaceCard { @@ -66,6 +67,7 @@ export class HuiButtonCard extends LitElement implements LovelaceCard { hold_action: { action: "more-info" }, show_icon: true, show_name: true, + show_state: false, entity: foundEntities[0] || "", }; } @@ -203,6 +205,15 @@ export class HuiButtonCard extends LitElement implements LovelaceCard { ` : ""} + ${this._config.show_state && stateObj + ? html` + ${computeStateDisplay( + this.hass.localize, + stateObj, + this.hass.language + )} + ` + : ""} ${this._shouldRenderRipple ? html`` : ""} `; @@ -282,6 +293,11 @@ export class HuiButtonCard extends LitElement implements LovelaceCard { outline: none; } + .state { + font-size: 0.9rem; + color: var(--secondary-text-color); + } + ${iconColorCSS} `; } diff --git a/src/panels/lovelace/cards/types.ts b/src/panels/lovelace/cards/types.ts index c003fb32ab..8ea3d859b5 100644 --- a/src/panels/lovelace/cards/types.ts +++ b/src/panels/lovelace/cards/types.ts @@ -71,6 +71,7 @@ export interface ButtonCardConfig extends LovelaceCardConfig { hold_action?: ActionConfig; double_tap_action?: ActionConfig; state_color?: boolean; + show_state?: boolean; } export interface EntityFilterCardConfig extends LovelaceCardConfig { 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 0ff82af4c6..c76a8ded9c 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 @@ -38,6 +38,7 @@ const cardConfigStruct = struct({ tap_action: struct.optional(actionConfigStruct), hold_action: struct.optional(actionConfigStruct), theme: "string?", + show_state: "boolean?", }); @customElement("hui-button-card-editor") @@ -64,6 +65,10 @@ export class HuiButtonCardEditor extends LitElement return this._config!.show_name || true; } + get _show_state(): boolean { + return this._config!.show_state || false; + } + get _icon(): string { return this._config!.icon || ""; } @@ -153,12 +158,26 @@ export class HuiButtonCardEditor extends LitElement .dir=${dir} > +
+ + + +
From 7cf396b518900ee3b6a6a83cd9375e71df8aa0cf Mon Sep 17 00:00:00 2001 From: Bram Kragten Date: Tue, 14 Jul 2020 23:36:14 +0200 Subject: [PATCH 15/46] Bumped version to 20200714.0 --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 904d1ff62f..6db083fc4d 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ from setuptools import setup, find_packages setup( name="home-assistant-frontend", - version="20200702.0", + version="20200714.0", description="The Home Assistant frontend", url="https://github.com/home-assistant/home-assistant-polymer", author="The Home Assistant Authors", From 9cd2d0df93c3df54d81b044ab90deeafc8a41b8c Mon Sep 17 00:00:00 2001 From: HomeAssistant Azure Date: Wed, 15 Jul 2020 00:32:18 +0000 Subject: [PATCH 16/46] [ci skip] Translation update --- translations/frontend/ca.json | 27 ++++++++++++++++++++ translations/frontend/cs.json | 38 +++++++++++++-------------- translations/frontend/en.json | 7 +++++ translations/frontend/ru.json | 9 +++++++ translations/frontend/zh-Hant.json | 41 +++++++++++++++++++++++++++--- 5 files changed, 100 insertions(+), 22 deletions(-) diff --git a/translations/frontend/ca.json b/translations/frontend/ca.json index 232718650c..9f81282090 100644 --- a/translations/frontend/ca.json +++ b/translations/frontend/ca.json @@ -941,6 +941,19 @@ "introduction": "Utilitza les automatitzacions per donar més vida a la teva casa", "load_error_not_editable": "Només es poden editar les automatitzacions de l'arxiu automations.yaml.", "load_error_unknown": "Error en carregar l'automatització ({err_no}).", + "max": { + "parallel": "Nombre màxim d'execucions paral·leles", + "queued": "Longitud de la cua" + }, + "modes": { + "description": "El mode controla què passa quan es dispara l'automatització i encara hi ha accions executant-se d'un disparament anterior. Consulta {documentation_link} per a més informació.", + "documentation": "documentació d'automatització", + "label": "Mode", + "parallel": "Paral·lel (per defecte)", + "queued": "A la cua", + "restart": "Reinicia", + "single": "Individual" + }, "move_down": "Mou avall", "move_up": "Mou amunt", "save": "Desa", @@ -1685,6 +1698,19 @@ "introduction": "Utilitza els scripts per executar seqüències d'accions.", "link_available_actions": "Més informació sobre les accions disponibles.", "load_error_not_editable": "Només es poden editar els scripts dins de l'arxiu scripts.yaml.", + "max": { + "parallel": "Nombre màxim d'execucions paral·leles", + "queued": "Longitud de la cua" + }, + "modes": { + "description": "El mode controla què passa quan s'invoca l'script mentre encara s'està executant a causa d'invocacions anteriors. Consulta {documentation_link} per a més informació.", + "documentation": "documentació de scripts", + "label": "Mode", + "parallel": "Paral·lel", + "queued": "A la cua", + "restart": "Reinicia", + "single": "Individual (per defecte)" + }, "sequence": "Seqüència", "sequence_sentence": "Seqüència d'accions de l'script." }, @@ -2511,6 +2537,7 @@ }, "trusted_networks": { "abort": { + "not_allowed": "El teu equip no està permès.", "not_whitelisted": "El teu ordinador no es troba accessible a la llista." }, "step": { diff --git a/translations/frontend/cs.json b/translations/frontend/cs.json index e3c9659867..6ab2b5b713 100644 --- a/translations/frontend/cs.json +++ b/translations/frontend/cs.json @@ -65,13 +65,13 @@ }, "state_badge": { "alarm_control_panel": { - "armed": "Aktivní", - "armed_away": "Aktivní", - "armed_custom_bypass": "Aktivní", - "armed_home": "Aktivní", - "armed_night": "Aktivní", + "armed": "Zabezpečeno", + "armed_away": "Zabezpečeno", + "armed_custom_bypass": "Zabezpečeno", + "armed_home": "Zabezpečeno", + "armed_night": "Zabezpečeno", "arming": "Aktivace", - "disarmed": "Neaktivní", + "disarmed": "Nezabezpečeno", "disarming": "Deaktivace", "pending": "Čeká", "triggered": "Spuštěn" @@ -93,15 +93,15 @@ }, "state": { "alarm_control_panel": { - "armed": "Aktivní", - "armed_away": "Aktivní režim mimo domov", + "armed": "Zabezpečeno", + "armed_away": "Režim nepřítomnost", "armed_custom_bypass": "Aktivní uživatelským obejitím", - "armed_home": "Aktivní režim doma", - "armed_night": "Aktivní noční režim", - "arming": "Aktivování", - "disarmed": "Neaktivní", - "disarming": "Deaktivování", - "pending": "Nadcházející", + "armed_home": "Režim domov", + "armed_night": "Noční režim", + "arming": "Zabezpečování", + "disarmed": "Nezabezpečeno", + "disarming": "Odbezpečování", + "pending": "Čekající", "triggered": "Spuštěno" }, "automation": { @@ -349,13 +349,13 @@ }, "card": { "alarm_control_panel": { - "arm_away": "Aktivovat režim mimo domov", + "arm_away": "Aktivovat režim nepřítomnost", "arm_custom_bypass": "Vlastní obejítí", "arm_home": "Aktivovat režim domov", "arm_night": "Aktivovat noční režim", "clear_code": "Zrušit", "code": "Kód", - "disarm": "Deaktivovat" + "disarm": "Odbezpečit" }, "automation": { "last_triggered": "Naposledy spuštěno", @@ -2116,7 +2116,7 @@ "clear_items": "Vymazat označené položky" }, "starting": { - "description": "Home Assistant se spouští, čekejte prosím.", + "description": "Home Assistant se spouští, čekejte prosím...", "header": "Home Assistant se spouští..." } }, @@ -2127,8 +2127,8 @@ "editor": { "card": { "alarm-panel": { - "available_states": "Dostupné stavy", - "description": "Karta Alarm panel umožňuje aktivovat či deaktivovat alarm integrací zabezpečovacích systémů.", + "available_states": "Dostupné režimy", + "description": "Karta Ovládací panel alarmu umožňuje aktivovat či deaktivovat alarm integrací zabezpečovacích systémů.", "name": "Ovládací panel alarmu" }, "button": { diff --git a/translations/frontend/en.json b/translations/frontend/en.json index 20d8cc2a95..e41284926c 100644 --- a/translations/frontend/en.json +++ b/translations/frontend/en.json @@ -430,6 +430,8 @@ "activate": "Activate" }, "script": { + "cancel": "Cancel", + "cancel_multiple": "Cancel {number}", "execute": "Execute" }, "service": { @@ -1662,6 +1664,7 @@ "introduction": "Entities that do not belong to a device can be set here.", "without_device": "Entities without device" }, + "icon": "Icon", "introduction": "Use scenes to bring your home alive.", "load_error_not_editable": "Only scenes in scenes.yaml are editable.", "load_error_unknown": "Error loading scene ({err_no}).", @@ -1695,6 +1698,10 @@ "delete_confirm": "Are you sure you want to delete this script?", "delete_script": "Delete script", "header": "Script: {name}", + "icon": "Icon", + "id": "Entity ID", + "id_already_exists": "This ID already exists", + "id_already_exists_save_error": "You can't save this script because the ID is not unique, pick another ID or leave it blank to automatically generate one.", "introduction": "Use scripts to execute a sequence of actions.", "link_available_actions": "Learn more about available actions.", "load_error_not_editable": "Only scripts inside scripts.yaml are editable.", diff --git a/translations/frontend/ru.json b/translations/frontend/ru.json index e62fccb3d5..ebab530ffd 100644 --- a/translations/frontend/ru.json +++ b/translations/frontend/ru.json @@ -941,6 +941,11 @@ "introduction": "Используйте автоматизацию, чтобы оживить Ваш дом.", "load_error_not_editable": "Доступны для редактирования только автоматизации из automations.yaml.", "load_error_unknown": "Ошибка загрузки автоматизации ({err_no}).", + "modes": { + "description": "Режим управляет тем, что происходит при срабатывании автоматизации, когда действия еще выполняются с предыдущего триггера. Ознакомьтесь с {documentation_link} для получения дополнительной информации.", + "documentation": "инструкциями", + "label": "Режим" + }, "move_down": "Переместить ниже", "move_up": "Переместить выше", "save": "Сохранить", @@ -1685,6 +1690,9 @@ "introduction": "Используйте сценарии для выполнения последовательности действий.", "link_available_actions": "Узнайте больше о действиях", "load_error_not_editable": "Доступны для редактирования только сценарии из scripts.yaml.", + "modes": { + "label": "Режим" + }, "sequence": "Последовательность", "sequence_sentence": "Последовательность действий этого сценария." }, @@ -2511,6 +2519,7 @@ }, "trusted_networks": { "abort": { + "not_allowed": "Доступ с этого устройства запрещён", "not_whitelisted": "Ваш компьютер не включён в белый список." }, "step": { diff --git a/translations/frontend/zh-Hant.json b/translations/frontend/zh-Hant.json index 3a1d810592..b6d8ba5e07 100644 --- a/translations/frontend/zh-Hant.json +++ b/translations/frontend/zh-Hant.json @@ -525,6 +525,9 @@ "clear": "未觸發", "show_areas": "顯示分區" }, + "data-table": { + "search": "搜尋" + }, "date-range-picker": { "end_date": "結束日期", "select": "選擇", @@ -938,6 +941,19 @@ "introduction": "使用自動化來讓你的智能家居更有魅力吧。", "load_error_not_editable": "僅有 automations.yaml 內的自動化方能編輯。", "load_error_unknown": "載入自動化錯誤({err_no})。", + "max": { + "parallel": "最高並行執行數", + "queued": "佇列長度" + }, + "modes": { + "description": "該模式控制當執行自動化時、超過一個以上的自動化仍在執行時的狀況。請參閱 {documentation_link} 以獲得更詳細資訊。", + "documentation": "自動化文件", + "label": "模式", + "parallel": "並行(預設)", + "queued": "已佇列", + "restart": "重啟", + "single": "單一" + }, "move_down": "向下移動", "move_up": "向上移動", "save": "儲存", @@ -1356,6 +1372,7 @@ "confirm_text": "假如包含此些物件,應該從 Lovelace 設定與自動化中進行移除。", "confirm_title": "是否要移除 {number} 個物件?" }, + "search": "搜尋物件", "selected": "已選擇 {number} 個", "status": { "disabled": "已關閉", @@ -1386,7 +1403,8 @@ "entity_id": "物件 ID", "name": "名稱", "type": "類別" - } + }, + "no_helpers": "目前尚沒有任何 Helper!" }, "types": { "input_boolean": "開關", @@ -1490,7 +1508,8 @@ "note_about_integrations": "目前並非所有整合皆可以透過 UI 進行設定。", "note_about_website_reference": "更多資訊請參閱", "rename_dialog": "編輯設定物件名稱", - "rename_input_label": "物件名稱" + "rename_input_label": "物件名稱", + "search": "搜尋整合" }, "introduction": "此處為 Home Assistant 和元件相關配置區,目前尚未支援透過 UI 進行所有設定,我們正在努力改進中。", "logs": { @@ -1679,6 +1698,19 @@ "introduction": "使用腳本以執行一連串的動作。", "link_available_actions": "詳細了解可使用動作", "load_error_not_editable": "僅有於 scripts.yaml 檔案內的腳本,方能進行編輯。", + "max": { + "parallel": "最高並行執行數", + "queued": "佇列長度" + }, + "modes": { + "description": "該模式控制當執行腳本時、超過一個以上的腳本仍在執行時的狀況。請參閱 {documentation_link} 以獲得更詳細資訊。", + "documentation": "腳本文件", + "label": "模式", + "parallel": "並行", + "queued": "已佇列", + "restart": "重啟", + "single": "單一(預設)" + }, "sequence": "連續", "sequence_sentence": "此腳本所含的操作動作。" }, @@ -2194,6 +2226,7 @@ "name": "名稱", "no_theme": "沒有主題", "refresh_interval": "更新間隔", + "search": "搜尋", "secondary_info_attribute": "次要資訊屬性", "show_icon": "顯示圖示?", "show_name": "顯示名稱?", @@ -2314,7 +2347,8 @@ "edit_lovelace": { "edit_title": "編輯標題", "explanation": "此為 Lovelace UI 所有分視圖上方之標題。", - "header": "Lovelace UI 的標題" + "header": "Lovelace UI 的標題", + "title": "標題" }, "edit_view": { "add": "新增視圖", @@ -2503,6 +2537,7 @@ }, "trusted_networks": { "abort": { + "not_allowed": "電腦未被允許。", "not_whitelisted": "電腦尚未加入許可清單。" }, "step": { From f8c5eeab5db76f2a14b6c8b51ddb045049d53599 Mon Sep 17 00:00:00 2001 From: Bram Kragten Date: Wed, 15 Jul 2020 06:38:36 +0200 Subject: [PATCH 17/46] Replace all private properties with internalProperty decorator (#6386) --- cast/src/launcher/layout/hc-cast.ts | 5 ++-- cast/src/launcher/layout/hc-connect.ts | 14 +++++------ cast/src/receiver/layout/hc-demo.ts | 12 +++++++--- cast/src/receiver/layout/hc-launch-screen.ts | 2 +- cast/src/receiver/layout/hc-lovelace.ts | 4 ++-- cast/src/receiver/layout/hc-main.ts | 15 ++++++++---- demo/src/custom-cards/cast-demo-row.ts | 4 ++-- demo/src/custom-cards/ha-demo-card.ts | 7 +++--- .../addon-store/hassio-addon-repository.ts | 2 +- hassio/src/addon-store/hassio-addon-store.ts | 3 ++- .../addon-view/config/hassio-addon-audio.ts | 11 +++++---- .../addon-view/config/hassio-addon-config.ts | 3 ++- .../addon-view/config/hassio-addon-network.ts | 5 ++-- .../hassio-addon-documentation-tab.ts | 5 ++-- .../src/addon-view/info/hassio-addon-info.ts | 3 ++- .../src/addon-view/log/hassio-addon-logs.ts | 5 ++-- hassio/src/components/hassio-card-content.ts | 2 +- hassio/src/dashboard/hassio-addons.ts | 2 +- hassio/src/dashboard/hassio-update.ts | 9 ++++---- .../markdown/dialog-hassio-markdown.ts | 5 ++-- .../dialog-hassio-repositories.ts | 7 +++--- .../snapshot/dialog-hassio-snapshot.ts | 17 +++++++------- hassio/src/hassio-main.ts | 19 +++++++++------ .../src/ingress-view/hassio-ingress-view.ts | 5 ++-- hassio/src/snapshots/hassio-snapshots.ts | 19 +++++++-------- hassio/src/system/hassio-host-info.ts | 7 +++--- hassio/src/system/hassio-supervisor-info.ts | 5 ++-- hassio/src/system/hassio-supervisor-log.ts | 7 +++--- src/auth/ha-auth-flow.ts | 9 ++++---- src/auth/ha-authorize.ts | 5 ++-- src/common/dom/load_resource.ts | 3 ++- src/components/data-table/ha-data-table.ts | 2 +- .../device/ha-area-devices-picker.ts | 11 +++++---- .../device/ha-device-automation-picker.ts | 7 +++--- src/components/device/ha-device-picker.ts | 2 +- src/components/device/ha-devices-picker.ts | 2 +- src/components/entity/ha-entities-picker.ts | 2 +- src/components/entity/ha-entity-picker.ts | 2 +- src/components/entity/ha-entity-toggle.ts | 3 ++- src/components/entity/ha-state-label-badge.ts | 5 ++-- src/components/entity/state-badge.ts | 3 ++- src/components/ha-area-picker.ts | 5 ++-- src/components/ha-camera-stream.ts | 7 +++--- src/components/ha-code-editor.ts | 3 ++- src/components/ha-date-range-picker.ts | 2 +- .../ha-form/ha-form-multi_select.ts | 3 ++- src/components/ha-form/ha-form-string.ts | 3 ++- src/components/ha-icon-button-arrow-next.ts | 3 ++- src/components/ha-icon-button-arrow-prev.ts | 3 ++- src/components/ha-icon-button-next.ts | 3 ++- src/components/ha-icon-button-prev.ts | 3 ++- src/components/ha-icon.ts | 7 +++--- src/components/ha-menu-button.ts | 5 ++-- src/components/ha-related-items.ts | 11 +++++---- src/components/ha-sidebar.ts | 7 +++--- src/components/ha-tab.ts | 2 +- src/components/ha-yaml-editor.ts | 3 ++- src/components/map/ha-map.ts | 2 +- src/data/config_flow.ts | 8 ++++++- .../dialog-config-entry-system-options.ts | 13 ++++++----- .../config-flow/dialog-data-entry-flow.ts | 14 +++++------ .../config-flow/step-flow-pick-handler.ts | 5 ++-- .../dialog-device-registry-detail.ts | 11 +++++---- .../domain-toggler/dialog-domain-toggler.ts | 4 ++-- src/dialogs/generic/dialog-box.ts | 7 +++--- .../controls/more-info-automation.ts | 2 +- .../more-info/controls/more-info-camera.ts | 7 +++--- .../more-info/controls/more-info-climate.ts | 2 +- .../more-info/controls/more-info-counter.ts | 2 +- .../more-info/controls/more-info-default.ts | 2 +- .../controls/more-info-humidifier.ts | 2 +- .../more-info/controls/more-info-person.ts | 2 +- .../more-info/controls/more-info-script.ts | 2 +- .../more-info/controls/more-info-sun.ts | 2 +- .../more-info/controls/more-info-timer.ts | 2 +- .../more-info/controls/more-info-vacuum.ts | 2 +- .../more-info/controls/more-info-weather.ts | 2 +- src/dialogs/more-info/ha-more-info-dialog.ts | 4 ++-- src/dialogs/more-info/more-info-content.ts | 2 +- .../configurator-notification-item.ts | 2 +- .../notifications/notification-item.ts | 2 +- .../persistent-notification-item.ts | 2 +- .../ha-voice-command-dialog.ts | 9 ++++---- src/layouts/hass-loading-screen.ts | 2 +- src/layouts/hass-tabs-subpage-data-table.ts | 2 +- src/layouts/hass-tabs-subpage.ts | 5 ++-- src/layouts/home-assistant-main.ts | 2 +- src/layouts/home-assistant.ts | 13 +++++++---- src/layouts/partial-panel-resolver.ts | 2 +- src/managers/notification-manager.ts | 7 +++--- src/mixins/subscribe-mixin.ts | 2 +- src/onboarding/ha-onboarding.ts | 7 +++--- src/onboarding/onboarding-core-config.ts | 15 ++++++------ src/onboarding/onboarding-create-user.ts | 13 ++++++----- src/onboarding/onboarding-integrations.ts | 7 +++--- src/panels/calendar/ha-full-calendar.ts | 5 ++-- src/panels/calendar/ha-panel-calendar.ts | 7 +++--- .../areas/dialog-area-registry-detail.ts | 11 +++++---- .../config/areas/ha-config-area-page.ts | 5 ++-- .../config/areas/ha-config-areas-dashboard.ts | 2 +- src/panels/config/areas/ha-config-areas.ts | 16 +++++++++---- .../action/ha-automation-action-row.ts | 5 ++-- .../automation/action/ha-automation-action.ts | 2 +- .../types/ha-automation-action-condition.ts | 2 +- .../types/ha-automation-action-delay.ts | 2 +- .../types/ha-automation-action-device_id.ts | 14 +++++++---- .../types/ha-automation-action-event.ts | 2 +- .../types/ha-automation-action-scene.ts | 2 +- .../types/ha-automation-action-service.ts | 2 +- .../ha-automation-action-wait_template.ts | 2 +- .../ha-automation-condition-editor.ts | 2 +- .../condition/ha-automation-condition-row.ts | 5 ++-- .../condition/ha-automation-condition.ts | 2 +- .../types/ha-automation-condition-device.ts | 14 +++++++---- .../types/ha-automation-condition-logical.ts | 2 +- .../ha-automation-condition-numeric_state.ts | 2 +- .../types/ha-automation-condition-state.ts | 2 +- .../types/ha-automation-condition-sun.ts | 2 +- .../types/ha-automation-condition-template.ts | 2 +- .../types/ha-automation-condition-time.ts | 2 +- .../types/ha-automation-condition-zone.ts | 2 +- .../config/automation/ha-automation-editor.ts | 11 +++++---- .../config/automation/ha-automation-picker.ts | 2 +- .../config/automation/ha-config-automation.ts | 2 +- .../automation/thingtalk/dialog-thingtalk.ts | 13 ++++++----- .../thingtalk/ha-thingtalk-placeholders.ts | 9 ++++---- .../trigger/ha-automation-trigger-row.ts | 5 ++-- .../trigger/ha-automation-trigger.ts | 2 +- .../types/ha-automation-trigger-device.ts | 14 +++++++---- .../types/ha-automation-trigger-event.ts | 2 +- .../ha-automation-trigger-geo_location.ts | 2 +- .../ha-automation-trigger-homeassistant.ts | 2 +- .../types/ha-automation-trigger-mqtt.ts | 2 +- .../ha-automation-trigger-numeric_state.ts | 2 +- .../types/ha-automation-trigger-state.ts | 2 +- .../types/ha-automation-trigger-sun.ts | 2 +- .../types/ha-automation-trigger-template.ts | 2 +- .../types/ha-automation-trigger-time.ts | 2 +- .../ha-automation-trigger-time_pattern.ts | 2 +- .../types/ha-automation-trigger-webhook.ts | 2 +- .../types/ha-automation-trigger-zone.ts | 2 +- .../config/cloud/account/cloud-alexa-pref.ts | 5 ++-- .../config/cloud/account/cloud-google-pref.ts | 2 +- .../config/cloud/account/cloud-remote-pref.ts | 2 +- .../config/cloud/account/cloud-webhooks.ts | 18 +++++++++++---- src/panels/config/cloud/alexa/cloud-alexa.ts | 5 ++-- .../dialog-manage-cloudhook.ts | 10 ++++++-- .../cloud-google-assistant.ts | 5 ++-- src/panels/config/cloud/ha-config-cloud.ts | 8 +++---- src/panels/config/core/ha-config-core-form.ts | 13 ++++++----- src/panels/config/core/ha-config-name-form.ts | 7 +++--- src/panels/config/core/ha-config-url-form.ts | 11 +++++---- .../config/dashboard/ha-config-dashboard.ts | 2 +- .../config/dashboard/ha-config-navigation.ts | 2 +- .../ha-device-automation-card.ts | 2 +- .../ha-device-automation-dialog.ts | 11 +++++---- .../device-detail/ha-device-entities-card.ts | 5 ++-- .../device-detail/ha-device-info-card.ts | 2 +- .../mqtt/dialog-mqtt-device-debug-info.ts | 10 ++++---- .../mqtt/ha-device-actions-mqtt.ts | 2 +- .../mqtt/mqtt-discovery-payload.ts | 3 ++- .../mqtt/mqtt-messages.ts | 7 +++--- .../zha/ha-device-actions-zha.ts | 5 ++-- .../zha/ha-device-info-zha.ts | 5 ++-- .../config/devices/ha-config-device-page.ts | 5 ++-- .../devices/ha-config-devices-dashboard.ts | 5 ++-- .../config/devices/ha-config-devices.ts | 19 ++++++++++----- .../config/entities/dialog-entity-editor.ts | 13 ++++++----- .../settings/entity-settings-helper-tab.ts | 11 +++++---- .../entities/entity-registry-basic-editor.ts | 11 +++++---- .../entities/entity-registry-settings.ts | 15 ++++++------ .../config/entities/ha-config-entities.ts | 19 +++++++-------- src/panels/config/ha-panel-config.ts | 15 ++++++++---- .../config/helpers/dialog-helper-detail.ts | 13 ++++++----- .../helpers/forms/ha-input_boolean-form.ts | 7 +++--- .../helpers/forms/ha-input_datetime-form.ts | 9 ++++---- .../helpers/forms/ha-input_number-form.ts | 17 +++++++------- .../helpers/forms/ha-input_select-form.ts | 9 ++++---- .../helpers/forms/ha-input_text-form.ts | 15 ++++++------ .../config/helpers/ha-config-helpers.ts | 5 ++-- src/panels/config/info/ha-config-info.ts | 2 +- src/panels/config/info/integrations-card.ts | 7 ++++-- src/panels/config/info/system-health-card.ts | 5 ++-- .../integrations/ha-config-integrations.ts | 21 ++++++++++------- .../integrations/ha-integration-card.ts | 2 +- .../mqtt/mqtt-config-panel.ts | 7 +++--- .../mqtt/mqtt-subscribe-card.ts | 9 ++++---- .../zha/dialog-zha-cluster.ts | 11 +++++---- .../zha/dialog-zha-device-zigbee-info.ts | 5 ++-- .../zha/zha-add-devices-page.ts | 15 ++++++------ .../zha/zha-add-group-page.ts | 5 ++-- .../zha/zha-cluster-attributes.ts | 14 ++++++----- .../zha/zha-cluster-commands.ts | 14 ++++++----- .../zha/zha-clusters-data-table.ts | 2 +- .../integration-panels/zha/zha-clusters.ts | 7 +++--- .../zha/zha-config-dashboard-router.ts | 2 +- .../zha/zha-device-binding.ts | 11 +++++---- .../integration-panels/zha/zha-device-card.ts | 5 ++-- .../zha/zha-group-binding.ts | 13 ++++++----- .../integration-panels/zha/zha-group-page.ts | 12 ++++++---- .../zha/zha-groups-dashboard.ts | 2 +- .../integration-panels/zwave/zwave-network.ts | 9 ++++---- .../zwave/zwave-node-config.ts | 11 +++++---- .../integration-panels/zwave/zwave-values.ts | 5 ++-- .../config/logs/dialog-system-log-detail.ts | 7 +++--- src/panels/config/logs/error-log-card.ts | 5 ++-- src/panels/config/logs/ha-config-logs.ts | 2 +- src/panels/config/logs/system-log-card.ts | 5 ++-- .../dialog-lovelace-dashboard-detail.ts | 20 ++++++++-------- .../ha-config-lovelace-dashboards.ts | 5 ++-- .../config/lovelace/ha-config-lovelace.ts | 2 +- .../dialog-lovelace-resource-detail.ts | 13 ++++++----- .../resources/ha-config-lovelace-resources.ts | 5 ++-- .../config/person/dialog-person-detail.ts | 15 ++++++------ src/panels/config/person/ha-config-person.ts | 7 +++--- src/panels/config/scene/ha-config-scene.ts | 2 +- src/panels/config/scene/ha-scene-dashboard.ts | 2 +- src/panels/config/scene/ha-scene-editor.ts | 23 +++++++++++-------- src/panels/config/script/ha-config-script.ts | 2 +- src/panels/config/script/ha-script-editor.ts | 4 ++-- src/panels/config/script/ha-script-picker.ts | 2 +- .../ha-config-server-control.ts | 5 ++-- src/panels/config/users/dialog-add-user.ts | 17 +++++++------- src/panels/config/users/dialog-user-detail.ts | 13 ++++++----- src/panels/config/users/ha-config-users.ts | 2 +- src/panels/config/zone/dialog-zone-detail.ts | 21 +++++++++-------- src/panels/config/zone/ha-config-zone.ts | 11 +++++---- src/panels/custom/ha-panel-custom.ts | 2 +- .../developer-tools/developer-tools-router.ts | 2 +- .../event/event-subscribe-card.ts | 12 ++++++---- .../ha-panel-developer-tools.ts | 2 +- src/panels/history/ha-panel-history.ts | 10 ++++++-- src/panels/logbook/ha-logbook.ts | 2 +- src/panels/logbook/ha-panel-logbook.ts | 3 ++- .../badges/hui-entity-filter-badge.ts | 11 ++++++--- src/panels/lovelace/badges/hui-error-badge.ts | 4 ++-- .../lovelace/badges/hui-state-label-badge.ts | 2 +- .../lovelace/cards/hui-alarm-panel-card.ts | 5 ++-- src/panels/lovelace/cards/hui-button-card.ts | 4 ++-- .../lovelace/cards/hui-empty-state-card.ts | 2 +- .../lovelace/cards/hui-entities-card.ts | 4 ++-- src/panels/lovelace/cards/hui-entity-card.ts | 5 ++-- .../lovelace/cards/hui-entity-filter-card.ts | 11 ++++++--- src/panels/lovelace/cards/hui-error-card.ts | 4 ++-- src/panels/lovelace/cards/hui-gauge-card.ts | 7 +++--- src/panels/lovelace/cards/hui-glance-card.ts | 5 ++-- .../lovelace/cards/hui-history-graph-card.ts | 7 +++--- .../lovelace/cards/hui-humidifier-card.ts | 7 +++--- src/panels/lovelace/cards/hui-light-card.ts | 5 ++-- src/panels/lovelace/cards/hui-map-card.ts | 2 +- .../lovelace/cards/hui-markdown-card.ts | 9 ++++---- .../lovelace/cards/hui-media-control-card.ts | 17 +++++++------- src/panels/lovelace/cards/hui-picture-card.ts | 2 +- .../cards/hui-picture-elements-card.ts | 7 +++--- .../lovelace/cards/hui-picture-entity-card.ts | 5 ++-- .../lovelace/cards/hui-picture-glance-card.ts | 5 ++-- .../lovelace/cards/hui-plant-status-card.ts | 5 ++-- .../lovelace/cards/hui-safe-mode-card.ts | 2 +- .../lovelace/cards/hui-shopping-list-card.ts | 9 ++++---- src/panels/lovelace/cards/hui-stack-card.ts | 5 ++-- .../lovelace/cards/hui-starting-card.ts | 2 +- .../lovelace/cards/hui-thermostat-card.ts | 7 +++--- .../cards/hui-weather-forecast-card.ts | 5 ++-- .../lovelace/components/hui-card-options.ts | 4 ++-- .../components/hui-conditional-base.ts | 2 +- .../components/hui-entities-toggle.ts | 3 ++- .../components/hui-generic-entity-row.ts | 2 +- .../lovelace/components/hui-graph-base.ts | 3 ++- src/panels/lovelace/components/hui-image.ts | 7 +++--- .../components/hui-theme-select-editor.ts | 2 +- .../components/hui-timestamp-display.ts | 5 ++-- .../lovelace/components/hui-views-list.ts | 6 ++--- .../editor/card-editor/hui-card-editor.ts | 21 +++++++++-------- .../editor/card-editor/hui-card-picker.ts | 11 +++++---- .../editor/card-editor/hui-card-preview.ts | 2 +- .../card-editor/hui-dialog-delete-card.ts | 5 ++-- .../card-editor/hui-dialog-edit-card.ts | 17 +++++++------- .../card-editor/hui-dialog-move-card-view.ts | 4 ++-- .../card-editor/hui-dialog-suggest-card.ts | 9 ++++---- .../hui-alarm-panel-card-editor.ts | 5 ++-- .../config-elements/hui-button-card-editor.ts | 5 ++-- .../hui-conditional-card-editor.ts | 13 ++++++----- .../hui-entities-card-editor.ts | 7 +++--- .../config-elements/hui-entity-card-editor.ts | 5 ++-- .../config-elements/hui-gauge-card-editor.ts | 5 ++-- .../config-elements/hui-glance-card-editor.ts | 7 +++--- .../hui-history-graph-card-editor.ts | 7 +++--- .../hui-humidifier-card-editor.ts | 5 ++-- .../config-elements/hui-iframe-card-editor.ts | 5 ++-- .../config-elements/hui-light-card-editor.ts | 5 ++-- .../config-elements/hui-map-card-editor.ts | 7 +++--- .../hui-markdown-card-editor.ts | 5 ++-- .../hui-media-control-card-editor.ts | 5 ++-- .../hui-picture-card-editor.ts | 5 ++-- .../hui-picture-entity-card-editor.ts | 5 ++-- .../hui-picture-glance-card-editor.ts | 7 +++--- .../hui-plant-status-card-editor.ts | 5 ++-- .../config-elements/hui-sensor-card-editor.ts | 5 ++-- .../hui-shopping-list-editor.ts | 5 ++-- .../config-elements/hui-stack-card-editor.ts | 13 ++++++----- .../hui-thermostat-card-editor.ts | 5 ++-- .../hui-weather-forecast-card-editor.ts | 5 ++-- .../lovelace/editor/hui-dialog-save-config.ts | 9 ++++---- .../hui-dialog-edit-lovelace.ts | 5 ++-- .../lovelace-editor/hui-lovelace-editor.ts | 2 +- .../select-view/hui-dialog-select-view.ts | 4 ++-- .../unused-entities/hui-unused-entities.ts | 9 ++++---- .../view-editor/hui-dialog-edit-view.ts | 15 ++++++------ .../editor/view-editor/hui-view-editor.ts | 5 ++-- .../view-editor/hui-view-visibility-editor.ts | 7 +++--- .../lovelace/elements/hui-icon-element.ts | 4 ++-- .../lovelace/elements/hui-image-element.ts | 5 ++-- .../elements/hui-service-button-element.ts | 4 ++-- .../elements/hui-state-badge-element.ts | 5 ++-- .../elements/hui-state-icon-element.ts | 5 ++-- .../elements/hui-state-label-element.ts | 5 ++-- .../entity-rows/hui-climate-entity-row.ts | 5 ++-- .../entity-rows/hui-cover-entity-row.ts | 5 ++-- .../entity-rows/hui-group-entity-row.ts | 5 ++-- .../hui-input-datetime-entity-row.ts | 5 ++-- .../hui-input-number-entity-row.ts | 5 ++-- .../hui-input-select-entity-row.ts | 5 ++-- .../entity-rows/hui-input-text-entity-row.ts | 5 ++-- .../entity-rows/hui-lock-entity-row.ts | 5 ++-- .../hui-media-player-entity-row.ts | 9 ++++---- .../entity-rows/hui-scene-entity-row.ts | 5 ++-- .../entity-rows/hui-script-entity-row.ts | 5 ++-- .../entity-rows/hui-sensor-entity-row.ts | 5 ++-- .../entity-rows/hui-text-entity-row.ts | 5 ++-- .../entity-rows/hui-timer-entity-row.ts | 7 +++--- .../entity-rows/hui-toggle-entity-row.ts | 5 ++-- .../entity-rows/hui-weather-entity-row.ts | 5 ++-- src/panels/lovelace/ha-panel-lovelace.ts | 9 ++++---- .../hui-buttons-header-footer.ts | 2 +- .../header-footer/hui-graph-header-footer.ts | 5 ++-- .../hui-picture-header-footer.ts | 2 +- src/panels/lovelace/hui-editor.ts | 9 ++++---- src/panels/lovelace/hui-root.ts | 7 +++--- .../special-rows/hui-attribute-row.ts | 5 ++-- .../lovelace/special-rows/hui-button-row.ts | 4 ++-- .../lovelace/special-rows/hui-buttons-row.ts | 2 +- .../lovelace/special-rows/hui-cast-row.ts | 9 ++++---- .../lovelace/special-rows/hui-divider-row.ts | 4 ++-- .../lovelace/special-rows/hui-section-row.ts | 4 ++-- .../lovelace/special-rows/hui-text-row.ts | 4 ++-- .../lovelace/special-rows/hui-weblink-row.ts | 4 ++-- src/panels/lovelace/views/hui-panel-view.ts | 4 ++-- src/panels/lovelace/views/hui-view.ts | 9 ++++---- src/panels/profile/ha-advanced-mode-row.ts | 2 +- src/panels/profile/ha-force-narrow-row.ts | 2 +- src/panels/profile/ha-panel-profile.ts | 7 +++--- src/panels/profile/ha-pick-dashboard-row.ts | 5 ++-- src/panels/profile/ha-set-suspend-row.ts | 2 +- src/panels/profile/ha-set-vibrate-row.ts | 2 +- src/state-summary/state-card-input_select.ts | 2 +- src/state-summary/state-card-script.ts | 2 +- src/state/hass-base-mixin.ts | 2 +- 357 files changed, 1236 insertions(+), 920 deletions(-) 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 = {}; From d340f3b3838b7d1d1205713084581997f2687ffc Mon Sep 17 00:00:00 2001 From: Bram Kragten Date: Wed, 15 Jul 2020 11:31:48 +0200 Subject: [PATCH 18/46] Fix text color in gauge --- src/panels/lovelace/cards/hui-gauge-card.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/panels/lovelace/cards/hui-gauge-card.ts b/src/panels/lovelace/cards/hui-gauge-card.ts index 3d2b3ff4b9..054ea20010 100644 --- a/src/panels/lovelace/cards/hui-gauge-card.ts +++ b/src/panels/lovelace/cards/hui-gauge-card.ts @@ -256,7 +256,7 @@ class HuiGaugeCard extends LitElement implements LovelaceCard { stroke-width: 15; } .value-text { - fill: #000; + fill: var(--primary-text-color); font-size: var(--gauge-value-font-size, 1.1em); transform: translate(0, -5px); font-family: inherit; From a9071d7920f277a4d99ca101a27ff79f7118b4bb Mon Sep 17 00:00:00 2001 From: Bram Kragten Date: Wed, 15 Jul 2020 15:26:01 +0200 Subject: [PATCH 19/46] Fix long entity name streching header (#6393) --- src/dialogs/more-info/ha-more-info-dialog.ts | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/dialogs/more-info/ha-more-info-dialog.ts b/src/dialogs/more-info/ha-more-info-dialog.ts index 56ba7308ff..28c8cfb7fb 100644 --- a/src/dialogs/more-info/ha-more-info-dialog.ts +++ b/src/dialogs/more-info/ha-more-info-dialog.ts @@ -272,19 +272,22 @@ export class MoreInfoDialog extends LitElement { --mdc-dialog-max-width: 90vw; } - ha-dialog:not([data-domain="camera"]) app-toolbar { - max-width: 368px; - } - .content { width: 352px; } + ha-header-bar { + width: 400px; + } + .main-title { + overflow: hidden; + text-overflow: ellipsis; cursor: default; } - ha-dialog[data-domain="camera"] .content { + ha-dialog[data-domain="camera"] .content, + ha-dialog[data-domain="camera"] ha-header-bar { width: auto; } @@ -292,8 +295,9 @@ export class MoreInfoDialog extends LitElement { width: calc(90vw - 48px); } - :host([large]) app-toolbar { - max-width: calc(90vw - 32px); + :host([large]) ha-dialog[data-domain="camera"] .content, + :host([large]) ha-header-bar { + width: 90vw; } } From 9ad9c569a6c0a2f760fc7d0246a6e3d751a45095 Mon Sep 17 00:00:00 2001 From: Bram Kragten Date: Wed, 15 Jul 2020 15:33:55 +0200 Subject: [PATCH 20/46] Fix button position entity settings dialog (#6395) --- src/components/ha-dialog.ts | 2 +- src/dialogs/more-info/ha-more-info-dialog.ts | 1 + .../config/entities/dialog-entity-editor.ts | 1 + .../settings/entity-settings-helper-tab.ts | 66 +++++++++++-------- .../entities/entity-registry-settings.ts | 15 +++-- 5 files changed, 49 insertions(+), 36 deletions(-) diff --git a/src/components/ha-dialog.ts b/src/components/ha-dialog.ts index 03472c6495..2b87e25cfa 100644 --- a/src/components/ha-dialog.ts +++ b/src/components/ha-dialog.ts @@ -51,7 +51,7 @@ export class HaDialog extends MwcDialog { padding: var(--dialog-content-padding, 20px 24px); } .mdc-dialog .mdc-dialog__surface { - position: var(--dialog-content-position, relative); + position: var(--dialog-surface-position, relative); min-height: var(--mdc-dialog-min-height, auto); } .header_button { diff --git a/src/dialogs/more-info/ha-more-info-dialog.ts b/src/dialogs/more-info/ha-more-info-dialog.ts index 28c8cfb7fb..6ad4f15421 100644 --- a/src/dialogs/more-info/ha-more-info-dialog.ts +++ b/src/dialogs/more-info/ha-more-info-dialog.ts @@ -248,6 +248,7 @@ export class MoreInfoDialog extends LitElement { haStyleDialog, css` ha-dialog { + --dialog-surface-position: static; --dialog-content-position: static; } diff --git a/src/panels/config/entities/dialog-entity-editor.ts b/src/panels/config/entities/dialog-entity-editor.ts index a05af41466..0403b0ffc5 100644 --- a/src/panels/config/entities/dialog-entity-editor.ts +++ b/src/panels/config/entities/dialog-entity-editor.ts @@ -245,6 +245,7 @@ export class DialogEntityEditor extends LitElement { } ha-dialog { + --dialog-content-position: static; --dialog-content-padding: 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 e0e8142ca8..fbaa723ec8 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 @@ -52,6 +52,7 @@ import "../../../helpers/forms/ha-input_select-form"; import "../../../helpers/forms/ha-input_text-form"; import "../../entity-registry-basic-editor"; import type { HaEntityRegistryBasicEditor } from "../../entity-registry-basic-editor"; +import { haStyle } from "../../../../../resources/styles"; const HELPERS = { input_boolean: { @@ -219,35 +220,42 @@ export class EntityRegistrySettingsHelper extends LitElement { } } - static get styles(): CSSResult { - return css` - :host { - display: block; - padding: 0 !important; - } - .form { - padding: 20px 24px; - } - .buttons { - display: flex; - justify-content: space-between; - padding: 8px; - margin-bottom: -20px; - } - mwc-button.warning { - --mdc-theme-primary: var(--error-color); - } - .error { - color: var(--error-color); - } - .row { - margin-top: 8px; - color: var(--primary-text-color); - } - .secondary { - color: var(--secondary-text-color); - } - `; + static get styles(): CSSResult[] { + return [ + haStyle, + css` + :host { + display: block; + padding: 0 !important; + } + .form { + padding: 20px 24px; + margin-bottom: 53px; + } + .buttons { + position: absolute; + bottom: 0; + width: 100%; + box-sizing: border-box; + border-top: 1px solid + var(--mdc-dialog-scroll-divider-color, rgba(0, 0, 0, 0.12)); + display: flex; + justify-content: space-between; + padding: 8px; + background-color: var(--mdc-theme-surface, #fff); + } + .error { + color: var(--error-color); + } + .row { + margin-top: 8px; + color: var(--primary-text-color); + } + .secondary { + color: var(--secondary-text-color); + } + `, + ]; } } diff --git a/src/panels/config/entities/entity-registry-settings.ts b/src/panels/config/entities/entity-registry-settings.ts index c26c8a631f..176d669515 100644 --- a/src/panels/config/entities/entity-registry-settings.ts +++ b/src/panels/config/entities/entity-registry-settings.ts @@ -226,19 +226,22 @@ export class EntityRegistrySettings extends LitElement { css` :host { display: block; - margin-bottom: 0 !important; - padding: 0 !important; } .form { padding: 20px 24px; + margin-bottom: 53px; } .buttons { + position: absolute; + bottom: 0; + width: 100%; + box-sizing: border-box; + border-top: 1px solid + var(--mdc-dialog-scroll-divider-color, rgba(0, 0, 0, 0.12)); display: flex; - justify-content: flex-end; + justify-content: space-between; padding: 8px; - } - mwc-button.warning { - margin-right: auto; + background-color: var(--mdc-theme-surface, #fff); } ha-switch { margin-right: 16px; From 9c42ca03155b7dee7a2680aa7810a4e28cc429bc Mon Sep 17 00:00:00 2001 From: Bram Kragten Date: Wed, 15 Jul 2020 15:34:18 +0200 Subject: [PATCH 21/46] Fix filtering attributes (#6394) --- src/components/ha-attributes.ts | 2 +- src/components/ha-labeled-slider.js | 4 +-- .../more-info/controls/more-info-light.js | 30 +++++-------------- 3 files changed, 10 insertions(+), 26 deletions(-) diff --git a/src/components/ha-attributes.ts b/src/components/ha-attributes.ts index abef729cf6..a92d4912b6 100644 --- a/src/components/ha-attributes.ts +++ b/src/components/ha-attributes.ts @@ -17,7 +17,7 @@ let jsYamlPromise: Promise; class HaAttributes extends LitElement { @property() public stateObj?: HassEntity; - @property() public extraFilters?: string; + @property({ attribute: "extra-filters" }) public extraFilters?: string; protected render(): TemplateResult { if (!this.stateObj) { diff --git a/src/components/ha-labeled-slider.js b/src/components/ha-labeled-slider.js index 9939db3d1b..ef49e80077 100644 --- a/src/components/ha-labeled-slider.js +++ b/src/components/ha-labeled-slider.js @@ -15,7 +15,7 @@ class HaLabeledSlider extends PolymerElement { .title { margin-bottom: 16px; - opacity: var(--dark-primary-opacity); + color: var(--secondary-text-color); } .slider-container { @@ -24,7 +24,7 @@ class HaLabeledSlider extends PolymerElement { ha-icon { margin-top: 4px; - opacity: var(--dark-secondary-opacity); + color: var(--secondary-text-color); } ha-paper-slider { diff --git a/src/dialogs/more-info/controls/more-info-light.js b/src/dialogs/more-info/controls/more-info-light.js index f961c9c6a8..860e3c5454 100644 --- a/src/dialogs/more-info/controls/more-info-light.js +++ b/src/dialogs/more-info/controls/more-info-light.js @@ -68,26 +68,15 @@ class MoreInfoLight extends LocalizeMixin(EventsMixin(PolymerElement)) { } .segmentationButton { + display: none; position: absolute; - top: 11%; + top: 5%; transform: translate(0%, 0%); - padding: 0px; - max-height: 0px; - width: 23px; - height: 23px; - opacity: var(--dark-secondary-opacity); - overflow: hidden; - transition: max-height 0.5s ease-in; + color: var(--secondary-text-color); } - .has-color.is-on .segmentationContainer .segmentationButton { - position: absolute; - top: 11%; - transform: translate(0%, 0%); - width: 23px; - height: 23px; - padding: 0px; - opacity: var(--dark-secondary-opacity); + .has-color.is-on .segmentationButton { + display: inline-block; } .has-effect_list.is-on .effect_list, @@ -108,11 +97,6 @@ class MoreInfoLight extends LocalizeMixin(EventsMixin(PolymerElement)) { padding-top: 16px; } - .has-color.is-on .segmentationButton { - max-height: 100px; - overflow: visible; - } - .has-color.is-on ha-color-picker { max-height: 500px; overflow: visible; @@ -189,7 +173,7 @@ class MoreInfoLight extends LocalizeMixin(EventsMixin(PolymerElement)) {
@@ -217,7 +201,7 @@ class MoreInfoLight extends LocalizeMixin(EventsMixin(PolymerElement)) { `; From 135232d8809c3e373368ec899c9746c4ac772cbc Mon Sep 17 00:00:00 2001 From: Bram Kragten Date: Wed, 15 Jul 2020 15:40:55 +0200 Subject: [PATCH 22/46] Bumped version to 20200715.0 --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 6db083fc4d..cfcbecfedd 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ from setuptools import setup, find_packages setup( name="home-assistant-frontend", - version="20200714.0", + version="20200715.0", description="The Home Assistant frontend", url="https://github.com/home-assistant/home-assistant-polymer", author="The Home Assistant Authors", From e60e30642608794d878d2e60d27bfc5985b8392f Mon Sep 17 00:00:00 2001 From: Mike Knudson Date: Wed, 15 Jul 2020 11:31:05 -0600 Subject: [PATCH 23/46] Update icon_color_css.ts (#6385) * Update icon_color_css.ts Adding the "group" data-domain to CSS check for active coloring. This fixes ha-icon to change to the active color based on an "on" state. * Update icon_color_css.ts Adding, home, open, locked, and problem to the list. --- src/common/style/icon_color_css.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/common/style/icon_color_css.ts b/src/common/style/icon_color_css.ts index b2bb4e5d95..8f55eba461 100644 --- a/src/common/style/icon_color_css.ts +++ b/src/common/style/icon_color_css.ts @@ -19,7 +19,13 @@ export const iconColorCSS = css` ha-icon[data-domain="sun"][data-state="above_horizon"], ha-icon[data-domain="switch"][data-state="on"], ha-icon[data-domain="timer"][data-state="active"], - ha-icon[data-domain="vacuum"][data-state="cleaning"] { + ha-icon[data-domain="vacuum"][data-state="cleaning"], + ha-icon[data-domain="group"][data-state="on"], + ha-icon[data-domain="group"][data-state="home"], + ha-icon[data-domain="group"][data-state="open"], + ha-icon[data-domain="group"][data-state="locked"], + ha-icon[data-domain="group"][data-state="problem"] + { color: var(--paper-item-icon-active-color, #fdd835); } From f98cdd074938548f9e3d6cb5bf4d62a19d1e8624 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaroslav=20Hansl=C3=ADk?= Date: Wed, 15 Jul 2020 19:42:06 +0200 Subject: [PATCH 24/46] Added missing translation to alarm panel card (#6390) Co-authored-by: Bram Kragten --- src/panels/lovelace/cards/hui-alarm-panel-card.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/panels/lovelace/cards/hui-alarm-panel-card.ts b/src/panels/lovelace/cards/hui-alarm-panel-card.ts index 2137bca09c..72f120415e 100644 --- a/src/panels/lovelace/cards/hui-alarm-panel-card.ts +++ b/src/panels/lovelace/cards/hui-alarm-panel-card.ts @@ -191,7 +191,7 @@ class HuiAlarmPanelCard extends LitElement implements LovelaceCard { : html` `} From 21e277b8a28971754070657d02f1659bbca7591f Mon Sep 17 00:00:00 2001 From: Bram Kragten Date: Wed, 15 Jul 2020 19:56:15 +0200 Subject: [PATCH 25/46] Change default automation mode (#6398) --- src/panels/config/automation/ha-automation-editor.ts | 2 +- .../config/cloud/forgot-password/cloud-forgot-password.js | 8 ++++++-- src/translations/en.json | 4 ++-- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/panels/config/automation/ha-automation-editor.ts b/src/panels/config/automation/ha-automation-editor.ts index 5c93e80db0..3321a4956d 100644 --- a/src/panels/config/automation/ha-automation-editor.ts +++ b/src/panels/config/automation/ha-automation-editor.ts @@ -47,7 +47,7 @@ import { HaDeviceTrigger } from "./trigger/types/ha-automation-trigger-device"; import { mdiContentSave } from "@mdi/js"; import { PaperListboxElement } from "@polymer/paper-listbox"; -const MODES = ["parallel", "single", "restart", "queued"]; +const MODES = ["single", "restart", "queued", "parallel"]; const MODES_MAX = ["queued", "parallel"]; export class HaAutomationEditor extends LitElement { diff --git a/src/panels/config/cloud/forgot-password/cloud-forgot-password.js b/src/panels/config/cloud/forgot-password/cloud-forgot-password.js index 35d3c7969e..68acfeec7e 100644 --- a/src/panels/config/cloud/forgot-password/cloud-forgot-password.js +++ b/src/panels/config/cloud/forgot-password/cloud-forgot-password.js @@ -45,9 +45,13 @@ class CloudForgotPassword extends LocalizeMixin(EventsMixin(PolymerElement)) { display: none; } - +
- +

[[localize('ui.panel.config.cloud.forgot_password.instructions')]] diff --git a/src/translations/en.json b/src/translations/en.json index cd2f1eb8a9..9dcdeb92e0 100755 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -847,10 +847,10 @@ "label": "Mode", "description": "The mode controls what happens when the automation is triggered while the actions are still running from a previous trigger. Check the {documentation_link} for more info.", "documentation": "automation documentation", - "single": "Single", + "single": "Single (default)", "restart": "Restart", "queued": "Queued", - "parallel": "Parallel (default)" + "parallel": "Parallel" }, "max": { "queued": "Queue length", From d154fcbd7177f299d98cb58d2774aa5ac7ca50ec Mon Sep 17 00:00:00 2001 From: Bram Kragten Date: Wed, 15 Jul 2020 19:56:56 +0200 Subject: [PATCH 26/46] Bumped version to 20200715.1 --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index cfcbecfedd..21c1ec8bc5 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ from setuptools import setup, find_packages setup( name="home-assistant-frontend", - version="20200715.0", + version="20200715.1", description="The Home Assistant frontend", url="https://github.com/home-assistant/home-assistant-polymer", author="The Home Assistant Authors", From 32359adb6d82111878ec890e8a0eae6488d8c41b Mon Sep 17 00:00:00 2001 From: HomeAssistant Azure Date: Thu, 16 Jul 2020 00:32:14 +0000 Subject: [PATCH 27/46] [ci skip] Translation update --- translations/frontend/cs.json | 58 ++++++++++++++++++++++++++---- translations/frontend/en.json | 4 +-- translations/frontend/es.json | 34 ++++++++++++++++++ translations/frontend/fr.json | 33 +++++++++++++++++ translations/frontend/ru.json | 6 ++++ translations/frontend/zh-Hant.json | 7 ++++ 6 files changed, 134 insertions(+), 8 deletions(-) diff --git a/translations/frontend/cs.json b/translations/frontend/cs.json index 6ab2b5b713..db41b222b9 100644 --- a/translations/frontend/cs.json +++ b/translations/frontend/cs.json @@ -70,9 +70,9 @@ "armed_custom_bypass": "Zabezpečeno", "armed_home": "Zabezpečeno", "armed_night": "Zabezpečeno", - "arming": "Aktivace", + "arming": "Zabezpečování", "disarmed": "Nezabezpečeno", - "disarming": "Deaktivace", + "disarming": "Odbezpečování", "pending": "Čeká", "triggered": "Spuštěn" }, @@ -95,7 +95,7 @@ "alarm_control_panel": { "armed": "Zabezpečeno", "armed_away": "Režim nepřítomnost", - "armed_custom_bypass": "Aktivní uživatelským obejitím", + "armed_custom_bypass": "Zabezpečeno uživatelským obejitím", "armed_home": "Režim domov", "armed_night": "Noční režim", "arming": "Zabezpečování", @@ -430,6 +430,8 @@ "activate": "Aktivovat" }, "script": { + "cancel": "Zrušit", + "cancel_multiple": "Zrušit {number}", "execute": "Vykonat" }, "service": { @@ -525,6 +527,9 @@ "clear": "Vymazat", "show_areas": "Zobrazit oblasti" }, + "data-table": { + "search": "Hledat" + }, "date-range-picker": { "end_date": "Koncové datum", "select": "Vybrat", @@ -938,6 +943,19 @@ "introduction": "Použijte automatizace k oživení svého domova", "load_error_not_editable": "Lze upravovat pouze automatizace v automations.yaml.", "load_error_unknown": "Chyba při načítání automatizace ({err_no}).", + "max": { + "parallel": "Maximální počet paralelních spuštění", + "queued": "Délka fronty" + }, + "modes": { + "description": "Režim určuje, co se stane, když je automatizace spuštěna a zároveň stále ještě běží akce na základě předchozího spuštění. Další informace naleznete na {documentation_link}.", + "documentation": "Dokumentace automatizací", + "label": "Režim", + "parallel": "Paralelní (výchozí)", + "queued": "Fronta", + "restart": "Restart", + "single": "Jediný" + }, "move_down": "Posunout dolů", "move_up": "Posunout nahoru", "save": "Uložit", @@ -1356,6 +1374,7 @@ "confirm_text": "Entity lze odebrat pouze v případě, že integrace již entity neposkytuje.", "confirm_title": "Chcete odstranit {number} entit?" }, + "search": "Hledat entitu", "selected": "{number} vybraných", "status": { "disabled": "Zakázáno", @@ -1386,7 +1405,8 @@ "entity_id": "ID entity", "name": "Název", "type": "Typ" - } + }, + "no_helpers": "Vypadá to, že ještě nemáte žádné pomocníky!" }, "types": { "input_boolean": "Přepnout", @@ -1490,7 +1510,8 @@ "note_about_integrations": "Ne všechny integrace lze prozatím konfigurovat prostřednictvím uživatelského rozhraní.", "note_about_website_reference": "Další jsou k dispozici na ", "rename_dialog": "Upravit název této položky nastavení", - "rename_input_label": "Název položky" + "rename_input_label": "Název položky", + "search": "Hledat integraci" }, "introduction": "Zde je možné konfigurovat vaše komponenty a Home Assistant.\nZ uživatelského rozhraní sice zatím není možné konfigurovat vše, ale pracujeme na tom.", "logs": { @@ -1643,6 +1664,7 @@ "introduction": "Zde lze nastavit entity, které nepatří k zařízení.", "without_device": "Entity bez zařízení" }, + "icon": "Ikona", "introduction": "Pomocí scén oživte svůj domov.", "load_error_not_editable": "Lze upravovat pouze scény v souboru scenes.yaml.", "load_error_unknown": "Chyba při načítání scény ({err_no}).", @@ -1676,9 +1698,26 @@ "delete_confirm": "Opravdu chcete tento skript smazat?", "delete_script": "Smazat skript", "header": "Skript: {name}", + "icon": "Ikona", + "id": "ID entity", + "id_already_exists": "Toto ID již existuje", + "id_already_exists_save_error": "Tento skript nelze uložit, protože ID není jedinečné, vyberte jiné ID nebo jej nechte prázdné a bude automaticky vygenerováno.", "introduction": "K provedení posloupnosti akcí použijte skripty.", "link_available_actions": "Další informace o dostupných akcích.", "load_error_not_editable": "Upravovat lze pouze skripty uvnitř scripts.yaml.", + "max": { + "parallel": "Maximální počet paralelních spuštění", + "queued": "Délka fronty" + }, + "modes": { + "description": "Režim určuje, co se stane, když je skript spuštěn a zároveň stále ještě běží na základě předchozího spuštění. Další informace naleznete na {documentation_link}.", + "documentation": "Dokumentace skriptů", + "label": "Režim", + "parallel": "Paralelní (výchozí)", + "queued": "Fronta", + "restart": "Restart", + "single": "Jediný (výchozí)" + }, "sequence": "Sekvence", "sequence_sentence": "Posloupnost akcí tohoto skriptu." }, @@ -2194,6 +2233,7 @@ "name": "Název", "no_theme": "Žádný motiv", "refresh_interval": "Interval obnovení", + "search": "Hledat", "secondary_info_attribute": "Sekundární informační atribut", "show_icon": "Zobrazit ikonu?", "show_name": "Zobrazit název?", @@ -2314,7 +2354,8 @@ "edit_lovelace": { "edit_title": "Upravit titulek", "explanation": "Tento název je zobrazen nad všemi vašimi zobrazeními v Lovelace.", - "header": "Název vašeho uživatelského rozhraní Lovelace" + "header": "Název vašeho uživatelského rozhraní Lovelace", + "title": "Název" }, "edit_view": { "add": "Přidat pohled", @@ -2503,6 +2544,7 @@ }, "trusted_networks": { "abort": { + "not_allowed": "Váš počítač není povolen.", "not_whitelisted": "Váš počítač není na seznamu povolených." }, "step": { @@ -2678,6 +2720,10 @@ "not_used": "Nikdy nebylo použito", "token_title": "Obnovovací token pro {clientId}" }, + "suspend": { + "description": "Měli bychom ukončit spojení se serverem, pokud není Home Assistant viditelný po dobu delší než 5 minut?", + "header": "Automaticky ukončovat spojení" + }, "themes": { "dropdown_label": "Motiv", "error_no_theme": "Žádné motivy nejsou k dispozici.", diff --git a/translations/frontend/en.json b/translations/frontend/en.json index e41284926c..d3e41b83da 100644 --- a/translations/frontend/en.json +++ b/translations/frontend/en.json @@ -951,10 +951,10 @@ "description": "The mode controls what happens when the automation is triggered while the actions are still running from a previous trigger. Check the {documentation_link} for more info.", "documentation": "automation documentation", "label": "Mode", - "parallel": "Parallel (default)", + "parallel": "Parallel", "queued": "Queued", "restart": "Restart", - "single": "Single" + "single": "Single (default)" }, "move_down": "Move down", "move_up": "Move up", diff --git a/translations/frontend/es.json b/translations/frontend/es.json index 0bf1709566..eb77162f88 100644 --- a/translations/frontend/es.json +++ b/translations/frontend/es.json @@ -430,6 +430,8 @@ "activate": "Activar" }, "script": { + "cancel": "Cancelar", + "cancel_multiple": "Cancelar {number}", "execute": "Ejecutar" }, "service": { @@ -941,6 +943,19 @@ "introduction": "Utiliza automatizaciones para darle vida a tu hogar.", "load_error_not_editable": "Solo las automatizaciones en automations.yaml son editables.", "load_error_unknown": "Error al cargar la automatización ({err_no}).", + "max": { + "parallel": "Número máximo de ejecuciones paralelas", + "queued": "Longitud de la cola" + }, + "modes": { + "description": "El modo controla lo que sucede cuando se activa la automatización mientras las acciones aún se ejecutan desde una activación anterior. Consulta la {documentation_link} para obtener más información.", + "documentation": "documentación de automatización", + "label": "Modo", + "parallel": "Paralelo (predeterminado)", + "queued": "En cola", + "restart": "Reiniciar", + "single": "Único" + }, "move_down": "Mover hacia abajo", "move_up": "Mover hacia arriba", "save": "Guardar", @@ -1649,6 +1664,7 @@ "introduction": "Las entidades que no pertenecen a un dispositivo se pueden configurar aquí.", "without_device": "Entidades sin dispositivo" }, + "icon": "Icono", "introduction": "Usa escenas para dar vida a tu hogar.", "load_error_not_editable": "Solo las escenas de scenes.yaml son editables.", "load_error_unknown": "Error al cargar la escena ({err_no}).", @@ -1682,9 +1698,26 @@ "delete_confirm": "¿Seguro que quieres eliminar este script?", "delete_script": "Eliminar script", "header": "Script: {name}", + "icon": "Icono", + "id": "ID de la entidad", + "id_already_exists": "Este ID ya existe", + "id_already_exists_save_error": "No puedes guardar este script porque el ID no es único, elije otro ID o déjalo en blanco para generar uno automáticamente.", "introduction": "Utiliza scripts para ejecutar una secuencia de acciones.", "link_available_actions": "Saber más sobre las acciones disponibles.", "load_error_not_editable": "Solo los scripts dentro de scripts.yaml son editables.", + "max": { + "parallel": "Número máximo de ejecuciones paralelas", + "queued": "Longitud de la cola" + }, + "modes": { + "description": "El modo controla lo que sucede cuando se invoca el script mientras aún se ejecuta desde una o más invocaciones anteriores. Consulta la {documentation_link} para obtener más información.", + "documentation": "documentación de script", + "label": "Modo", + "parallel": "Paralelo", + "queued": "En cola", + "restart": "Reiniciar", + "single": "Único (predeterminado)" + }, "sequence": "Secuencia", "sequence_sentence": "La secuencia de acciones de este script." }, @@ -2511,6 +2544,7 @@ }, "trusted_networks": { "abort": { + "not_allowed": "Tu equipo no está permitido.", "not_whitelisted": "Tu equipo no está en la lista de autorizados." }, "step": { diff --git a/translations/frontend/fr.json b/translations/frontend/fr.json index 4da2ae549d..39fad0f3e4 100644 --- a/translations/frontend/fr.json +++ b/translations/frontend/fr.json @@ -430,6 +430,8 @@ "activate": "Activer" }, "script": { + "cancel": "Annuler", + "cancel_multiple": "Annuler {number}", "execute": "Exécuter" }, "service": { @@ -941,6 +943,18 @@ "introduction": "Utilisez les automatisations pour donner vie à votre maison", "load_error_not_editable": "Seules les automatisations dans automations.yaml sont modifiables.", "load_error_unknown": "Erreur lors du chargement de l'automatisation ( {err_no} ).", + "max": { + "parallel": "Nombre maximal de parcours parallèles", + "queued": "Longueur de la file d'attente" + }, + "modes": { + "description": "Le mode contrôle ce qui se passe lorsque l’automatisation est déclenchée alors que les actions sont toujours en cours d’exécution à partir d’un déclencheur précédent. Consultez le {documentation_link} pour plus d’informations.", + "documentation": "documentation d'automatisation", + "label": "Mode", + "parallel": "Parallèle (par défaut)", + "queued": "En attente", + "restart": "Redémarrer" + }, "move_down": "Déplacer vers le bas", "move_up": "Déplacer vers le haut", "save": "Sauvegarder", @@ -1649,6 +1663,7 @@ "introduction": "Les entités n'appartenant pas à un périphérique peuvent être définies ici.", "without_device": "Entités sans appareil" }, + "icon": "Icône", "introduction": "Utilisez des scènes pour donner vie à votre maison.", "load_error_not_editable": "Seules les scènes de scenes.yaml sont modifiables.", "load_error_unknown": "Erreur de chargement de la scène ({err_no})", @@ -1682,9 +1697,26 @@ "delete_confirm": "Êtes-vous sûr de vouloir supprimer ce script?", "delete_script": "Supprimer le script", "header": "Script: {name}", + "icon": "Icône", + "id": "ID de l'entité", + "id_already_exists": "Cet ID existe déjà", + "id_already_exists_save_error": "Vous ne pouvez pas enregistrer ce script car l'ID n'est pas unique, choisissez un autre ID ou laissez-le vide pour en générer automatiquement un.", "introduction": "Utiliser des scripts pour exécuter une séquence d'actions.", "link_available_actions": "En savoir plus sur les actions disponibles.", "load_error_not_editable": "Seuls les scripts dans scripts.yaml sont modifiables.", + "max": { + "parallel": "Nombre maximal de parcours parallèles", + "queued": "Longueur de la file d'attente" + }, + "modes": { + "description": "Le mode contrôle ce qui se passe lorsque le script est appelé alors qu’il est toujours en cours d’exécution à partir d’une ou plusieurs invocations précédentes. Consultez le {documentation_link} pour plus d’informations.", + "documentation": "documentation script", + "label": "Mode", + "parallel": "Parallèle", + "queued": "En attente", + "restart": "Redémarrer", + "single": "Unique (par défaut)" + }, "sequence": "Séquence", "sequence_sentence": "La séquence d'actions de ce script." }, @@ -2511,6 +2543,7 @@ }, "trusted_networks": { "abort": { + "not_allowed": "Votre ordinateur n'est pas autorisé.", "not_whitelisted": "Votre ordinateur n'est pas en liste blanche." }, "step": { diff --git a/translations/frontend/ru.json b/translations/frontend/ru.json index ebab530ffd..4829e3fd4b 100644 --- a/translations/frontend/ru.json +++ b/translations/frontend/ru.json @@ -430,6 +430,8 @@ "activate": "Активировать" }, "script": { + "cancel": "Отменить", + "cancel_multiple": "Отменить {number}", "execute": "Выполнить" }, "service": { @@ -1654,6 +1656,7 @@ "introduction": "Объекты, которые не связаны с каким-либо устройством, могут быть указаны здесь.", "without_device": "Объекты без устройств" }, + "icon": "Значок", "introduction": "Используйте сцены, чтобы оживить Ваш дом.", "load_error_not_editable": "Доступны для редактирования только сцены из scenes.yaml.", "load_error_unknown": "Ошибка загрузки сцены ({err_no}).", @@ -1687,6 +1690,9 @@ "delete_confirm": "Вы уверены, что хотите удалить этот сценарий?", "delete_script": "Удалить сценарий", "header": "Сценарий: {name}", + "icon": "Значок", + "id": "ID объекта", + "id_already_exists": "Этот ID уже существует", "introduction": "Используйте сценарии для выполнения последовательности действий.", "link_available_actions": "Узнайте больше о действиях", "load_error_not_editable": "Доступны для редактирования только сценарии из scripts.yaml.", diff --git a/translations/frontend/zh-Hant.json b/translations/frontend/zh-Hant.json index b6d8ba5e07..d42e58a88c 100644 --- a/translations/frontend/zh-Hant.json +++ b/translations/frontend/zh-Hant.json @@ -430,6 +430,8 @@ "activate": "啟用" }, "script": { + "cancel": "取消", + "cancel_multiple": "取消 {number}", "execute": "執行" }, "service": { @@ -1662,6 +1664,7 @@ "introduction": "不屬於設備的物件可以於此設置。", "without_device": "無設備物件" }, + "icon": "圖示", "introduction": "使用場景來讓你的智能家居更有魅力吧。", "load_error_not_editable": "僅有於 scenes.yaml 檔案內的場景、方能進行編輯。", "load_error_unknown": "載入場景錯誤({err_no})。", @@ -1695,6 +1698,10 @@ "delete_confirm": "確定要刪除此腳本?", "delete_script": "刪除腳本", "header": "腳本:{name}", + "icon": "圖示", + "id": "物件 ID", + "id_already_exists": "該 ID 已存在", + "id_already_exists_save_error": "由於該 ID 非獨一 ID,因此無法儲存此腳本。請選擇其他 ID 或者保留空白以自動產生。", "introduction": "使用腳本以執行一連串的動作。", "link_available_actions": "詳細了解可使用動作", "load_error_not_editable": "僅有於 scripts.yaml 檔案內的腳本,方能進行編輯。", From be62f327ee236b18bbeb057457aa18f892bb46a8 Mon Sep 17 00:00:00 2001 From: Yosi Levy Date: Thu, 16 Jul 2020 05:32:49 +0300 Subject: [PATCH 28/46] Removed LTR force - looks much better --- .../event/developer-tools-event.js | 1 - .../service/developer-tools-service.js | 27 +++++++++++++++++-- .../state/developer-tools-state.js | 15 ++++++++++- 3 files changed, 39 insertions(+), 4 deletions(-) diff --git a/src/panels/developer-tools/event/developer-tools-event.js b/src/panels/developer-tools/event/developer-tools-event.js index 7b1c9856de..4466d48f10 100644 --- a/src/panels/developer-tools/event/developer-tools-event.js +++ b/src/panels/developer-tools/event/developer-tools-event.js @@ -29,7 +29,6 @@ class HaPanelDevEvent extends EventsMixin(LocalizeMixin(PolymerElement)) { -moz-user-select: initial; @apply --paper-font-body1; padding: 16px; - direction: ltr; display: block; } diff --git a/src/panels/developer-tools/service/developer-tools-service.js b/src/panels/developer-tools/service/developer-tools-service.js index f1e996f4f1..51db6e7645 100644 --- a/src/panels/developer-tools/service/developer-tools-service.js +++ b/src/panels/developer-tools/service/developer-tools-service.js @@ -11,6 +11,7 @@ import { showAlertDialog } from "../../../dialogs/generic/show-dialog-box"; import LocalizeMixin from "../../../mixins/localize-mixin"; import "../../../styles/polymer-ha-style"; import "../../../util/app-localstorage-document"; +import { computeRTL } from "../../../common/util/compute_rtl"; const ERROR_SENTINEL = {}; /* @@ -26,7 +27,6 @@ class HaPanelDevService extends LocalizeMixin(PolymerElement) { -moz-user-select: initial; display: block; padding: 16px; - direction: ltr; } .ha-form { @@ -51,8 +51,13 @@ class HaPanelDevService extends LocalizeMixin(PolymerElement) { text-align: left; } + :host([rtl]) .attributes th { + text-align: right; + } + .attributes tr { vertical-align: top; + direction: ltr; } .attributes tr:nth-child(odd) { @@ -83,6 +88,14 @@ class HaPanelDevService extends LocalizeMixin(PolymerElement) { .error { color: var(--error-color); } + + :host([rtl]) .desc-container { + text-align: right; + } + + :host([rtl]) .desc-container h3 { + direction: ltr; + }