From 349344161a8c93bdf5fa6ea74a8bea69b5421e3f Mon Sep 17 00:00:00 2001 From: Steve Repsher Date: Mon, 22 Jan 2024 10:04:58 -0500 Subject: [PATCH] Fix incompatible object/array property types (2 of 3) (#19482) --- cast/src/launcher/layout/hc-cast.ts | 6 +++--- cast/src/launcher/layout/hc-layout.ts | 8 ++++---- gallery/src/components/demo-cards.ts | 2 +- gallery/src/components/demo-more-infos.ts | 2 +- .../components/supervisor-backup-content.ts | 2 +- src/auth/ha-auth-flow.ts | 2 +- src/auth/ha-pick-auth-provider.ts | 4 ++-- src/components/device/ha-device-picker.ts | 6 ++++-- src/components/device/ha-devices-picker.ts | 10 ++++++---- src/components/entity/ha-entities-picker.ts | 3 ++- src/components/entity/ha-entity-picker.ts | 3 ++- src/components/ha-aliases-editor.ts | 2 +- src/components/ha-area-picker.ts | 6 ++++-- src/components/ha-areas-picker.ts | 8 +++++--- src/components/ha-attribute-icon.ts | 2 +- src/components/ha-blueprint-picker.ts | 2 +- src/components/ha-combo-box.ts | 2 +- src/components/ha-country-picker.ts | 2 +- src/components/ha-date-range-picker.ts | 6 +++--- src/components/ha-form/ha-form-string.ts | 2 +- src/components/ha-gauge.ts | 4 ++-- src/components/ha-language-picker.ts | 2 +- src/components/ha-qr-scanner.ts | 2 +- src/components/ha-target-picker.ts | 6 ++++-- .../media-player/ha-browse-media-tts.ts | 2 +- .../media-player/ha-media-manage-button.ts | 2 +- .../media-player/ha-media-upload-button.ts | 2 +- src/layouts/hass-subpage.ts | 2 +- src/mixins/lit-localize-lite-mixin.ts | 2 +- src/onboarding/onboarding-analytics.ts | 2 +- src/onboarding/onboarding-core-config.ts | 2 +- src/onboarding/onboarding-create-user.ts | 2 +- src/onboarding/onboarding-integrations.ts | 2 +- src/onboarding/onboarding-location.ts | 2 +- src/onboarding/onboarding-welcome-links.ts | 2 +- src/onboarding/onboarding-welcome.ts | 2 +- .../mqtt/mqtt-discovery-payload.ts | 2 +- .../integration-elements/mqtt/mqtt-messages.ts | 2 +- .../components/ha-energy-validation-result.ts | 6 ++---- .../zha/zha-clusters-data-table.ts | 2 +- 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 | 2 +- src/panels/config/script/ha-config-script.ts | 2 +- .../config/script/ha-script-field-row.ts | 4 ++-- src/panels/config/script/ha-script-fields.ts | 2 +- src/panels/config/script/ha-script-picker.ts | 2 +- src/panels/config/tags/tag-image.ts | 2 +- src/panels/custom/ha-panel-custom.ts | 2 +- .../developer-tools/event/events-list.ts | 2 +- src/panels/iframe/ha-panel-iframe.ts | 2 +- src/panels/logbook/ha-logbook.ts | 18 +++++++----------- .../lovelace/components/hui-buttons-base.ts | 3 ++- .../lovelace/components/hui-entity-editor.ts | 3 ++- .../components/hui-timestamp-display.ts | 2 +- src/panels/lovelace/ha-panel-lovelace.ts | 2 +- src/panels/lovelace/hui-editor.ts | 2 +- src/panels/profile/ha-advanced-mode-row.ts | 2 +- 58 files changed, 97 insertions(+), 89 deletions(-) diff --git a/cast/src/launcher/layout/hc-cast.ts b/cast/src/launcher/layout/hc-cast.ts index bc61a5cfd7..b95be048fc 100644 --- a/cast/src/launcher/layout/hc-cast.ts +++ b/cast/src/launcher/layout/hc-cast.ts @@ -31,11 +31,11 @@ import "./hc-layout"; @customElement("hc-cast") class HcCast extends LitElement { - @property() public auth!: Auth; + @property({ attribute: false }) public auth!: Auth; - @property() public connection!: Connection; + @property({ attribute: false }) public connection!: Connection; - @property() public castManager!: CastManager; + @property({ attribute: false }) public castManager!: CastManager; @state() private askWrite = false; diff --git a/cast/src/launcher/layout/hc-layout.ts b/cast/src/launcher/layout/hc-layout.ts index 69d788fe21..31b336cb51 100644 --- a/cast/src/launcher/layout/hc-layout.ts +++ b/cast/src/launcher/layout/hc-layout.ts @@ -10,13 +10,13 @@ import "../../../../src/components/ha-card"; @customElement("hc-layout") class HcLayout extends LitElement { - @property() public subtitle?: string | undefined; + @property() public subtitle?: string; - @property() public auth?: Auth; + @property({ attribute: false }) public auth?: Auth; - @property() public connection?: Connection; + @property({ attribute: false }) public connection?: Connection; - @property() public user?: HassUser; + @property({ attribute: false }) public user?: HassUser; protected render(): TemplateResult { return html` diff --git a/gallery/src/components/demo-cards.ts b/gallery/src/components/demo-cards.ts index 8080b4a7fc..c2e117ceeb 100644 --- a/gallery/src/components/demo-cards.ts +++ b/gallery/src/components/demo-cards.ts @@ -10,7 +10,7 @@ import "../ha-demo-options"; @customElement("demo-cards") class DemoCards extends LitElement { - @property() public configs!: DemoCardConfig[]; + @property({ attribute: false }) public configs!: DemoCardConfig[]; @property({ attribute: false }) public hass!: HomeAssistant; diff --git a/gallery/src/components/demo-more-infos.ts b/gallery/src/components/demo-more-infos.ts index 072dca2658..af7703050c 100644 --- a/gallery/src/components/demo-more-infos.ts +++ b/gallery/src/components/demo-more-infos.ts @@ -11,7 +11,7 @@ import "./demo-more-info"; class DemoMoreInfos extends LitElement { @property({ attribute: false }) public hass!: HomeAssistant; - @property() public entities!: []; + @property({ type: Array }) public entities!: string[]; @state() private _showConfig = false; diff --git a/hassio/src/components/supervisor-backup-content.ts b/hassio/src/components/supervisor-backup-content.ts index ff67b511c0..0c76daba83 100644 --- a/hassio/src/components/supervisor-backup-content.ts +++ b/hassio/src/components/supervisor-backup-content.ts @@ -72,7 +72,7 @@ const _computeAddons = (addons): AddonCheckboxItem[] => export class SupervisorBackupContent extends LitElement { @property({ attribute: false }) public hass!: HomeAssistant; - @property() public localize?: LocalizeFunc; + @property({ attribute: false }) public localize?: LocalizeFunc; @property({ attribute: false }) public supervisor?: Supervisor; diff --git a/src/auth/ha-auth-flow.ts b/src/auth/ha-auth-flow.ts index 30b0e2176a..66a93c021c 100644 --- a/src/auth/ha-auth-flow.ts +++ b/src/auth/ha-auth-flow.ts @@ -34,7 +34,7 @@ export class HaAuthFlow extends LitElement { @property() public oauth2State?: string; - @property() public localize!: LocalizeFunc; + @property({ attribute: false }) public localize!: LocalizeFunc; @property({ attribute: false }) public step?: DataEntryFlowStep; diff --git a/src/auth/ha-pick-auth-provider.ts b/src/auth/ha-pick-auth-provider.ts index e26030146c..a814788b0a 100644 --- a/src/auth/ha-pick-auth-provider.ts +++ b/src/auth/ha-pick-auth-provider.ts @@ -18,9 +18,9 @@ declare global { @customElement("ha-pick-auth-provider") export class HaPickAuthProvider extends LitElement { - @property() public authProviders: AuthProvider[] = []; + @property({ attribute: false }) public authProviders: AuthProvider[] = []; - @property() public localize!: LocalizeFunc; + @property({ attribute: false }) public localize!: LocalizeFunc; protected render() { return html` diff --git a/src/components/device/ha-device-picker.ts b/src/components/device/ha-device-picker.ts index ed6d49e37d..cfcd2e2d70 100644 --- a/src/components/device/ha-device-picker.ts +++ b/src/components/device/ha-device-picker.ts @@ -84,9 +84,11 @@ export class HaDevicePicker extends LitElement { @property({ type: Array, attribute: "exclude-devices" }) public excludeDevices?: string[]; - @property() public deviceFilter?: HaDevicePickerDeviceFilterFunc; + @property({ attribute: false }) + public deviceFilter?: HaDevicePickerDeviceFilterFunc; - @property() public entityFilter?: HaDevicePickerEntityFilterFunc; + @property({ attribute: false }) + public entityFilter?: HaDevicePickerEntityFilterFunc; @property({ type: Boolean }) public disabled = false; diff --git a/src/components/device/ha-devices-picker.ts b/src/components/device/ha-devices-picker.ts index f53af31bcd..1133d0f5e3 100644 --- a/src/components/device/ha-devices-picker.ts +++ b/src/components/device/ha-devices-picker.ts @@ -12,7 +12,7 @@ import type { class HaDevicesPicker extends LitElement { @property({ attribute: false }) public hass?: HomeAssistant; - @property() public value?: string[]; + @property({ type: Array }) public value?: string[]; @property() public helper?: string; @@ -36,17 +36,19 @@ class HaDevicesPicker extends LitElement { @property({ type: Array, attribute: "exclude-domains" }) public excludeDomains?: string[]; - @property({ attribute: "picked-device-label" }) @property({ type: Array, attribute: "include-device-classes" }) public includeDeviceClasses?: string[]; + @property({ attribute: "picked-device-label" }) public pickedDeviceLabel?: string; @property({ attribute: "pick-device-label" }) public pickDeviceLabel?: string; - @property() public deviceFilter?: HaDevicePickerDeviceFilterFunc; + @property({ attribute: false }) + public deviceFilter?: HaDevicePickerDeviceFilterFunc; - @property() public entityFilter?: HaDevicePickerEntityFilterFunc; + @property({ attribute: false }) + public entityFilter?: HaDevicePickerEntityFilterFunc; protected render() { if (!this.hass) { diff --git a/src/components/entity/ha-entities-picker.ts b/src/components/entity/ha-entities-picker.ts index 72ea3ee8cc..b121e34ee4 100644 --- a/src/components/entity/ha-entities-picker.ts +++ b/src/components/entity/ha-entities-picker.ts @@ -73,7 +73,8 @@ class HaEntitiesPickerLight extends LitElement { @property({ attribute: "pick-entity-label" }) public pickEntityLabel?: string; - @property() public entityFilter?: HaEntityPickerEntityFilterFunc; + @property({ attribute: false }) + public entityFilter?: HaEntityPickerEntityFilterFunc; protected render() { if (!this.hass) { diff --git a/src/components/entity/ha-entity-picker.ts b/src/components/entity/ha-entity-picker.ts index f6bad8a965..1ae47cb99a 100644 --- a/src/components/entity/ha-entity-picker.ts +++ b/src/components/entity/ha-entity-picker.ts @@ -92,7 +92,8 @@ export class HaEntityPicker extends LitElement { @property({ type: Array, attribute: "exclude-entities" }) public excludeEntities?: string[]; - @property() public entityFilter?: HaEntityPickerEntityFilterFunc; + @property({ attribute: false }) + public entityFilter?: HaEntityPickerEntityFilterFunc; @property({ type: Boolean }) public hideClearIcon = false; diff --git a/src/components/ha-aliases-editor.ts b/src/components/ha-aliases-editor.ts index e466b60123..8f45409ba7 100644 --- a/src/components/ha-aliases-editor.ts +++ b/src/components/ha-aliases-editor.ts @@ -8,7 +8,7 @@ import "./ha-multi-textfield"; class AliasesEditor extends LitElement { @property({ attribute: false }) public hass!: HomeAssistant; - @property() public aliases!: string[]; + @property({ type: Array }) public aliases!: string[]; @property({ type: Boolean }) public disabled = false; diff --git a/src/components/ha-area-picker.ts b/src/components/ha-area-picker.ts index fd68a8eb4b..e3b237e8e7 100644 --- a/src/components/ha-area-picker.ts +++ b/src/components/ha-area-picker.ts @@ -88,9 +88,11 @@ export class HaAreaPicker extends LitElement { @property({ type: Array, attribute: "exclude-areas" }) public excludeAreas?: string[]; - @property() public deviceFilter?: HaDevicePickerDeviceFilterFunc; + @property({ attribute: false }) + public deviceFilter?: HaDevicePickerDeviceFilterFunc; - @property() public entityFilter?: (entity: HassEntity) => boolean; + @property({ attribute: false }) + public entityFilter?: (entity: HassEntity) => boolean; @property({ type: Boolean }) public disabled = false; diff --git a/src/components/ha-areas-picker.ts b/src/components/ha-areas-picker.ts index 0d36f8e3fe..12defd8611 100644 --- a/src/components/ha-areas-picker.ts +++ b/src/components/ha-areas-picker.ts @@ -13,7 +13,7 @@ export class HaAreasPicker extends SubscribeMixin(LitElement) { @property() public label?: string; - @property() public value?: string[]; + @property({ type: Array }) public value?: string[]; @property() public helper?: string; @@ -46,9 +46,11 @@ export class HaAreasPicker extends SubscribeMixin(LitElement) { @property({ type: Array, attribute: "include-device-classes" }) public includeDeviceClasses?: string[]; - @property() public deviceFilter?: HaDevicePickerDeviceFilterFunc; + @property({ attribute: false }) + public deviceFilter?: HaDevicePickerDeviceFilterFunc; - @property() public entityFilter?: (entity: HassEntity) => boolean; + @property({ attribute: false }) + public entityFilter?: (entity: HassEntity) => boolean; @property({ attribute: "picked-area-label" }) public pickedAreaLabel?: string; diff --git a/src/components/ha-attribute-icon.ts b/src/components/ha-attribute-icon.ts index 6b2df9b436..682befceda 100644 --- a/src/components/ha-attribute-icon.ts +++ b/src/components/ha-attribute-icon.ts @@ -10,7 +10,7 @@ import { attributeIconPath } from "../common/entity/attribute_icon_path"; @customElement("ha-attribute-icon") export class HaAttributeIcon extends LitElement { - @property() public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; @property({ attribute: false }) public stateObj?: HassEntity; diff --git a/src/components/ha-blueprint-picker.ts b/src/components/ha-blueprint-picker.ts index 214f9599c3..7ddbd3c0c8 100644 --- a/src/components/ha-blueprint-picker.ts +++ b/src/components/ha-blueprint-picker.ts @@ -24,7 +24,7 @@ class HaBluePrintPicker extends LitElement { @property() public domain: BlueprintDomain = "automation"; - @property() public blueprints?: Blueprints; + @property({ attribute: false }) public blueprints?: Blueprints; @property({ type: Boolean }) public disabled = false; diff --git a/src/components/ha-combo-box.ts b/src/components/ha-combo-box.ts index 5dd9d2a211..01b33c9a06 100644 --- a/src/components/ha-combo-box.ts +++ b/src/components/ha-combo-box.ts @@ -95,7 +95,7 @@ export class HaComboBox extends LitElement { @property({ attribute: "item-id-path" }) public itemIdPath?: string; - @property() public renderer?: ComboBoxLitRenderer; + @property({ attribute: false }) public renderer?: ComboBoxLitRenderer; @property({ type: Boolean }) public disabled = false; diff --git a/src/components/ha-country-picker.ts b/src/components/ha-country-picker.ts index fea293a2b4..55b7768c40 100644 --- a/src/components/ha-country-picker.ts +++ b/src/components/ha-country-picker.ts @@ -269,7 +269,7 @@ export class HaCountryPicker extends LitElement { @property() public label?: string; - @property() public countries?: string[]; + @property({ type: Array }) public countries?: string[]; @property() public helper?: string; diff --git a/src/components/ha-date-range-picker.ts b/src/components/ha-date-range-picker.ts index dc9ef2f6aa..6984dc13fc 100644 --- a/src/components/ha-date-range-picker.ts +++ b/src/components/ha-date-range-picker.ts @@ -47,11 +47,11 @@ export interface DateRangePickerRanges { export class HaDateRangePicker extends LitElement { @property({ attribute: false }) public hass!: HomeAssistant; - @property() public startDate!: Date; + @property({ attribute: false }) public startDate!: Date; - @property() public endDate!: Date; + @property({ attribute: false }) public endDate!: Date; - @property() public ranges?: DateRangePickerRanges | false; + @property({ attribute: false }) public ranges?: DateRangePickerRanges | false; @state() private _ranges?: DateRangePickerRanges; diff --git a/src/components/ha-form/ha-form-string.ts b/src/components/ha-form/ha-form-string.ts index a0a1757b80..dc9c4305e2 100644 --- a/src/components/ha-form/ha-form-string.ts +++ b/src/components/ha-form/ha-form-string.ts @@ -29,7 +29,7 @@ export class HaFormString extends LitElement implements HaFormElement { @property() public localizeBaseKey = "ui.components.selectors.text"; - @property() public schema!: HaFormStringSchema; + @property({ attribute: false }) public schema!: HaFormStringSchema; @property() public data!: HaFormStringData; diff --git a/src/components/ha-gauge.ts b/src/components/ha-gauge.ts index 1b2f665d0d..9ec23558ff 100644 --- a/src/components/ha-gauge.ts +++ b/src/components/ha-gauge.ts @@ -31,11 +31,11 @@ export class HaGauge extends LitElement { @property({ type: String }) public valueText?: string; - @property() public locale!: FrontendLocaleData; + @property({ attribute: false }) public locale!: FrontendLocaleData; @property({ type: Boolean }) public needle = false; - @property() public levels?: LevelDefinition[]; + @property({ type: Array }) public levels?: LevelDefinition[]; @property() public label = ""; diff --git a/src/components/ha-language-picker.ts b/src/components/ha-language-picker.ts index dcf0f7312d..c8a1e9d15b 100644 --- a/src/components/ha-language-picker.ts +++ b/src/components/ha-language-picker.ts @@ -19,7 +19,7 @@ export class HaLanguagePicker extends LitElement { @property() public label?: string; - @property() public languages?: string[]; + @property({ type: Array }) public languages?: string[]; @property({ attribute: false }) public hass?: HomeAssistant; diff --git a/src/components/ha-qr-scanner.ts b/src/components/ha-qr-scanner.ts index fe3bc8f0f6..b26aae20d6 100644 --- a/src/components/ha-qr-scanner.ts +++ b/src/components/ha-qr-scanner.ts @@ -14,7 +14,7 @@ import type { HaTextField } from "./ha-textfield"; @customElement("ha-qr-scanner") class HaQrScanner extends LitElement { - @property() localize!: LocalizeFunc; + @property({ attribute: false }) public localize!: LocalizeFunc; @state() private _cameras?: QrScanner.Camera[]; diff --git a/src/components/ha-target-picker.ts b/src/components/ha-target-picker.ts index e6a274ed19..1604c42ce1 100644 --- a/src/components/ha-target-picker.ts +++ b/src/components/ha-target-picker.ts @@ -62,9 +62,11 @@ export class HaTargetPicker extends LitElement { @property({ type: Array, attribute: "include-device-classes" }) public includeDeviceClasses?: string[]; - @property() public deviceFilter?: HaDevicePickerDeviceFilterFunc; + @property({ attribute: false }) + public deviceFilter?: HaDevicePickerDeviceFilterFunc; - @property() public entityFilter?: HaEntityPickerEntityFilterFunc; + @property({ attribute: false }) + public entityFilter?: HaEntityPickerEntityFilterFunc; @property({ type: Boolean, reflect: true }) public disabled = false; diff --git a/src/components/media-player/ha-browse-media-tts.ts b/src/components/media-player/ha-browse-media-tts.ts index d93ba0c9b4..52a43d04d0 100644 --- a/src/components/media-player/ha-browse-media-tts.ts +++ b/src/components/media-player/ha-browse-media-tts.ts @@ -33,7 +33,7 @@ declare global { class BrowseMediaTTS extends LitElement { @property({ attribute: false }) public hass!: HomeAssistant; - @property() public item!: MediaPlayerItem; + @property({ attribute: false }) public item!: MediaPlayerItem; @property() public action!: MediaPlayerBrowseAction; diff --git a/src/components/media-player/ha-media-manage-button.ts b/src/components/media-player/ha-media-manage-button.ts index e777aa95dc..90a85482df 100644 --- a/src/components/media-player/ha-media-manage-button.ts +++ b/src/components/media-player/ha-media-manage-button.ts @@ -19,7 +19,7 @@ declare global { class MediaManageButton extends LitElement { @property({ attribute: false }) public hass!: HomeAssistant; - @property() currentItem?: MediaPlayerItem; + @property({ attribute: false }) currentItem?: MediaPlayerItem; @state() _uploading = 0; diff --git a/src/components/media-player/ha-media-upload-button.ts b/src/components/media-player/ha-media-upload-button.ts index 92e7531dff..97a92ea171 100644 --- a/src/components/media-player/ha-media-upload-button.ts +++ b/src/components/media-player/ha-media-upload-button.ts @@ -24,7 +24,7 @@ declare global { class MediaUploadButton extends LitElement { @property({ attribute: false }) public hass!: HomeAssistant; - @property() currentItem?: MediaPlayerItem; + @property({ attribute: false }) currentItem?: MediaPlayerItem; @state() _uploading = 0; diff --git a/src/layouts/hass-subpage.ts b/src/layouts/hass-subpage.ts index 18483e2182..9eb3549630 100644 --- a/src/layouts/hass-subpage.ts +++ b/src/layouts/hass-subpage.ts @@ -25,7 +25,7 @@ class HassSubpage extends LitElement { @property({ type: String, attribute: "back-path" }) public backPath?: string; - @property() public backCallback?: () => void; + @property({ attribute: false }) public backCallback?: () => void; @property({ type: Boolean, reflect: true }) public narrow = false; diff --git a/src/mixins/lit-localize-lite-mixin.ts b/src/mixins/lit-localize-lite-mixin.ts index 2259a23dff..7d4823d733 100644 --- a/src/mixins/lit-localize-lite-mixin.ts +++ b/src/mixins/lit-localize-lite-mixin.ts @@ -13,7 +13,7 @@ export const litLocalizeLiteMixin = >( ) => { class LitLocalizeLiteClass extends superClass { // Initialized to empty will prevent undefined errors if called before connected to DOM. - @property() public localize: LocalizeFunc = empty; + @property({ attribute: false }) public localize: LocalizeFunc = empty; // Use browser language setup before login. @property() public language?: string = getLocalLanguage(); diff --git a/src/onboarding/onboarding-analytics.ts b/src/onboarding/onboarding-analytics.ts index 359fb0b031..4cce93b6d2 100644 --- a/src/onboarding/onboarding-analytics.ts +++ b/src/onboarding/onboarding-analytics.ts @@ -16,7 +16,7 @@ import { onBoardingStyles } from "./styles"; class OnboardingAnalytics extends LitElement { @property({ attribute: false }) public hass!: HomeAssistant; - @property() public localize!: LocalizeFunc; + @property({ attribute: false }) public localize!: LocalizeFunc; @state() private _error?: string; diff --git a/src/onboarding/onboarding-core-config.ts b/src/onboarding/onboarding-core-config.ts index 73debff9cb..a45b989c20 100644 --- a/src/onboarding/onboarding-core-config.ts +++ b/src/onboarding/onboarding-core-config.ts @@ -26,7 +26,7 @@ import "./onboarding-location"; class OnboardingCoreConfig extends LitElement { @property({ attribute: false }) public hass!: HomeAssistant; - @property() public onboardingLocalize!: LocalizeFunc; + @property({ attribute: false }) public onboardingLocalize!: LocalizeFunc; @state() private _working = false; diff --git a/src/onboarding/onboarding-create-user.ts b/src/onboarding/onboarding-create-user.ts index e8d50bfcc7..615d28930c 100644 --- a/src/onboarding/onboarding-create-user.ts +++ b/src/onboarding/onboarding-create-user.ts @@ -43,7 +43,7 @@ const CREATE_USER_SCHEMA: HaFormSchema[] = [ @customElement("onboarding-create-user") class OnboardingCreateUser extends LitElement { - @property() public localize!: LocalizeFunc; + @property({ attribute: false }) public localize!: LocalizeFunc; @property() public language!: string; diff --git a/src/onboarding/onboarding-integrations.ts b/src/onboarding/onboarding-integrations.ts index 337896b43a..12156a6ea8 100644 --- a/src/onboarding/onboarding-integrations.ts +++ b/src/onboarding/onboarding-integrations.ts @@ -36,7 +36,7 @@ const HIDDEN_DOMAINS = new Set([ class OnboardingIntegrations extends SubscribeMixin(LitElement) { @property({ attribute: false }) public hass!: HomeAssistant; - @property() public onboardingLocalize!: LocalizeFunc; + @property({ attribute: false }) public onboardingLocalize!: LocalizeFunc; @state() private _entries: ConfigEntry[] = []; diff --git a/src/onboarding/onboarding-location.ts b/src/onboarding/onboarding-location.ts index 77c87186d1..e452e8a7ad 100644 --- a/src/onboarding/onboarding-location.ts +++ b/src/onboarding/onboarding-location.ts @@ -48,7 +48,7 @@ const LOCATION_MARKER_ID = "location"; class OnboardingLocation extends LitElement { @property({ attribute: false }) public hass!: HomeAssistant; - @property() public onboardingLocalize!: LocalizeFunc; + @property({ attribute: false }) public onboardingLocalize!: LocalizeFunc; @state() private _working = false; diff --git a/src/onboarding/onboarding-welcome-links.ts b/src/onboarding/onboarding-welcome-links.ts index 97dd2ab13c..9c342e5083 100644 --- a/src/onboarding/onboarding-welcome-links.ts +++ b/src/onboarding/onboarding-welcome-links.ts @@ -19,7 +19,7 @@ import "./onboarding-welcome-link"; class OnboardingWelcomeLinks extends LitElement { @property({ attribute: false }) public hass!: HomeAssistant; - @property() public localize!: LocalizeFunc; + @property({ attribute: false }) public localize!: LocalizeFunc; @property({ type: Boolean }) public mobileApp = false; diff --git a/src/onboarding/onboarding-welcome.ts b/src/onboarding/onboarding-welcome.ts index 02985f6ce8..7b3888a0f0 100644 --- a/src/onboarding/onboarding-welcome.ts +++ b/src/onboarding/onboarding-welcome.ts @@ -17,7 +17,7 @@ import "../components/ha-button"; class OnboardingWelcome extends LitElement { @property({ attribute: false }) public hass!: HomeAssistant; - @property() public localize!: LocalizeFunc; + @property({ attribute: false }) public localize!: LocalizeFunc; @property({ type: Boolean }) public supervisor = false; 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 f61c1995f3..ef9b3b74d2 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 @@ -5,7 +5,7 @@ import { classMap } from "lit/directives/class-map"; @customElement("mqtt-discovery-payload") class MQTTDiscoveryPayload extends LitElement { - @property() public payload!: Record; + @property({ attribute: false }) public payload!: Record; @property({ type: Boolean }) public showAsYaml = false; 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 31386b9402..10297c5a46 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 @@ -10,7 +10,7 @@ import { HomeAssistant } from "../../../../../../types"; class MQTTMessages extends LitElement { public hass!: HomeAssistant; - @property() public messages!: MQTTMessage[]; + @property({ attribute: false }) public messages!: MQTTMessage[]; @property() public direction!: string; diff --git a/src/panels/config/energy/components/ha-energy-validation-result.ts b/src/panels/config/energy/components/ha-energy-validation-result.ts index ba91b416e8..2a0817345a 100644 --- a/src/panels/config/energy/components/ha-energy-validation-result.ts +++ b/src/panels/config/energy/components/ha-energy-validation-result.ts @@ -6,11 +6,9 @@ import { HomeAssistant } from "../../../../types"; @customElement("ha-energy-validation-result") class EnergyValidationMessage extends LitElement { - @property({ attribute: false }) - public hass!: HomeAssistant; + @property({ attribute: false }) public hass!: HomeAssistant; - @property() - public issues!: EnergyValidationIssue[]; + @property({ attribute: false }) public issues!: EnergyValidationIssue[]; public render() { if (this.issues.length === 0) { 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 1ceb7b2cb0..60b8f82faf 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 @@ -22,7 +22,7 @@ export class ZHAClustersDataTable extends LitElement { @property({ type: Boolean }) public narrow = false; - @property() public clusters: Cluster[] = []; + @property({ attribute: false }) public clusters: Cluster[] = []; @query("ha-data-table", true) private _dataTable!: HaDataTable; diff --git a/src/panels/config/scene/ha-config-scene.ts b/src/panels/config/scene/ha-config-scene.ts index 59a88b92c2..965e1a6bbc 100644 --- a/src/panels/config/scene/ha-config-scene.ts +++ b/src/panels/config/scene/ha-config-scene.ts @@ -30,7 +30,7 @@ class HaConfigScene extends HassRouterPage { @property({ type: Boolean }) public showAdvanced = false; - @property() public scenes: SceneEntity[] = []; + @property({ attribute: false }) public scenes: SceneEntity[] = []; protected routerOptions: RouterOptions = { defaultPage: "dashboard", diff --git a/src/panels/config/scene/ha-scene-dashboard.ts b/src/panels/config/scene/ha-scene-dashboard.ts index 27e21501db..f620c2235e 100644 --- a/src/panels/config/scene/ha-scene-dashboard.ts +++ b/src/panels/config/scene/ha-scene-dashboard.ts @@ -70,7 +70,7 @@ class HaSceneDashboard extends LitElement { @property({ attribute: false }) public route!: Route; - @property() public scenes!: SceneEntity[]; + @property({ attribute: false }) public scenes!: SceneEntity[]; @state() private _activeFilters?: string[]; diff --git a/src/panels/config/scene/ha-scene-editor.ts b/src/panels/config/scene/ha-scene-editor.ts index b8c2ab466e..53ce39942a 100644 --- a/src/panels/config/scene/ha-scene-editor.ts +++ b/src/panels/config/scene/ha-scene-editor.ts @@ -95,7 +95,7 @@ export class HaSceneEditor extends SubscribeMixin( @property() public sceneId: string | null = null; - @property() public scenes!: SceneEntity[]; + @property({ attribute: false }) public scenes!: SceneEntity[]; @property({ type: Boolean }) public showAdvanced = false; diff --git a/src/panels/config/script/ha-config-script.ts b/src/panels/config/script/ha-config-script.ts index 3e96240f7a..56aaade1c1 100644 --- a/src/panels/config/script/ha-config-script.ts +++ b/src/panels/config/script/ha-config-script.ts @@ -33,7 +33,7 @@ class HaConfigScript extends HassRouterPage { @property({ type: Boolean }) public showAdvanced = false; - @property() public scripts: ScriptEntity[] = []; + @property({ attribute: false }) public scripts: ScriptEntity[] = []; @state() @consume({ context: fullEntitiesContext, subscribe: true }) diff --git a/src/panels/config/script/ha-script-field-row.ts b/src/panels/config/script/ha-script-field-row.ts index 8e57629789..38a0c4e33c 100644 --- a/src/panels/config/script/ha-script-field-row.ts +++ b/src/panels/config/script/ha-script-field-row.ts @@ -27,9 +27,9 @@ export default class HaScriptFieldRow extends LitElement { @property() public key!: string; - @property() public excludeKeys: string[] = []; + @property({ type: Array }) public excludeKeys: string[] = []; - @property() public field!: Field; + @property({ attribute: false }) public field!: Field; @property({ type: Boolean }) public disabled = false; diff --git a/src/panels/config/script/ha-script-fields.ts b/src/panels/config/script/ha-script-fields.ts index 3a80df82c9..8fb319db39 100644 --- a/src/panels/config/script/ha-script-fields.ts +++ b/src/panels/config/script/ha-script-fields.ts @@ -24,7 +24,7 @@ export default class HaScriptFields extends LitElement { @property({ type: Boolean }) public disabled = false; - @property() public fields!: Fields; + @property({ attribute: false }) public fields!: Fields; private _focusLastActionOnChange = false; diff --git a/src/panels/config/script/ha-script-picker.ts b/src/panels/config/script/ha-script-picker.ts index 0b51320a8a..aa46a532a8 100644 --- a/src/panels/config/script/ha-script-picker.ts +++ b/src/panels/config/script/ha-script-picker.ts @@ -68,7 +68,7 @@ type ScriptItem = ScriptEntity & { class HaScriptPicker extends LitElement { @property({ attribute: false }) public hass!: HomeAssistant; - @property() public scripts!: ScriptEntity[]; + @property({ attribute: false }) public scripts!: ScriptEntity[]; @property({ type: Boolean }) public isWide = false; diff --git a/src/panels/config/tags/tag-image.ts b/src/panels/config/tags/tag-image.ts index 3079bb61d8..17c3b636ed 100644 --- a/src/panels/config/tags/tag-image.ts +++ b/src/panels/config/tags/tag-image.ts @@ -6,7 +6,7 @@ import { TagRowData } from "./ha-config-tags"; @customElement("tag-image") export class HaTagImage extends LitElement { - @property() public tag?: TagRowData; + @property({ attribute: false }) public tag?: TagRowData; private _timeout?: number; diff --git a/src/panels/custom/ha-panel-custom.ts b/src/panels/custom/ha-panel-custom.ts index 04a4a406ba..6d048e9247 100644 --- a/src/panels/custom/ha-panel-custom.ts +++ b/src/panels/custom/ha-panel-custom.ts @@ -27,7 +27,7 @@ export class HaPanelCustom extends ReactiveElement { @property({ attribute: false }) public route!: Route; - @property() public panel!: CustomPanelInfo; + @property({ attribute: false }) public panel!: CustomPanelInfo; private _setProperties?: (props: Record) => void | undefined; diff --git a/src/panels/developer-tools/event/events-list.ts b/src/panels/developer-tools/event/events-list.ts index 7007ca6eab..a509651f2d 100644 --- a/src/panels/developer-tools/event/events-list.ts +++ b/src/panels/developer-tools/event/events-list.ts @@ -13,7 +13,7 @@ interface EventListenerCount { class EventsList extends LitElement { @property({ attribute: false }) public hass!: HomeAssistant; - @property() public events: EventListenerCount[] = []; + @property({ attribute: false }) public events: EventListenerCount[] = []; protected render(): TemplateResult { return html` diff --git a/src/panels/iframe/ha-panel-iframe.ts b/src/panels/iframe/ha-panel-iframe.ts index ba6b451056..72b7e96d10 100644 --- a/src/panels/iframe/ha-panel-iframe.ts +++ b/src/panels/iframe/ha-panel-iframe.ts @@ -11,7 +11,7 @@ class HaPanelIframe extends LitElement { @property({ type: Boolean }) public narrow = false; - @property() panel!: PanelInfo<{ url: string }>; + @property({ attribute: false }) panel!: PanelInfo<{ url: string }>; render() { if ( diff --git a/src/panels/logbook/ha-logbook.ts b/src/panels/logbook/ha-logbook.ts index 984a6a694b..ea25e307b3 100644 --- a/src/panels/logbook/ha-logbook.ts +++ b/src/panels/logbook/ha-logbook.ts @@ -41,28 +41,24 @@ const idsChanged = (oldIds?: string[], newIds?: string[]) => { export class HaLogbook extends LitElement { @property({ attribute: false }) public hass!: HomeAssistant; - @property() public time!: + @property({ attribute: false }) public time!: | { range: [Date, Date] } | { // Seconds recent: number; }; - @property() public entityIds?: string[]; + @property({ attribute: false }) public entityIds?: string[]; - @property() public deviceIds?: string[]; + @property({ attribute: false }) public deviceIds?: string[]; - @property({ type: Boolean, attribute: "narrow" }) - public narrow = false; + @property({ type: Boolean }) public narrow = false; - @property({ type: Boolean, attribute: "virtualize", reflect: true }) - public virtualize = false; + @property({ type: Boolean, reflect: true }) public virtualize = false; - @property({ type: Boolean, attribute: "no-icon" }) - public noIcon = false; + @property({ type: Boolean, attribute: "no-icon" }) public noIcon = false; - @property({ type: Boolean, attribute: "no-name" }) - public noName = false; + @property({ type: Boolean, attribute: "no-name" }) public noName = false; @property({ type: Boolean, attribute: "show-indicator" }) public showIndicator = false; diff --git a/src/panels/lovelace/components/hui-buttons-base.ts b/src/panels/lovelace/components/hui-buttons-base.ts index 0edeb4c2f2..7030d2c6cc 100644 --- a/src/panels/lovelace/components/hui-buttons-base.ts +++ b/src/panels/lovelace/components/hui-buttons-base.ts @@ -17,7 +17,8 @@ import { haStyleScrollbar } from "../../../resources/styles"; export class HuiButtonsBase extends LitElement { @state() public hass!: HomeAssistant; - @property() public configEntities?: EntitiesCardEntityConfig[]; + @property({ attribute: false }) + public configEntities?: EntitiesCardEntityConfig[]; protected render(): TemplateResult { return html` diff --git a/src/panels/lovelace/components/hui-entity-editor.ts b/src/panels/lovelace/components/hui-entity-editor.ts index c69ad7066e..77f22a85c0 100644 --- a/src/panels/lovelace/components/hui-entity-editor.ts +++ b/src/panels/lovelace/components/hui-entity-editor.ts @@ -19,7 +19,8 @@ export class HuiEntityEditor extends LitElement { @property({ attribute: false }) public entities?: EntityConfig[]; - @property() public entityFilter?: HaEntityPickerEntityFilterFunc; + @property({ attribute: false }) + public entityFilter?: HaEntityPickerEntityFilterFunc; @property() public label?: string; diff --git a/src/panels/lovelace/components/hui-timestamp-display.ts b/src/panels/lovelace/components/hui-timestamp-display.ts index c3871ca099..c0b99d2c45 100644 --- a/src/panels/lovelace/components/hui-timestamp-display.ts +++ b/src/panels/lovelace/components/hui-timestamp-display.ts @@ -27,7 +27,7 @@ const INTERVAL_FORMAT = ["relative", "total"]; class HuiTimestampDisplay extends LitElement { @property({ attribute: false }) public hass?: HomeAssistant; - @property() public ts?: Date; + @property({ attribute: false }) public ts?: Date; @property() public format?: TimestampRenderingFormat; diff --git a/src/panels/lovelace/ha-panel-lovelace.ts b/src/panels/lovelace/ha-panel-lovelace.ts index 81e6aa7932..4319c94d5b 100644 --- a/src/panels/lovelace/ha-panel-lovelace.ts +++ b/src/panels/lovelace/ha-panel-lovelace.ts @@ -52,7 +52,7 @@ let resourcesLoaded = false; @customElement("ha-panel-lovelace") export class LovelacePanel extends LitElement { - @property() public panel?: PanelInfo; + @property({ attribute: false }) public panel?: PanelInfo; @property({ attribute: false }) public hass?: HomeAssistant; diff --git a/src/panels/lovelace/hui-editor.ts b/src/panels/lovelace/hui-editor.ts index 8748cb195f..cf5983d875 100644 --- a/src/panels/lovelace/hui-editor.ts +++ b/src/panels/lovelace/hui-editor.ts @@ -49,7 +49,7 @@ class LovelaceFullConfigEditor extends LitElement { @property({ attribute: false }) public lovelace?: Lovelace; - @property() public closeEditor?: () => void; + @property({ attribute: false }) public closeEditor?: () => void; @state() private _saving?: boolean; diff --git a/src/panels/profile/ha-advanced-mode-row.ts b/src/panels/profile/ha-advanced-mode-row.ts index 3eed30ceed..1877e04121 100644 --- a/src/panels/profile/ha-advanced-mode-row.ts +++ b/src/panels/profile/ha-advanced-mode-row.ts @@ -15,7 +15,7 @@ class AdvancedModeRow extends LitElement { @property({ type: Boolean }) public narrow = false; - @property() public coreUserData?: CoreFrontendUserData; + @property({ attribute: false }) public coreUserData?: CoreFrontendUserData; protected render(): TemplateResult { return html`