Skip to content

Commit 3493441

Browse files
authored
Fix incompatible object/array property types (2 of 3) (#19482)
1 parent 28a8863 commit 3493441

File tree

58 files changed

+97
-89
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+97
-89
lines changed

cast/src/launcher/layout/hc-cast.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@ import "./hc-layout";
3131

3232
@customElement("hc-cast")
3333
class HcCast extends LitElement {
34-
@property() public auth!: Auth;
34+
@property({ attribute: false }) public auth!: Auth;
3535

36-
@property() public connection!: Connection;
36+
@property({ attribute: false }) public connection!: Connection;
3737

38-
@property() public castManager!: CastManager;
38+
@property({ attribute: false }) public castManager!: CastManager;
3939

4040
@state() private askWrite = false;
4141

cast/src/launcher/layout/hc-layout.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ import "../../../../src/components/ha-card";
1010

1111
@customElement("hc-layout")
1212
class HcLayout extends LitElement {
13-
@property() public subtitle?: string | undefined;
13+
@property() public subtitle?: string;
1414

15-
@property() public auth?: Auth;
15+
@property({ attribute: false }) public auth?: Auth;
1616

17-
@property() public connection?: Connection;
17+
@property({ attribute: false }) public connection?: Connection;
1818

19-
@property() public user?: HassUser;
19+
@property({ attribute: false }) public user?: HassUser;
2020

2121
protected render(): TemplateResult {
2222
return html`

gallery/src/components/demo-cards.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import "../ha-demo-options";
1010

1111
@customElement("demo-cards")
1212
class DemoCards extends LitElement {
13-
@property() public configs!: DemoCardConfig[];
13+
@property({ attribute: false }) public configs!: DemoCardConfig[];
1414

1515
@property({ attribute: false }) public hass!: HomeAssistant;
1616

gallery/src/components/demo-more-infos.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import "./demo-more-info";
1111
class DemoMoreInfos extends LitElement {
1212
@property({ attribute: false }) public hass!: HomeAssistant;
1313

14-
@property() public entities!: [];
14+
@property({ type: Array }) public entities!: string[];
1515

1616
@state() private _showConfig = false;
1717

hassio/src/components/supervisor-backup-content.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ const _computeAddons = (addons): AddonCheckboxItem[] =>
7272
export class SupervisorBackupContent extends LitElement {
7373
@property({ attribute: false }) public hass!: HomeAssistant;
7474

75-
@property() public localize?: LocalizeFunc;
75+
@property({ attribute: false }) public localize?: LocalizeFunc;
7676

7777
@property({ attribute: false }) public supervisor?: Supervisor;
7878

src/auth/ha-auth-flow.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export class HaAuthFlow extends LitElement {
3434

3535
@property() public oauth2State?: string;
3636

37-
@property() public localize!: LocalizeFunc;
37+
@property({ attribute: false }) public localize!: LocalizeFunc;
3838

3939
@property({ attribute: false }) public step?: DataEntryFlowStep;
4040

src/auth/ha-pick-auth-provider.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ declare global {
1818

1919
@customElement("ha-pick-auth-provider")
2020
export class HaPickAuthProvider extends LitElement {
21-
@property() public authProviders: AuthProvider[] = [];
21+
@property({ attribute: false }) public authProviders: AuthProvider[] = [];
2222

23-
@property() public localize!: LocalizeFunc;
23+
@property({ attribute: false }) public localize!: LocalizeFunc;
2424

2525
protected render() {
2626
return html`

src/components/device/ha-device-picker.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,11 @@ export class HaDevicePicker extends LitElement {
8484
@property({ type: Array, attribute: "exclude-devices" })
8585
public excludeDevices?: string[];
8686

87-
@property() public deviceFilter?: HaDevicePickerDeviceFilterFunc;
87+
@property({ attribute: false })
88+
public deviceFilter?: HaDevicePickerDeviceFilterFunc;
8889

89-
@property() public entityFilter?: HaDevicePickerEntityFilterFunc;
90+
@property({ attribute: false })
91+
public entityFilter?: HaDevicePickerEntityFilterFunc;
9092

9193
@property({ type: Boolean }) public disabled = false;
9294

src/components/device/ha-devices-picker.ts

+6-4
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import type {
1212
class HaDevicesPicker extends LitElement {
1313
@property({ attribute: false }) public hass?: HomeAssistant;
1414

15-
@property() public value?: string[];
15+
@property({ type: Array }) public value?: string[];
1616

1717
@property() public helper?: string;
1818

@@ -36,17 +36,19 @@ class HaDevicesPicker extends LitElement {
3636
@property({ type: Array, attribute: "exclude-domains" })
3737
public excludeDomains?: string[];
3838

39-
@property({ attribute: "picked-device-label" })
4039
@property({ type: Array, attribute: "include-device-classes" })
4140
public includeDeviceClasses?: string[];
4241

42+
@property({ attribute: "picked-device-label" })
4343
public pickedDeviceLabel?: string;
4444

4545
@property({ attribute: "pick-device-label" }) public pickDeviceLabel?: string;
4646

47-
@property() public deviceFilter?: HaDevicePickerDeviceFilterFunc;
47+
@property({ attribute: false })
48+
public deviceFilter?: HaDevicePickerDeviceFilterFunc;
4849

49-
@property() public entityFilter?: HaDevicePickerEntityFilterFunc;
50+
@property({ attribute: false })
51+
public entityFilter?: HaDevicePickerEntityFilterFunc;
5052

5153
protected render() {
5254
if (!this.hass) {

src/components/entity/ha-entities-picker.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,8 @@ class HaEntitiesPickerLight extends LitElement {
7373

7474
@property({ attribute: "pick-entity-label" }) public pickEntityLabel?: string;
7575

76-
@property() public entityFilter?: HaEntityPickerEntityFilterFunc;
76+
@property({ attribute: false })
77+
public entityFilter?: HaEntityPickerEntityFilterFunc;
7778

7879
protected render() {
7980
if (!this.hass) {

src/components/entity/ha-entity-picker.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,8 @@ export class HaEntityPicker extends LitElement {
9292
@property({ type: Array, attribute: "exclude-entities" })
9393
public excludeEntities?: string[];
9494

95-
@property() public entityFilter?: HaEntityPickerEntityFilterFunc;
95+
@property({ attribute: false })
96+
public entityFilter?: HaEntityPickerEntityFilterFunc;
9697

9798
@property({ type: Boolean }) public hideClearIcon = false;
9899

src/components/ha-aliases-editor.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import "./ha-multi-textfield";
88
class AliasesEditor extends LitElement {
99
@property({ attribute: false }) public hass!: HomeAssistant;
1010

11-
@property() public aliases!: string[];
11+
@property({ type: Array }) public aliases!: string[];
1212

1313
@property({ type: Boolean }) public disabled = false;
1414

src/components/ha-area-picker.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,11 @@ export class HaAreaPicker extends LitElement {
8888
@property({ type: Array, attribute: "exclude-areas" })
8989
public excludeAreas?: string[];
9090

91-
@property() public deviceFilter?: HaDevicePickerDeviceFilterFunc;
91+
@property({ attribute: false })
92+
public deviceFilter?: HaDevicePickerDeviceFilterFunc;
9293

93-
@property() public entityFilter?: (entity: HassEntity) => boolean;
94+
@property({ attribute: false })
95+
public entityFilter?: (entity: HassEntity) => boolean;
9496

9597
@property({ type: Boolean }) public disabled = false;
9698

src/components/ha-areas-picker.ts

+5-3
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export class HaAreasPicker extends SubscribeMixin(LitElement) {
1313

1414
@property() public label?: string;
1515

16-
@property() public value?: string[];
16+
@property({ type: Array }) public value?: string[];
1717

1818
@property() public helper?: string;
1919

@@ -46,9 +46,11 @@ export class HaAreasPicker extends SubscribeMixin(LitElement) {
4646
@property({ type: Array, attribute: "include-device-classes" })
4747
public includeDeviceClasses?: string[];
4848

49-
@property() public deviceFilter?: HaDevicePickerDeviceFilterFunc;
49+
@property({ attribute: false })
50+
public deviceFilter?: HaDevicePickerDeviceFilterFunc;
5051

51-
@property() public entityFilter?: (entity: HassEntity) => boolean;
52+
@property({ attribute: false })
53+
public entityFilter?: (entity: HassEntity) => boolean;
5254

5355
@property({ attribute: "picked-area-label" })
5456
public pickedAreaLabel?: string;

src/components/ha-attribute-icon.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { attributeIconPath } from "../common/entity/attribute_icon_path";
1010

1111
@customElement("ha-attribute-icon")
1212
export class HaAttributeIcon extends LitElement {
13-
@property() public hass!: HomeAssistant;
13+
@property({ attribute: false }) public hass!: HomeAssistant;
1414

1515
@property({ attribute: false }) public stateObj?: HassEntity;
1616

src/components/ha-blueprint-picker.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class HaBluePrintPicker extends LitElement {
2424

2525
@property() public domain: BlueprintDomain = "automation";
2626

27-
@property() public blueprints?: Blueprints;
27+
@property({ attribute: false }) public blueprints?: Blueprints;
2828

2929
@property({ type: Boolean }) public disabled = false;
3030

src/components/ha-combo-box.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ export class HaComboBox extends LitElement {
9595

9696
@property({ attribute: "item-id-path" }) public itemIdPath?: string;
9797

98-
@property() public renderer?: ComboBoxLitRenderer<any>;
98+
@property({ attribute: false }) public renderer?: ComboBoxLitRenderer<any>;
9999

100100
@property({ type: Boolean }) public disabled = false;
101101

src/components/ha-country-picker.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ export class HaCountryPicker extends LitElement {
269269

270270
@property() public label?: string;
271271

272-
@property() public countries?: string[];
272+
@property({ type: Array }) public countries?: string[];
273273

274274
@property() public helper?: string;
275275

src/components/ha-date-range-picker.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,11 @@ export interface DateRangePickerRanges {
4747
export class HaDateRangePicker extends LitElement {
4848
@property({ attribute: false }) public hass!: HomeAssistant;
4949

50-
@property() public startDate!: Date;
50+
@property({ attribute: false }) public startDate!: Date;
5151

52-
@property() public endDate!: Date;
52+
@property({ attribute: false }) public endDate!: Date;
5353

54-
@property() public ranges?: DateRangePickerRanges | false;
54+
@property({ attribute: false }) public ranges?: DateRangePickerRanges | false;
5555

5656
@state() private _ranges?: DateRangePickerRanges;
5757

src/components/ha-form/ha-form-string.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export class HaFormString extends LitElement implements HaFormElement {
2929

3030
@property() public localizeBaseKey = "ui.components.selectors.text";
3131

32-
@property() public schema!: HaFormStringSchema;
32+
@property({ attribute: false }) public schema!: HaFormStringSchema;
3333

3434
@property() public data!: HaFormStringData;
3535

src/components/ha-gauge.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@ export class HaGauge extends LitElement {
3131

3232
@property({ type: String }) public valueText?: string;
3333

34-
@property() public locale!: FrontendLocaleData;
34+
@property({ attribute: false }) public locale!: FrontendLocaleData;
3535

3636
@property({ type: Boolean }) public needle = false;
3737

38-
@property() public levels?: LevelDefinition[];
38+
@property({ type: Array }) public levels?: LevelDefinition[];
3939

4040
@property() public label = "";
4141

src/components/ha-language-picker.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export class HaLanguagePicker extends LitElement {
1919

2020
@property() public label?: string;
2121

22-
@property() public languages?: string[];
22+
@property({ type: Array }) public languages?: string[];
2323

2424
@property({ attribute: false }) public hass?: HomeAssistant;
2525

src/components/ha-qr-scanner.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import type { HaTextField } from "./ha-textfield";
1414

1515
@customElement("ha-qr-scanner")
1616
class HaQrScanner extends LitElement {
17-
@property() localize!: LocalizeFunc;
17+
@property({ attribute: false }) public localize!: LocalizeFunc;
1818

1919
@state() private _cameras?: QrScanner.Camera[];
2020

src/components/ha-target-picker.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,11 @@ export class HaTargetPicker extends LitElement {
6262
@property({ type: Array, attribute: "include-device-classes" })
6363
public includeDeviceClasses?: string[];
6464

65-
@property() public deviceFilter?: HaDevicePickerDeviceFilterFunc;
65+
@property({ attribute: false })
66+
public deviceFilter?: HaDevicePickerDeviceFilterFunc;
6667

67-
@property() public entityFilter?: HaEntityPickerEntityFilterFunc;
68+
@property({ attribute: false })
69+
public entityFilter?: HaEntityPickerEntityFilterFunc;
6870

6971
@property({ type: Boolean, reflect: true }) public disabled = false;
7072

src/components/media-player/ha-browse-media-tts.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ declare global {
3333
class BrowseMediaTTS extends LitElement {
3434
@property({ attribute: false }) public hass!: HomeAssistant;
3535

36-
@property() public item!: MediaPlayerItem;
36+
@property({ attribute: false }) public item!: MediaPlayerItem;
3737

3838
@property() public action!: MediaPlayerBrowseAction;
3939

src/components/media-player/ha-media-manage-button.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ declare global {
1919
class MediaManageButton extends LitElement {
2020
@property({ attribute: false }) public hass!: HomeAssistant;
2121

22-
@property() currentItem?: MediaPlayerItem;
22+
@property({ attribute: false }) currentItem?: MediaPlayerItem;
2323

2424
@state() _uploading = 0;
2525

src/components/media-player/ha-media-upload-button.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ declare global {
2424
class MediaUploadButton extends LitElement {
2525
@property({ attribute: false }) public hass!: HomeAssistant;
2626

27-
@property() currentItem?: MediaPlayerItem;
27+
@property({ attribute: false }) currentItem?: MediaPlayerItem;
2828

2929
@state() _uploading = 0;
3030

src/layouts/hass-subpage.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class HassSubpage extends LitElement {
2525

2626
@property({ type: String, attribute: "back-path" }) public backPath?: string;
2727

28-
@property() public backCallback?: () => void;
28+
@property({ attribute: false }) public backCallback?: () => void;
2929

3030
@property({ type: Boolean, reflect: true }) public narrow = false;
3131

src/mixins/lit-localize-lite-mixin.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export const litLocalizeLiteMixin = <T extends Constructor<LitElement>>(
1313
) => {
1414
class LitLocalizeLiteClass extends superClass {
1515
// Initialized to empty will prevent undefined errors if called before connected to DOM.
16-
@property() public localize: LocalizeFunc = empty;
16+
@property({ attribute: false }) public localize: LocalizeFunc = empty;
1717

1818
// Use browser language setup before login.
1919
@property() public language?: string = getLocalLanguage();

src/onboarding/onboarding-analytics.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import { onBoardingStyles } from "./styles";
1616
class OnboardingAnalytics extends LitElement {
1717
@property({ attribute: false }) public hass!: HomeAssistant;
1818

19-
@property() public localize!: LocalizeFunc;
19+
@property({ attribute: false }) public localize!: LocalizeFunc;
2020

2121
@state() private _error?: string;
2222

src/onboarding/onboarding-core-config.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import "./onboarding-location";
2626
class OnboardingCoreConfig extends LitElement {
2727
@property({ attribute: false }) public hass!: HomeAssistant;
2828

29-
@property() public onboardingLocalize!: LocalizeFunc;
29+
@property({ attribute: false }) public onboardingLocalize!: LocalizeFunc;
3030

3131
@state() private _working = false;
3232

src/onboarding/onboarding-create-user.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ const CREATE_USER_SCHEMA: HaFormSchema[] = [
4343

4444
@customElement("onboarding-create-user")
4545
class OnboardingCreateUser extends LitElement {
46-
@property() public localize!: LocalizeFunc;
46+
@property({ attribute: false }) public localize!: LocalizeFunc;
4747

4848
@property() public language!: string;
4949

src/onboarding/onboarding-integrations.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ const HIDDEN_DOMAINS = new Set([
3636
class OnboardingIntegrations extends SubscribeMixin(LitElement) {
3737
@property({ attribute: false }) public hass!: HomeAssistant;
3838

39-
@property() public onboardingLocalize!: LocalizeFunc;
39+
@property({ attribute: false }) public onboardingLocalize!: LocalizeFunc;
4040

4141
@state() private _entries: ConfigEntry[] = [];
4242

src/onboarding/onboarding-location.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ const LOCATION_MARKER_ID = "location";
4848
class OnboardingLocation extends LitElement {
4949
@property({ attribute: false }) public hass!: HomeAssistant;
5050

51-
@property() public onboardingLocalize!: LocalizeFunc;
51+
@property({ attribute: false }) public onboardingLocalize!: LocalizeFunc;
5252

5353
@state() private _working = false;
5454

src/onboarding/onboarding-welcome-links.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import "./onboarding-welcome-link";
1919
class OnboardingWelcomeLinks extends LitElement {
2020
@property({ attribute: false }) public hass!: HomeAssistant;
2121

22-
@property() public localize!: LocalizeFunc;
22+
@property({ attribute: false }) public localize!: LocalizeFunc;
2323

2424
@property({ type: Boolean }) public mobileApp = false;
2525

0 commit comments

Comments
 (0)