Replace all private properties with internalProperty decorator (#6386)

pull/6392/head
Bram Kragten 2020-07-15 06:38:36 +02:00 committed by GitHub
parent 9cd2d0df93
commit f8c5eeab5d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
357 changed files with 1236 additions and 920 deletions

View File

@ -8,6 +8,7 @@ import {
html, html,
LitElement, LitElement,
property, property,
internalProperty,
TemplateResult, TemplateResult,
} from "lit-element"; } from "lit-element";
import { CastManager } from "../../../../src/cast/cast_manager"; import { CastManager } from "../../../../src/cast/cast_manager";
@ -41,9 +42,9 @@ class HcCast extends LitElement {
@property() public castManager!: CastManager; @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 { protected render(): TemplateResult {
if (this.lovelaceConfig === undefined) { if (this.lovelaceConfig === undefined) {

View File

@ -17,8 +17,8 @@ import {
customElement, customElement,
html, html,
LitElement, LitElement,
property,
TemplateResult, TemplateResult,
internalProperty,
} from "lit-element"; } from "lit-element";
import { CastManager, getCastManager } from "../../../../src/cast/cast_manager"; import { CastManager, getCastManager } from "../../../../src/cast/cast_manager";
import { castSendShowDemo } from "../../../../src/cast/receiver_messages"; import { castSendShowDemo } from "../../../../src/cast/receiver_messages";
@ -60,19 +60,19 @@ const INTRO = html`
@customElement("hc-connect") @customElement("hc-connect")
export class HcConnect extends LitElement { export class HcConnect extends LitElement {
@property() private loading = false; @internalProperty() private loading = false;
// If we had stored credentials but we cannot connect, // If we had stored credentials but we cannot connect,
// show a screen asking retry or logout. // 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; private openDemo = false;

View File

@ -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 { mockHistory } from "../../../../demo/src/stubs/history";
import { LovelaceConfig } from "../../../../src/data/lovelace"; import { LovelaceConfig } from "../../../../src/data/lovelace";
import { import {
@ -13,9 +19,9 @@ import "./hc-lovelace";
@customElement("hc-demo") @customElement("hc-demo")
class HcDemo extends HassElement { 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 { protected render(): TemplateResult {
if (!this._lovelaceConfig) { if (!this._lovelaceConfig) {

View File

@ -11,7 +11,7 @@ import { HomeAssistant } from "../../../../src/types";
@customElement("hc-launch-screen") @customElement("hc-launch-screen")
class HcLaunchScreen extends LitElement { class HcLaunchScreen extends LitElement {
@property() public hass?: HomeAssistant; @property({ attribute: false }) public hass?: HomeAssistant;
@property() public error?: string; @property() public error?: string;

View File

@ -16,9 +16,9 @@ import "./hc-launch-screen";
@customElement("hc-lovelace") @customElement("hc-lovelace")
class HcLovelace extends LitElement { 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; @property() public viewPath?: string | number;

View File

@ -3,7 +3,12 @@ import {
getAuth, getAuth,
UnsubscribeFunc, UnsubscribeFunc,
} from "home-assistant-js-websocket"; } 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 { CAST_NS } from "../../../../src/cast/const";
import { import {
ConnectMessage, ConnectMessage,
@ -31,13 +36,13 @@ let resourcesLoaded = false;
@customElement("hc-main") @customElement("hc-main")
export class HcMain extends HassElement { 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; private _unsubLovelace?: UnsubscribeFunc;

View File

@ -4,7 +4,7 @@ import {
customElement, customElement,
html, html,
LitElement, LitElement,
property, internalProperty,
TemplateResult, TemplateResult,
} from "lit-element"; } from "lit-element";
import { CastManager } from "../../../src/cast/cast_manager"; import { CastManager } from "../../../src/cast/cast_manager";
@ -20,7 +20,7 @@ import { HomeAssistant } from "../../../src/types";
class CastDemoRow extends LitElement implements LovelaceRow { class CastDemoRow extends LitElement implements LovelaceRow {
public hass!: HomeAssistant; public hass!: HomeAssistant;
@property() private _castManager?: CastManager | null; @internalProperty() private _castManager?: CastManager | null;
public setConfig(_config: CastConfig): void { public setConfig(_config: CastConfig): void {
// No config possible. // No config possible.

View File

@ -5,6 +5,7 @@ import {
html, html,
LitElement, LitElement,
property, property,
internalProperty,
TemplateResult, TemplateResult,
} from "lit-element"; } from "lit-element";
import { until } from "lit-html/directives/until"; import { until } from "lit-html/directives/until";
@ -21,11 +22,11 @@ import {
} from "../configs/demo-configs"; } from "../configs/demo-configs";
export class HADemoCard extends LitElement implements LovelaceCard { 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; private _hidden = localStorage.hide_demo_card;

View File

@ -21,7 +21,7 @@ import { filterAndSort } from "../components/hassio-filter-addons";
import { hassioStyle } from "../resources/hassio-style"; import { hassioStyle } from "../resources/hassio-style";
class HassioAddonRepositoryEl extends LitElement { class HassioAddonRepositoryEl extends LitElement {
@property() public hass!: HomeAssistant; @property({ attribute: false }) public hass!: HomeAssistant;
@property() public repo!: HassioAddonRepository; @property() public repo!: HassioAddonRepository;

View File

@ -6,6 +6,7 @@ import {
CSSResult, CSSResult,
LitElement, LitElement,
property, property,
internalProperty,
PropertyValues, PropertyValues,
} from "lit-element"; } from "lit-element";
import { html, TemplateResult } from "lit-html"; import { html, TemplateResult } from "lit-html";
@ -52,7 +53,7 @@ class HassioAddonStore extends LitElement {
@property({ attribute: false }) private _repos?: HassioAddonRepository[]; @property({ attribute: false }) private _repos?: HassioAddonRepository[];
@property() private _filter?: string; @internalProperty() private _filter?: string;
public async refreshData() { public async refreshData() {
this._repos = undefined; this._repos = undefined;

View File

@ -9,6 +9,7 @@ import {
html, html,
LitElement, LitElement,
property, property,
internalProperty,
PropertyValues, PropertyValues,
TemplateResult, TemplateResult,
} from "lit-element"; } from "lit-element";
@ -34,15 +35,15 @@ class HassioAddonAudio extends LitElement {
@property({ attribute: false }) public addon!: HassioAddonDetails; @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 { protected render(): TemplateResult {
return html` return html`

View File

@ -7,6 +7,7 @@ import {
html, html,
LitElement, LitElement,
property, property,
internalProperty,
PropertyValues, PropertyValues,
query, query,
TemplateResult, TemplateResult,
@ -32,7 +33,7 @@ class HassioAddonConfig extends LitElement {
@property({ attribute: false }) public addon!: HassioAddonDetails; @property({ attribute: false }) public addon!: HassioAddonDetails;
@property() private _error?: string; @internalProperty() private _error?: string;
@property({ type: Boolean }) private _configHasChanged = false; @property({ type: Boolean }) private _configHasChanged = false;

View File

@ -6,6 +6,7 @@ import {
html, html,
LitElement, LitElement,
property, property,
internalProperty,
PropertyValues, PropertyValues,
TemplateResult, TemplateResult,
} from "lit-element"; } from "lit-element";
@ -37,9 +38,9 @@ class HassioAddonNetwork extends LitElement {
@property({ attribute: false }) public addon!: HassioAddonDetails; @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 { public connectedCallback(): void {
super.connectedCallback(); super.connectedCallback();

View File

@ -5,6 +5,7 @@ import {
html, html,
LitElement, LitElement,
property, property,
internalProperty,
TemplateResult, TemplateResult,
} from "lit-element"; } from "lit-element";
import "../../../../src/components/ha-markdown"; import "../../../../src/components/ha-markdown";
@ -24,9 +25,9 @@ class HassioAddonDocumentationDashboard extends LitElement {
@property({ attribute: false }) public addon?: HassioAddonDetails; @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<void> { public async connectedCallback(): Promise<void> {
super.connectedCallback(); super.connectedCallback();

View File

@ -23,6 +23,7 @@ import {
html, html,
LitElement, LitElement,
property, property,
internalProperty,
TemplateResult, TemplateResult,
} from "lit-element"; } from "lit-element";
import { classMap } from "lit-html/directives/class-map"; import { classMap } from "lit-html/directives/class-map";
@ -124,7 +125,7 @@ class HassioAddonInfo extends LitElement {
@property({ attribute: false }) public addon!: HassioAddonDetails; @property({ attribute: false }) public addon!: HassioAddonDetails;
@property() private _error?: string; @internalProperty() private _error?: string;
@property({ type: Boolean }) private _installing = false; @property({ type: Boolean }) private _installing = false;

View File

@ -6,6 +6,7 @@ import {
html, html,
LitElement, LitElement,
property, property,
internalProperty,
TemplateResult, TemplateResult,
} from "lit-element"; } from "lit-element";
import "../../../../src/components/ha-card"; import "../../../../src/components/ha-card";
@ -24,9 +25,9 @@ class HassioAddonLogs extends LitElement {
@property({ attribute: false }) public addon!: HassioAddonDetails; @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<void> { public async connectedCallback(): Promise<void> {
super.connectedCallback(); super.connectedCallback();

View File

@ -14,7 +14,7 @@ import { HomeAssistant } from "../../../src/types";
@customElement("hassio-card-content") @customElement("hassio-card-content")
class HassioCardContent extends LitElement { class HassioCardContent extends LitElement {
@property() public hass!: HomeAssistant; @property({ attribute: false }) public hass!: HomeAssistant;
@property() public title!: string; @property() public title!: string;

View File

@ -19,7 +19,7 @@ import { hassioStyle } from "../resources/hassio-style";
@customElement("hassio-addons") @customElement("hassio-addons")
class HassioAddons extends LitElement { class HassioAddons extends LitElement {
@property() public hass!: HomeAssistant; @property({ attribute: false }) public hass!: HomeAssistant;
@property() public addons?: HassioAddonInfo[]; @property() public addons?: HassioAddonInfo[];

View File

@ -7,6 +7,7 @@ import {
html, html,
LitElement, LitElement,
property, property,
internalProperty,
TemplateResult, TemplateResult,
} from "lit-element"; } from "lit-element";
import "../../../src/components/buttons/ha-call-api-button"; import "../../../src/components/buttons/ha-call-api-button";
@ -23,15 +24,15 @@ import { hassioStyle } from "../resources/hassio-style";
@customElement("hassio-update") @customElement("hassio-update")
export class HassioUpdate extends LitElement { 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() public supervisorInfo: HassioSupervisorInfo;
@property() private _error?: string; @internalProperty() private _error?: string;
protected render(): TemplateResult { protected render(): TemplateResult {
const updatesAvailable: number = [ const updatesAvailable: number = [

View File

@ -5,6 +5,7 @@ import {
html, html,
LitElement, LitElement,
property, property,
internalProperty,
TemplateResult, TemplateResult,
} from "lit-element"; } from "lit-element";
import { createCloseHeading } from "../../../../src/components/ha-dialog"; import { createCloseHeading } from "../../../../src/components/ha-dialog";
@ -16,13 +17,13 @@ import { HassioMarkdownDialogParams } from "./show-dialog-hassio-markdown";
@customElement("dialog-hassio-markdown") @customElement("dialog-hassio-markdown")
class HassioMarkdownDialog extends LitElement { class HassioMarkdownDialog extends LitElement {
@property() public hass!: HomeAssistant; @property({ attribute: false }) public hass!: HomeAssistant;
@property() public title!: string; @property() public title!: string;
@property() public content!: string; @property() public content!: string;
@property() private _opened = false; @internalProperty() private _opened = false;
public showDialog(params: HassioMarkdownDialogParams) { public showDialog(params: HassioMarkdownDialogParams) {
this.title = params.title; this.title = params.title;

View File

@ -13,6 +13,7 @@ import {
html, html,
LitElement, LitElement,
property, property,
internalProperty,
query, query,
TemplateResult, TemplateResult,
} from "lit-element"; } from "lit-element";
@ -39,11 +40,11 @@ class HassioRepositoriesDialog extends LitElement {
@query("#repository_input") private _optionInput?: PaperInputElement; @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<void> { public async showDialog(_dialogParams: any): Promise<void> {
this._dialogParams = _dialogParams; this._dialogParams = _dialogParams;

View File

@ -9,6 +9,7 @@ import {
html, html,
LitElement, LitElement,
property, property,
internalProperty,
TemplateResult, TemplateResult,
} from "lit-element"; } from "lit-element";
import { createCloseHeading } from "../../../../src/components/ha-dialog"; import { createCloseHeading } from "../../../../src/components/ha-dialog";
@ -68,21 +69,21 @@ interface FolderItem {
@customElement("dialog-hassio-snapshot") @customElement("dialog-hassio-snapshot")
class HassioSnapshotDialog extends LitElement { 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) { public async showDialog(params: HassioSnapshotDialogParams) {
this._snapshot = await fetchHassioSnapshotInfo(this.hass, params.slug); this._snapshot = await fetchHassioSnapshotInfo(this.hass, params.slug);

View File

@ -1,5 +1,10 @@
import { PolymerElement } from "@polymer/polymer"; 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 { applyThemesOnElement } from "../../src/common/dom/apply_themes_on_element";
import { fireEvent } from "../../src/common/dom/fire_event"; import { fireEvent } from "../../src/common/dom/fire_event";
import { navigate } from "../../src/common/navigate"; import { navigate } from "../../src/common/navigate";
@ -37,7 +42,7 @@ import "./hassio-panel";
@customElement("hassio-main") @customElement("hassio-main")
class HassioMain extends ProvideHassLitMixin(HassRouterPage) { class HassioMain extends ProvideHassLitMixin(HassRouterPage) {
@property() public hass!: HomeAssistant; @property({ attribute: false }) public hass!: HomeAssistant;
@property() public panel!: HassioPanelInfo; @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) { protected firstUpdated(changedProps: PropertyValues) {
super.firstUpdated(changedProps); super.firstUpdated(changedProps);

View File

@ -5,6 +5,7 @@ import {
html, html,
LitElement, LitElement,
property, property,
internalProperty,
PropertyValues, PropertyValues,
TemplateResult, TemplateResult,
} from "lit-element"; } from "lit-element";
@ -19,11 +20,11 @@ import { HomeAssistant, Route } from "../../../src/types";
@customElement("hassio-ingress-view") @customElement("hassio-ingress-view")
class HassioIngressView extends LitElement { class HassioIngressView extends LitElement {
@property() public hass!: HomeAssistant; @property({ attribute: false }) public hass!: HomeAssistant;
@property() public route!: Route; @property() public route!: Route;
@property() private _addon?: HassioAddonDetails; @internalProperty() private _addon?: HassioAddonDetails;
protected render(): TemplateResult { protected render(): TemplateResult {
if (!this._addon) { if (!this._addon) {

View File

@ -15,6 +15,7 @@ import {
html, html,
LitElement, LitElement,
property, property,
internalProperty,
PropertyValues, PropertyValues,
TemplateResult, TemplateResult,
} from "lit-element"; } from "lit-element";
@ -56,19 +57,19 @@ class HassioSnapshots extends LitElement {
@property({ attribute: false }) public supervisorInfo!: HassioSupervisorInfo; @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", slug: "homeassistant",
name: "Home Assistant configuration", name: "Home Assistant configuration",
@ -79,9 +80,9 @@ class HassioSnapshots extends LitElement {
{ slug: "addons/local", name: "Local add-ons", checked: true }, { 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() { public async refreshData() {
await reloadHassioSnapshots(this.hass); await reloadHassioSnapshots(this.hass);

View File

@ -6,6 +6,7 @@ import {
html, html,
LitElement, LitElement,
property, property,
internalProperty,
TemplateResult, TemplateResult,
} from "lit-element"; } from "lit-element";
import "../../../src/components/buttons/ha-call-api-button"; import "../../../src/components/buttons/ha-call-api-button";
@ -32,15 +33,15 @@ import { hassioStyle } from "../resources/hassio-style";
@customElement("hassio-host-info") @customElement("hassio-host-info")
class HassioHostInfo extends LitElement { class HassioHostInfo extends LitElement {
@property() public hass!: HomeAssistant; @property({ attribute: false }) public hass!: HomeAssistant;
@property() public hostInfo!: HassioHostInfoType; @property() public hostInfo!: HassioHostInfoType;
@property({ attribute: false }) public hassioInfo!: HassioInfo; @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 { public render(): TemplateResult | void {
return html` return html`

View File

@ -6,6 +6,7 @@ import {
html, html,
LitElement, LitElement,
property, property,
internalProperty,
TemplateResult, TemplateResult,
} from "lit-element"; } from "lit-element";
import { fireEvent } from "../../../src/common/dom/fire_event"; import { fireEvent } from "../../../src/common/dom/fire_event";
@ -23,11 +24,11 @@ import { hassioStyle } from "../resources/hassio-style";
@customElement("hassio-supervisor-info") @customElement("hassio-supervisor-info")
class HassioSupervisorInfo extends LitElement { class HassioSupervisorInfo extends LitElement {
@property() public hass!: HomeAssistant; @property({ attribute: false }) public hass!: HomeAssistant;
@property() public supervisorInfo!: HassioSupervisorInfoType; @property() public supervisorInfo!: HassioSupervisorInfoType;
@property() private _errors?: string; @internalProperty() private _errors?: string;
public render(): TemplateResult | void { public render(): TemplateResult | void {
return html` return html`

View File

@ -9,6 +9,7 @@ import {
html, html,
LitElement, LitElement,
property, property,
internalProperty,
TemplateResult, TemplateResult,
} from "lit-element"; } from "lit-element";
import "../../../src/components/ha-card"; import "../../../src/components/ha-card";
@ -55,11 +56,11 @@ const logProviders: LogProvider[] = [
class HassioSupervisorLog extends LitElement { class HassioSupervisorLog extends LitElement {
@property({ attribute: false }) public hass!: HomeAssistant; @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<void> { public async connectedCallback(): Promise<void> {
super.connectedCallback(); super.connectedCallback();

View File

@ -5,6 +5,7 @@ import {
html, html,
LitElement, LitElement,
property, property,
internalProperty,
PropertyValues, PropertyValues,
TemplateResult, TemplateResult,
} from "lit-element"; } from "lit-element";
@ -28,13 +29,13 @@ class HaAuthFlow extends litLocalizeLiteMixin(LitElement) {
@property() public oauth2State?: string; @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() { protected render() {
return html` return html`

View File

@ -4,6 +4,7 @@ import {
html, html,
LitElement, LitElement,
property, property,
internalProperty,
PropertyValues, PropertyValues,
} from "lit-element"; } from "lit-element";
import { import {
@ -25,9 +26,9 @@ class HaAuthorize extends litLocalizeLiteMixin(LitElement) {
@property() public oauth2State?: string; @property() public oauth2State?: string;
@property() private _authProvider?: AuthProvider; @internalProperty() private _authProvider?: AuthProvider;
@property() private _authProviders?: AuthProvider[]; @internalProperty() private _authProviders?: AuthProvider[];
constructor() { constructor() {
super(); super();

View File

@ -23,7 +23,8 @@ const _load = (
if (type) { if (type) {
(element as HTMLScriptElement).type = type; (element as HTMLScriptElement).type = type;
// https://github.com/home-assistant/frontend/pull/6328 // 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; break;
case "link": case "link":

View File

@ -6,11 +6,11 @@ import {
html, html,
LitElement, LitElement,
property, property,
internalProperty,
PropertyValues, PropertyValues,
query, query,
TemplateResult, TemplateResult,
eventOptions, eventOptions,
internalProperty,
} from "lit-element"; } from "lit-element";
import { classMap } from "lit-html/directives/class-map"; import { classMap } from "lit-html/directives/class-map";
import { ifDefined } from "lit-html/directives/if-defined"; import { ifDefined } from "lit-html/directives/if-defined";

View File

@ -13,6 +13,7 @@ import {
html, html,
LitElement, LitElement,
property, property,
internalProperty,
PropertyValues, PropertyValues,
TemplateResult, TemplateResult,
} from "lit-element"; } from "lit-element";
@ -87,7 +88,7 @@ const rowRenderer = (
@customElement("ha-area-devices-picker") @customElement("ha-area-devices-picker")
export class HaAreaDevicesPicker extends SubscribeMixin(LitElement) { export class HaAreaDevicesPicker extends SubscribeMixin(LitElement) {
@property() public hass!: HomeAssistant; @property({ attribute: false }) public hass!: HomeAssistant;
@property() public label?: string; @property() public label?: string;
@ -124,13 +125,13 @@ export class HaAreaDevicesPicker extends SubscribeMixin(LitElement) {
@property({ type: Boolean }) @property({ type: Boolean })
private _opened?: 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[] = []; private _selectedDevices: string[] = [];

View File

@ -8,6 +8,7 @@ import {
html, html,
LitElement, LitElement,
property, property,
internalProperty,
TemplateResult, TemplateResult,
} from "lit-element"; } from "lit-element";
import { fireEvent } from "../../common/dom/fire_event"; import { fireEvent } from "../../common/dom/fire_event";
@ -24,7 +25,7 @@ const UNKNOWN_AUTOMATION_KEY = "UNKNOWN_AUTOMATION";
export abstract class HaDeviceAutomationPicker< export abstract class HaDeviceAutomationPicker<
T extends DeviceAutomation T extends DeviceAutomation
> extends LitElement { > extends LitElement {
@property() public hass!: HomeAssistant; @property({ attribute: false }) public hass!: HomeAssistant;
@property() public label?: string; @property() public label?: string;
@ -36,11 +37,11 @@ export abstract class HaDeviceAutomationPicker<
protected UNKNOWN_AUTOMATION_TEXT = "Unknown automation"; 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. // Trigger an empty render so we start with a clean DOM.
// paper-listbox does not like changing things around. // paper-listbox does not like changing things around.
@property() private _renderEmpty = false; @internalProperty() private _renderEmpty = false;
private _localizeDeviceAutomation: ( private _localizeDeviceAutomation: (
hass: HomeAssistant, hass: HomeAssistant,

View File

@ -66,7 +66,7 @@ const rowRenderer = (root: HTMLElement, _owner, model: { item: Device }) => {
@customElement("ha-device-picker") @customElement("ha-device-picker")
export class HaDevicePicker extends SubscribeMixin(LitElement) { export class HaDevicePicker extends SubscribeMixin(LitElement) {
@property() public hass!: HomeAssistant; @property({ attribute: false }) public hass!: HomeAssistant;
@property() public label?: string; @property() public label?: string;

View File

@ -12,7 +12,7 @@ import "./ha-device-picker";
@customElement("ha-devices-picker") @customElement("ha-devices-picker")
class HaDevicesPicker extends LitElement { class HaDevicesPicker extends LitElement {
@property() public hass?: HomeAssistant; @property({ attribute: false }) public hass?: HomeAssistant;
@property() public value?: string[]; @property() public value?: string[];

View File

@ -15,7 +15,7 @@ import type { HaEntityPickerEntityFilterFunc } from "./ha-entity-picker";
@customElement("ha-entities-picker") @customElement("ha-entities-picker")
class HaEntitiesPickerLight extends LitElement { class HaEntitiesPickerLight extends LitElement {
@property() public hass?: HomeAssistant; @property({ attribute: false }) public hass?: HomeAssistant;
@property() public value?: string[]; @property() public value?: string[];

View File

@ -59,7 +59,7 @@ class HaEntityPicker extends LitElement {
@property({ type: Boolean, attribute: "allow-custom-entity" }) @property({ type: Boolean, attribute: "allow-custom-entity" })
public allowCustomEntity; public allowCustomEntity;
@property() public hass?: HomeAssistant; @property({ attribute: false }) public hass?: HomeAssistant;
@property() public label?: string; @property() public label?: string;

View File

@ -6,6 +6,7 @@ import {
html, html,
LitElement, LitElement,
property, property,
internalProperty,
PropertyValues, PropertyValues,
TemplateResult, TemplateResult,
} from "lit-element"; } from "lit-element";
@ -28,7 +29,7 @@ export class HaEntityToggle extends LitElement {
@property() public stateObj?: HassEntity; @property() public stateObj?: HassEntity;
@property() private _isOn = false; @internalProperty() private _isOn = false;
protected render(): TemplateResult { protected render(): TemplateResult {
if (!this.stateObj) { if (!this.stateObj) {

View File

@ -6,6 +6,7 @@ import {
html, html,
LitElement, LitElement,
property, property,
internalProperty,
PropertyValues, PropertyValues,
TemplateResult, TemplateResult,
} from "lit-element"; } from "lit-element";
@ -22,7 +23,7 @@ import "../ha-label-badge";
@customElement("ha-state-label-badge") @customElement("ha-state-label-badge")
export class HaStateLabelBadge extends LitElement { export class HaStateLabelBadge extends LitElement {
@property() public hass?: HomeAssistant; @property({ attribute: false }) public hass?: HomeAssistant;
@property() public state?: HassEntity; @property() public state?: HassEntity;
@ -32,7 +33,7 @@ export class HaStateLabelBadge extends LitElement {
@property() public image?: string; @property() public image?: string;
@property() private _timerTimeRemaining?: number; @internalProperty() private _timerTimeRemaining?: number;
private _connected?: boolean; private _connected?: boolean;

View File

@ -6,6 +6,7 @@ import {
html, html,
LitElement, LitElement,
property, property,
internalProperty,
PropertyValues, PropertyValues,
TemplateResult, TemplateResult,
} from "lit-element"; } from "lit-element";
@ -31,7 +32,7 @@ export class StateBadge extends LitElement {
@property({ type: Boolean, reflect: true, attribute: "icon" }) @property({ type: Boolean, reflect: true, attribute: "icon" })
private _showIcon = true; private _showIcon = true;
@property() private _iconStyle: { [name: string]: string } = {}; @internalProperty() private _iconStyle: { [name: string]: string } = {};
protected render(): TemplateResult { protected render(): TemplateResult {
const stateObj = this.stateObj; const stateObj = this.stateObj;

View File

@ -12,6 +12,7 @@ import {
html, html,
LitElement, LitElement,
property, property,
internalProperty,
TemplateResult, TemplateResult,
} from "lit-element"; } from "lit-element";
import { fireEvent } from "../common/dom/fire_event"; import { fireEvent } from "../common/dom/fire_event";
@ -61,7 +62,7 @@ const rowRenderer = (
@customElement("ha-area-picker") @customElement("ha-area-picker")
export class HaAreaPicker extends SubscribeMixin(LitElement) { export class HaAreaPicker extends SubscribeMixin(LitElement) {
@property() public hass!: HomeAssistant; @property({ attribute: false }) public hass!: HomeAssistant;
@property() public label?: string; @property() public label?: string;
@ -72,7 +73,7 @@ export class HaAreaPicker extends SubscribeMixin(LitElement) {
@property({ type: Boolean, attribute: "no-add" }) @property({ type: Boolean, attribute: "no-add" })
public noAdd?: boolean; public noAdd?: boolean;
@property() private _opened?: boolean; @internalProperty() private _opened?: boolean;
public hassSubscribe(): UnsubscribeFunc[] { public hassSubscribe(): UnsubscribeFunc[] {
return [ return [

View File

@ -5,6 +5,7 @@ import {
html, html,
LitElement, LitElement,
property, property,
internalProperty,
PropertyValues, PropertyValues,
TemplateResult, TemplateResult,
} from "lit-element"; } from "lit-element";
@ -22,17 +23,17 @@ type HLSModule = typeof import("hls.js");
@customElement("ha-camera-stream") @customElement("ha-camera-stream")
class HaCameraStream extends LitElement { class HaCameraStream extends LitElement {
@property() public hass?: HomeAssistant; @property({ attribute: false }) public hass?: HomeAssistant;
@property() public stateObj?: CameraEntity; @property() public stateObj?: CameraEntity;
@property({ type: Boolean }) public showControls = false; @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 // We keep track if we should force MJPEG with a string
// that way it automatically resets if we change entity. // that way it automatically resets if we change entity.
@property() private _forceMJPEG: string | undefined = undefined; @internalProperty() private _forceMJPEG: string | undefined = undefined;
private _hlsPolyfillInstance?: Hls; private _hlsPolyfillInstance?: Hls;

View File

@ -2,6 +2,7 @@ import { Editor } from "codemirror";
import { import {
customElement, customElement,
property, property,
internalProperty,
PropertyValues, PropertyValues,
UpdatingElement, UpdatingElement,
} from "lit-element"; } from "lit-element";
@ -28,7 +29,7 @@ export class HaCodeEditor extends UpdatingElement {
@property() public error = false; @property() public error = false;
@property() private _value = ""; @internalProperty() private _value = "";
public set value(value: string) { public set value(value: string) {
this._value = value; this._value = value;

View File

@ -24,7 +24,7 @@ export interface DateRangePickerRanges {
@customElement("ha-date-range-picker") @customElement("ha-date-range-picker")
export class HaDateRangePicker extends LitElement { export class HaDateRangePicker extends LitElement {
@property() public hass!: HomeAssistant; @property({ attribute: false }) public hass!: HomeAssistant;
@property() public startDate!: Date; @property() public startDate!: Date;

View File

@ -11,6 +11,7 @@ import {
html, html,
LitElement, LitElement,
property, property,
internalProperty,
query, query,
TemplateResult, TemplateResult,
} from "lit-element"; } from "lit-element";
@ -32,7 +33,7 @@ export class HaFormMultiSelect extends LitElement implements HaFormElement {
@property() public suffix!: string; @property() public suffix!: string;
@property() private _init = false; @internalProperty() private _init = false;
@query("paper-menu-button") private _input?: HTMLElement; @query("paper-menu-button") private _input?: HTMLElement;

View File

@ -6,6 +6,7 @@ import {
html, html,
LitElement, LitElement,
property, property,
internalProperty,
query, query,
TemplateResult, TemplateResult,
} from "lit-element"; } from "lit-element";
@ -26,7 +27,7 @@ export class HaFormString extends LitElement implements HaFormElement {
@property() public suffix!: string; @property() public suffix!: string;
@property() private _unmaskedPassword = false; @internalProperty() private _unmaskedPassword = false;
@query("paper-input") private _input?: HTMLElement; @query("paper-input") private _input?: HTMLElement;

View File

@ -1,6 +1,7 @@
import { import {
LitElement, LitElement,
property, property,
internalProperty,
TemplateResult, TemplateResult,
html, html,
customElement, customElement,
@ -13,7 +14,7 @@ import "./ha-svg-icon";
export class HaIconButtonArrowNext extends LitElement { export class HaIconButtonArrowNext extends LitElement {
@property({ type: Boolean }) public disabled = false; @property({ type: Boolean }) public disabled = false;
@property() private _icon = mdiArrowRight; @internalProperty() private _icon = mdiArrowRight;
public connectedCallback() { public connectedCallback() {
super.connectedCallback(); super.connectedCallback();

View File

@ -1,6 +1,7 @@
import { import {
LitElement, LitElement,
property, property,
internalProperty,
TemplateResult, TemplateResult,
html, html,
customElement, customElement,
@ -13,7 +14,7 @@ import "./ha-svg-icon";
export class HaIconButtonArrowPrev extends LitElement { export class HaIconButtonArrowPrev extends LitElement {
@property({ type: Boolean }) public disabled = false; @property({ type: Boolean }) public disabled = false;
@property() private _icon = mdiArrowLeft; @internalProperty() private _icon = mdiArrowLeft;
public connectedCallback() { public connectedCallback() {
super.connectedCallback(); super.connectedCallback();

View File

@ -1,6 +1,7 @@
import { import {
LitElement, LitElement,
property, property,
internalProperty,
TemplateResult, TemplateResult,
html, html,
customElement, customElement,
@ -13,7 +14,7 @@ import "./ha-svg-icon";
export class HaIconButtonNext extends LitElement { export class HaIconButtonNext extends LitElement {
@property({ type: Boolean }) public disabled = false; @property({ type: Boolean }) public disabled = false;
@property() private _icon = mdiChevronRight; @internalProperty() private _icon = mdiChevronRight;
public connectedCallback() { public connectedCallback() {
super.connectedCallback(); super.connectedCallback();

View File

@ -1,6 +1,7 @@
import { import {
LitElement, LitElement,
property, property,
internalProperty,
TemplateResult, TemplateResult,
html, html,
customElement, customElement,
@ -13,7 +14,7 @@ import "./ha-svg-icon";
export class HaIconButtonPrev extends LitElement { export class HaIconButtonPrev extends LitElement {
@property({ type: Boolean }) public disabled = false; @property({ type: Boolean }) public disabled = false;
@property() private _icon = mdiChevronLeft; @internalProperty() private _icon = mdiChevronLeft;
public connectedCallback() { public connectedCallback() {
super.connectedCallback(); super.connectedCallback();

View File

@ -3,6 +3,7 @@ import {
customElement, customElement,
LitElement, LitElement,
property, property,
internalProperty,
PropertyValues, PropertyValues,
html, html,
TemplateResult, TemplateResult,
@ -233,11 +234,11 @@ const cachedIcons: { [key: string]: string } = {};
export class HaIcon extends LitElement { export class HaIcon extends LitElement {
@property() public icon?: string; @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) { protected updated(changedProps: PropertyValues) {
if (changedProps.has("icon")) { if (changedProps.has("icon")) {

View File

@ -8,6 +8,7 @@ import {
html, html,
LitElement, LitElement,
property, property,
internalProperty,
TemplateResult, TemplateResult,
} from "lit-element"; } from "lit-element";
import { fireEvent } from "../common/dom/fire_event"; import { fireEvent } from "../common/dom/fire_event";
@ -22,9 +23,9 @@ class HaMenuButton extends LitElement {
@property() public narrow!: boolean; @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; private _alwaysVisible = false;

View File

@ -6,6 +6,7 @@ import {
html, html,
LitElement, LitElement,
property, property,
internalProperty,
PropertyValues, PropertyValues,
TemplateResult, TemplateResult,
} from "lit-element"; } from "lit-element";
@ -27,19 +28,19 @@ import "./ha-switch";
@customElement("ha-related-items") @customElement("ha-related-items")
export class HaRelatedItems extends SubscribeMixin(LitElement) { export class HaRelatedItems extends SubscribeMixin(LitElement) {
@property() public hass!: HomeAssistant; @property({ attribute: false }) public hass!: HomeAssistant;
@property() public itemType!: ItemType; @property() public itemType!: ItemType;
@property() public itemId!: string; @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[] { public hassSubscribe(): UnsubscribeFunc[] {
return [ return [

View File

@ -18,6 +18,7 @@ import {
customElement, customElement,
LitElement, LitElement,
property, property,
internalProperty,
PropertyValues, PropertyValues,
} from "lit-element"; } from "lit-element";
import { classMap } from "lit-html/directives/class-map"; import { classMap } from "lit-html/directives/class-map";
@ -111,7 +112,7 @@ const computePanels = (hass: HomeAssistant): [PanelInfo[], PanelInfo[]] => {
@customElement("ha-sidebar") @customElement("ha-sidebar")
class HaSidebar extends LitElement { class HaSidebar extends LitElement {
@property() public hass!: HomeAssistant; @property({ attribute: false }) public hass!: HomeAssistant;
@property() public narrow!: boolean; @property() public narrow!: boolean;
@ -119,9 +120,9 @@ class HaSidebar extends LitElement {
@property({ type: Boolean, reflect: true }) public expanded = false; @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 // property used only in css
// @ts-ignore // @ts-ignore

View File

@ -4,10 +4,10 @@ import {
customElement, customElement,
LitElement, LitElement,
property, property,
internalProperty,
TemplateResult, TemplateResult,
html, html,
queryAsync, queryAsync,
internalProperty,
eventOptions, eventOptions,
} from "lit-element"; } from "lit-element";
import "@material/mwc-ripple/mwc-ripple"; import "@material/mwc-ripple/mwc-ripple";

View File

@ -4,6 +4,7 @@ import {
html, html,
LitElement, LitElement,
property, property,
internalProperty,
query, query,
TemplateResult, TemplateResult,
} from "lit-element"; } from "lit-element";
@ -41,7 +42,7 @@ export class HaYamlEditor extends LitElement {
@property() public label?: string; @property() public label?: string;
@property() private _yaml = ""; @internalProperty() private _yaml = "";
@query("ha-code-editor") private _editor?: HaCodeEditor; @query("ha-code-editor") private _editor?: HaCodeEditor;

View File

@ -22,7 +22,7 @@ import { HomeAssistant } from "../../types";
@customElement("ha-map") @customElement("ha-map")
class HaMap extends LitElement { class HaMap extends LitElement {
@property() public hass?: HomeAssistant; @property({ attribute: false }) public hass?: HomeAssistant;
@property() public entities?: string[]; @property() public entities?: string[];

View File

@ -5,7 +5,13 @@ import { HomeAssistant } from "../types";
import { DataEntryFlowProgress, DataEntryFlowStep } from "./data_entry_flow"; import { DataEntryFlowProgress, DataEntryFlowStep } from "./data_entry_flow";
import { domainToName } from "./integration"; 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) => export const createConfigFlow = (hass: HomeAssistant, handler: string) =>
hass.callApi<DataEntryFlowStep>("POST", "config/config_entries/flow", { hass.callApi<DataEntryFlowStep>("POST", "config/config_entries/flow", {

View File

@ -7,6 +7,7 @@ import {
html, html,
LitElement, LitElement,
property, property,
internalProperty,
TemplateResult, TemplateResult,
} from "lit-element"; } from "lit-element";
import "../../components/dialog/ha-paper-dialog"; import "../../components/dialog/ha-paper-dialog";
@ -26,17 +27,17 @@ import { computeRTLDirection } from "../../common/util/compute_rtl";
@customElement("dialog-config-entry-system-options") @customElement("dialog-config-entry-system-options")
class DialogConfigEntrySystemOptions extends LitElement { 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( public async showDialog(
params: ConfigEntrySystemOptionsDialogParams params: ConfigEntrySystemOptionsDialogParams

View File

@ -10,7 +10,7 @@ import {
customElement, customElement,
html, html,
LitElement, LitElement,
property, internalProperty,
PropertyValues, PropertyValues,
TemplateResult, TemplateResult,
} from "lit-element"; } from "lit-element";
@ -54,23 +54,23 @@ declare global {
class DataEntryFlowDialog extends LitElement { class DataEntryFlowDialog extends LitElement {
public hass!: HomeAssistant; public hass!: HomeAssistant;
@property() private _params?: DataEntryFlowDialogParams; @internalProperty() private _params?: DataEntryFlowDialogParams;
@property() private _loading = true; @internalProperty() private _loading = true;
private _instance = instance; private _instance = instance;
@property() private _step: @internalProperty() private _step:
| DataEntryFlowStep | DataEntryFlowStep
| undefined | undefined
// Null means we need to pick a config flow // Null means we need to pick a config flow
| null; | 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; private _unsubAreas?: UnsubscribeFunc;

View File

@ -8,6 +8,7 @@ import {
html, html,
LitElement, LitElement,
property, property,
internalProperty,
TemplateResult, TemplateResult,
} from "lit-element"; } from "lit-element";
import { classMap } from "lit-html/directives/class-map"; import { classMap } from "lit-html/directives/class-map";
@ -31,13 +32,13 @@ interface HandlerObj {
class StepFlowPickHandler extends LitElement { class StepFlowPickHandler extends LitElement {
public flowConfig!: FlowConfig; public flowConfig!: FlowConfig;
@property() public hass!: HomeAssistant; @property({ attribute: false }) public hass!: HomeAssistant;
@property() public handlers!: string[]; @property() public handlers!: string[];
@property() public showAdvanced?: boolean; @property() public showAdvanced?: boolean;
@property() private filter?: string; @internalProperty() private filter?: string;
private _width?: number; private _width?: number;

View File

@ -11,6 +11,7 @@ import {
html, html,
LitElement, LitElement,
property, property,
internalProperty,
TemplateResult, TemplateResult,
} from "lit-element"; } from "lit-element";
import "../../components/dialog/ha-paper-dialog"; import "../../components/dialog/ha-paper-dialog";
@ -23,15 +24,15 @@ import { DeviceRegistryDetailDialogParams } from "./show-dialog-device-registry-
@customElement("dialog-device-registry-detail") @customElement("dialog-device-registry-detail")
class DialogDeviceRegistryDetail extends LitElement { 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; private _submitting?: boolean;

View File

@ -5,7 +5,7 @@ import {
customElement, customElement,
html, html,
LitElement, LitElement,
property, internalProperty,
TemplateResult, TemplateResult,
} from "lit-element"; } from "lit-element";
import "../../components/dialog/ha-paper-dialog"; import "../../components/dialog/ha-paper-dialog";
@ -19,7 +19,7 @@ import { HaDomainTogglerDialogParams } from "./show-dialog-domain-toggler";
class DomainTogglerDialog extends LitElement { class DomainTogglerDialog extends LitElement {
public hass!: HomeAssistant; public hass!: HomeAssistant;
@property() private _params?: HaDomainTogglerDialogParams; @internalProperty() private _params?: HaDomainTogglerDialogParams;
public async showDialog(params: HaDomainTogglerDialogParams): Promise<void> { public async showDialog(params: HaDomainTogglerDialogParams): Promise<void> {
this._params = params; this._params = params;

View File

@ -7,6 +7,7 @@ import {
html, html,
LitElement, LitElement,
property, property,
internalProperty,
TemplateResult, TemplateResult,
} from "lit-element"; } from "lit-element";
import { classMap } from "lit-html/directives/class-map"; import { classMap } from "lit-html/directives/class-map";
@ -20,11 +21,11 @@ import { fireEvent } from "../../common/dom/fire_event";
@customElement("dialog-box") @customElement("dialog-box")
class DialogBox extends LitElement { 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<void> { public async showDialog(params: DialogParams): Promise<void> {
this._params = params; this._params = params;

View File

@ -15,7 +15,7 @@ import { HomeAssistant } from "../../../types";
@customElement("more-info-automation") @customElement("more-info-automation")
class MoreInfoAutomation extends LitElement { class MoreInfoAutomation extends LitElement {
@property() public hass!: HomeAssistant; @property({ attribute: false }) public hass!: HomeAssistant;
@property() public stateObj?: HassEntity; @property() public stateObj?: HassEntity;

View File

@ -6,6 +6,7 @@ import {
html, html,
LitElement, LitElement,
property, property,
internalProperty,
PropertyValues, PropertyValues,
TemplateResult, TemplateResult,
} from "lit-element"; } from "lit-element";
@ -20,13 +21,13 @@ import {
import type { CameraEntity, HomeAssistant } from "../../../types"; import type { CameraEntity, HomeAssistant } from "../../../types";
class MoreInfoCamera extends LitElement { class MoreInfoCamera extends LitElement {
@property() public hass?: HomeAssistant; @property({ attribute: false }) public hass?: HomeAssistant;
@property() public stateObj?: CameraEntity; @property() public stateObj?: CameraEntity;
@property() private _cameraPrefs?: CameraPreferences; @internalProperty() private _cameraPrefs?: CameraPreferences;
@property() private _attached = false; @internalProperty() private _attached = false;
public connectedCallback() { public connectedCallback() {
super.connectedCallback(); super.connectedCallback();

View File

@ -32,7 +32,7 @@ import {
import { HomeAssistant } from "../../../types"; import { HomeAssistant } from "../../../types";
class MoreInfoClimate extends LitElement { class MoreInfoClimate extends LitElement {
@property() public hass!: HomeAssistant; @property({ attribute: false }) public hass!: HomeAssistant;
@property() public stateObj?: ClimateEntity; @property() public stateObj?: ClimateEntity;

View File

@ -13,7 +13,7 @@ import { HomeAssistant } from "../../../types";
@customElement("more-info-counter") @customElement("more-info-counter")
class MoreInfoCounter extends LitElement { class MoreInfoCounter extends LitElement {
@property() public hass!: HomeAssistant; @property({ attribute: false }) public hass!: HomeAssistant;
@property() public stateObj?: HassEntity; @property() public stateObj?: HassEntity;

View File

@ -11,7 +11,7 @@ import { HomeAssistant } from "../../../types";
@customElement("more-info-default") @customElement("more-info-default")
class MoreInfoDefault extends LitElement { class MoreInfoDefault extends LitElement {
@property() public hass!: HomeAssistant; @property({ attribute: false }) public hass!: HomeAssistant;
@property() public stateObj?: HassEntity; @property() public stateObj?: HassEntity;

View File

@ -24,7 +24,7 @@ import {
import { HomeAssistant } from "../../../types"; import { HomeAssistant } from "../../../types";
class MoreInfoHumidifier extends LitElement { class MoreInfoHumidifier extends LitElement {
@property() public hass!: HomeAssistant; @property({ attribute: false }) public hass!: HomeAssistant;
@property() public stateObj?: HumidifierEntity; @property() public stateObj?: HumidifierEntity;

View File

@ -18,7 +18,7 @@ import { HomeAssistant } from "../../../types";
@customElement("more-info-person") @customElement("more-info-person")
class MoreInfoPerson extends LitElement { class MoreInfoPerson extends LitElement {
@property() public hass!: HomeAssistant; @property({ attribute: false }) public hass!: HomeAssistant;
@property() public stateObj?: HassEntity; @property() public stateObj?: HassEntity;

View File

@ -11,7 +11,7 @@ import { HomeAssistant } from "../../../types";
@customElement("more-info-script") @customElement("more-info-script")
class MoreInfoScript extends LitElement { class MoreInfoScript extends LitElement {
@property() public hass!: HomeAssistant; @property({ attribute: false }) public hass!: HomeAssistant;
@property() public stateObj?: HassEntity; @property() public stateObj?: HassEntity;

View File

@ -14,7 +14,7 @@ import { HomeAssistant } from "../../../types";
@customElement("more-info-sun") @customElement("more-info-sun")
class MoreInfoSun extends LitElement { class MoreInfoSun extends LitElement {
@property() public hass!: HomeAssistant; @property({ attribute: false }) public hass!: HomeAssistant;
@property() public stateObj?: HassEntity; @property() public stateObj?: HassEntity;

View File

@ -14,7 +14,7 @@ import { HomeAssistant } from "../../../types";
@customElement("more-info-timer") @customElement("more-info-timer")
class MoreInfoTimer extends LitElement { class MoreInfoTimer extends LitElement {
@property() public hass!: HomeAssistant; @property({ attribute: false }) public hass!: HomeAssistant;
@property() public stateObj?: TimerEntity; @property() public stateObj?: TimerEntity;

View File

@ -90,7 +90,7 @@ const VACUUM_COMMANDS: VacuumCommand[] = [
@customElement("more-info-vacuum") @customElement("more-info-vacuum")
class MoreInfoVacuum extends LitElement { class MoreInfoVacuum extends LitElement {
@property() public hass!: HomeAssistant; @property({ attribute: false }) public hass!: HomeAssistant;
@property() public stateObj?: VacuumEntity; @property() public stateObj?: VacuumEntity;

View File

@ -51,7 +51,7 @@ const weatherIcons = {
@customElement("more-info-weather") @customElement("more-info-weather")
class MoreInfoWeather extends LitElement { class MoreInfoWeather extends LitElement {
@property() public hass!: HomeAssistant; @property({ attribute: false }) public hass!: HomeAssistant;
@property() public stateObj?: HassEntity; @property() public stateObj?: HassEntity;

View File

@ -18,9 +18,9 @@ import {
customElement, customElement,
LitElement, LitElement,
property, property,
internalProperty,
css, css,
html, html,
internalProperty,
} from "lit-element"; } from "lit-element";
import { haStyleDialog } from "../../resources/styles"; import { haStyleDialog } from "../../resources/styles";
import { HomeAssistant } from "../../types"; import { HomeAssistant } from "../../types";
@ -39,7 +39,7 @@ export interface MoreInfoDialogParams {
@customElement("ha-more-info-dialog") @customElement("ha-more-info-dialog")
export class MoreInfoDialog extends LitElement { export class MoreInfoDialog extends LitElement {
@property() public hass!: HomeAssistant; @property({ attribute: false }) public hass!: HomeAssistant;
@property({ type: Boolean, reflect: true }) public large = false; @property({ type: Boolean, reflect: true }) public large = false;

View File

@ -27,7 +27,7 @@ import "./controls/more-info-water_heater";
import "./controls/more-info-weather"; import "./controls/more-info-weather";
class MoreInfoContent extends UpdatingElement { class MoreInfoContent extends UpdatingElement {
@property() public hass?: HomeAssistant; @property({ attribute: false }) public hass?: HomeAssistant;
@property() public stateObj?: HassEntity; @property() public stateObj?: HassEntity;

View File

@ -15,7 +15,7 @@ import "./notification-item-template";
@customElement("configurator-notification-item") @customElement("configurator-notification-item")
export class HuiConfiguratorNotificationItem extends LitElement { export class HuiConfiguratorNotificationItem extends LitElement {
@property() public hass?: HomeAssistant; @property({ attribute: false }) public hass?: HomeAssistant;
@property() public notification?: PersitentNotificationEntity; @property() public notification?: PersitentNotificationEntity;

View File

@ -14,7 +14,7 @@ import "./persistent-notification-item";
@customElement("notification-item") @customElement("notification-item")
export class HuiNotificationItem extends LitElement { export class HuiNotificationItem extends LitElement {
@property() public hass?: HomeAssistant; @property({ attribute: false }) public hass?: HomeAssistant;
@property() public notification?: HassEntity | PersistentNotification; @property() public notification?: HassEntity | PersistentNotification;

View File

@ -17,7 +17,7 @@ import "./notification-item-template";
@customElement("persistent-notification-item") @customElement("persistent-notification-item")
export class HuiPersistentNotificationItem extends LitElement { export class HuiPersistentNotificationItem extends LitElement {
@property() public hass?: HomeAssistant; @property({ attribute: false }) public hass?: HomeAssistant;
@property() public notification?: PersistentNotification; @property() public notification?: PersistentNotification;

View File

@ -10,6 +10,7 @@ import {
html, html,
LitElement, LitElement,
property, property,
internalProperty,
PropertyValues, PropertyValues,
query, query,
TemplateResult, TemplateResult,
@ -41,20 +42,20 @@ interface Results {
@customElement("ha-voice-command-dialog") @customElement("ha-voice-command-dialog")
export class HaVoiceCommandDialog extends LitElement { export class HaVoiceCommandDialog extends LitElement {
@property() public hass!: HomeAssistant; @property({ attribute: false }) public hass!: HomeAssistant;
@property() public results: Results | null = null; @property() public results: Results | null = null;
@property() private _conversation: Message[] = [ @internalProperty() private _conversation: Message[] = [
{ {
who: "hass", who: "hass",
text: "", text: "",
}, },
]; ];
@property() private _opened = false; @internalProperty() private _opened = false;
@property() private _agentInfo?: AgentInfo; @internalProperty() private _agentInfo?: AgentInfo;
@query("#messages") private messages!: PaperDialogScrollableElement; @query("#messages") private messages!: PaperDialogScrollableElement;

View File

@ -21,7 +21,7 @@ class HassLoadingScreen extends LitElement {
@property({ type: Boolean }) public rootnav = false; @property({ type: Boolean }) public rootnav = false;
@property() public hass?: HomeAssistant; @property({ attribute: false }) public hass?: HomeAssistant;
@property() public narrow?: boolean; @property() public narrow?: boolean;

View File

@ -24,7 +24,7 @@ import { computeRTLDirection } from "../common/util/compute_rtl";
@customElement("hass-tabs-subpage-data-table") @customElement("hass-tabs-subpage-data-table")
export class HaTabsSubpageDataTable extends LitElement { export class HaTabsSubpageDataTable extends LitElement {
@property() public hass!: HomeAssistant; @property({ attribute: false }) public hass!: HomeAssistant;
@property() public isWide!: boolean; @property() public isWide!: boolean;

View File

@ -6,6 +6,7 @@ import {
html, html,
LitElement, LitElement,
property, property,
internalProperty,
PropertyValues, PropertyValues,
TemplateResult, TemplateResult,
eventOptions, eventOptions,
@ -36,7 +37,7 @@ export interface PageNavigation {
@customElement("hass-tabs-subpage") @customElement("hass-tabs-subpage")
class HassTabsSubpage extends LitElement { class HassTabsSubpage extends LitElement {
@property() public hass!: HomeAssistant; @property({ attribute: false }) public hass!: HomeAssistant;
@property({ type: Boolean }) public hassio = false; @property({ type: Boolean }) public hassio = false;
@ -52,7 +53,7 @@ class HassTabsSubpage extends LitElement {
@property({ type: Boolean, reflect: true }) public narrow = false; @property({ type: Boolean, reflect: true }) public narrow = false;
@property() private _activeTab?: PageNavigation; @internalProperty() private _activeTab?: PageNavigation;
// @ts-ignore // @ts-ignore
@restoreScroll(".content") private _savedScrollPos?: number; @restoreScroll(".content") private _savedScrollPos?: number;

View File

@ -31,7 +31,7 @@ declare global {
@customElement("home-assistant-main") @customElement("home-assistant-main")
class HomeAssistantMain extends LitElement { class HomeAssistantMain extends LitElement {
@property() public hass!: HomeAssistant; @property({ attribute: false }) public hass!: HomeAssistant;
@property() public route?: Route; @property() public route?: Route;

View File

@ -1,5 +1,10 @@
import "@polymer/app-route/app-location"; 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 { navigate } from "../common/navigate";
import { getStorageDefaultPanelUrlPath } from "../data/panel"; import { getStorageDefaultPanelUrlPath } from "../data/panel";
import "../resources/custom-card-support"; import "../resources/custom-card-support";
@ -15,11 +20,11 @@ import { storeState } from "../util/ha-pref-storage";
@customElement("home-assistant") @customElement("home-assistant")
export class HomeAssistantAppEl extends HassElement { 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; private _haVersion?: string;

View File

@ -87,7 +87,7 @@ const getRoutes = (panels: Panels): RouterOptions => {
@customElement("partial-panel-resolver") @customElement("partial-panel-resolver")
class PartialPanelResolver extends HassRouterPage { class PartialPanelResolver extends HassRouterPage {
@property() public hass!: HomeAssistant; @property({ attribute: false }) public hass!: HomeAssistant;
@property() public narrow?: boolean; @property() public narrow?: boolean;

View File

@ -5,6 +5,7 @@ import {
html, html,
LitElement, LitElement,
property, property,
internalProperty,
query, query,
TemplateResult, TemplateResult,
} from "lit-element"; } from "lit-element";
@ -26,11 +27,11 @@ export interface ToastActionParams {
} }
class NotificationManager extends LitElement { 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; @query("ha-toast") private _toast!: HaToast;

View File

@ -10,7 +10,7 @@ export const SubscribeMixin = <T extends Constructor<UpdatingElement>>(
superClass: T superClass: T
) => { ) => {
class SubscribeClass extends superClass { class SubscribeClass extends superClass {
@property() public hass?: HomeAssistant; @property({ attribute: false }) public hass?: HomeAssistant;
private __unsubs?: Array<UnsubscribeFunc | Promise<UnsubscribeFunc>>; private __unsubs?: Array<UnsubscribeFunc | Promise<UnsubscribeFunc>>;

View File

@ -9,6 +9,7 @@ import {
customElement, customElement,
html, html,
property, property,
internalProperty,
PropertyValues, PropertyValues,
TemplateResult, TemplateResult,
} from "lit-element"; } from "lit-element";
@ -55,13 +56,13 @@ declare global {
@customElement("ha-onboarding") @customElement("ha-onboarding")
class HaOnboarding extends litLocalizeLiteMixin(HassElement) { class HaOnboarding extends litLocalizeLiteMixin(HassElement) {
@property() public hass?: HomeAssistant; @property({ attribute: false }) public hass?: HomeAssistant;
public translationFragment = "page-onboarding"; public translationFragment = "page-onboarding";
@property() private _loading = false; @internalProperty() private _loading = false;
@property() private _steps?: OnboardingStep[]; @internalProperty() private _steps?: OnboardingStep[];
protected render(): TemplateResult { protected render(): TemplateResult {
const step = this._curStep()!; const step = this._curStep()!;

View File

@ -10,6 +10,7 @@ import {
html, html,
LitElement, LitElement,
property, property,
internalProperty,
TemplateResult, TemplateResult,
} from "lit-element"; } from "lit-element";
import { fireEvent } from "../common/dom/fire_event"; import { fireEvent } from "../common/dom/fire_event";
@ -29,21 +30,21 @@ const amsterdam = [52.3731339, 4.8903147];
@customElement("onboarding-core-config") @customElement("onboarding-core-config")
class OnboardingCoreConfig extends LitElement { class OnboardingCoreConfig extends LitElement {
@property() public hass!: HomeAssistant; @property({ attribute: false }) public hass!: HomeAssistant;
@property() public onboardingLocalize!: LocalizeFunc; @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 { protected render(): TemplateResult {
return html` return html`

View File

@ -8,6 +8,7 @@ import {
html, html,
LitElement, LitElement,
property, property,
internalProperty,
PropertyValues, PropertyValues,
TemplateResult, TemplateResult,
} from "lit-element"; } from "lit-element";
@ -22,17 +23,17 @@ class OnboardingCreateUser extends LitElement {
@property() public language!: string; @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 { protected render(): TemplateResult {
return html` return html`

View File

@ -6,6 +6,7 @@ import {
html, html,
LitElement, LitElement,
property, property,
internalProperty,
PropertyValues, PropertyValues,
TemplateResult, TemplateResult,
} from "lit-element"; } from "lit-element";
@ -30,13 +31,13 @@ import "./integration-badge";
@customElement("onboarding-integrations") @customElement("onboarding-integrations")
class OnboardingIntegrations extends LitElement { class OnboardingIntegrations extends LitElement {
@property() public hass!: HomeAssistant; @property({ attribute: false }) public hass!: HomeAssistant;
@property() public onboardingLocalize!: LocalizeFunc; @property() public onboardingLocalize!: LocalizeFunc;
@property() private _entries?: ConfigEntry[]; @internalProperty() private _entries?: ConfigEntry[];
@property() private _discovered?: DataEntryFlowProgress[]; @internalProperty() private _discovered?: DataEntryFlowProgress[];
private _unsubEvents?: () => void; private _unsubEvents?: () => void;

View File

@ -1,5 +1,6 @@
import { import {
property, property,
internalProperty,
PropertyValues, PropertyValues,
LitElement, LitElement,
CSSResult, CSSResult,
@ -56,9 +57,9 @@ class HAFullCalendar extends LitElement {
@property({ type: Boolean, reflect: true }) @property({ type: Boolean, reflect: true })
public narrow!: boolean; public narrow!: boolean;
@property() private calendar?: Calendar; @internalProperty() private calendar?: Calendar;
@property() private _activeView = "dayGridMonth"; @internalProperty() private _activeView = "dayGridMonth";
protected render(): TemplateResult { protected render(): TemplateResult {
return html` return html`

View File

@ -2,6 +2,7 @@ import {
customElement, customElement,
LitElement, LitElement,
property, property,
internalProperty,
CSSResultArray, CSSResultArray,
css, css,
TemplateResult, TemplateResult,
@ -33,14 +34,14 @@ import { getCalendars, fetchCalendarEvents } from "../../data/calendar";
@customElement("ha-panel-calendar") @customElement("ha-panel-calendar")
class PanelCalendar extends LitElement { class PanelCalendar extends LitElement {
@property() public hass!: HomeAssistant; @property({ attribute: false }) public hass!: HomeAssistant;
@property({ type: Boolean, reflect: true }) @property({ type: Boolean, reflect: true })
public narrow!: boolean; public narrow!: boolean;
@property() private _calendars: SelectedCalendar[] = []; @internalProperty() private _calendars: SelectedCalendar[] = [];
@property() private _events: CalendarEvent[] = []; @internalProperty() private _events: CalendarEvent[] = [];
private _start?: Date; private _start?: Date;

View File

@ -7,6 +7,7 @@ import {
html, html,
LitElement, LitElement,
property, property,
internalProperty,
TemplateResult, TemplateResult,
} from "lit-element"; } from "lit-element";
import "../../../components/dialog/ha-paper-dialog"; import "../../../components/dialog/ha-paper-dialog";
@ -17,15 +18,15 @@ import { HomeAssistant } from "../../../types";
import { AreaRegistryDetailDialogParams } from "./show-dialog-area-registry-detail"; import { AreaRegistryDetailDialogParams } from "./show-dialog-area-registry-detail";
class DialogAreaDetail extends LitElement { 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( public async showDialog(
params: AreaRegistryDetailDialogParams params: AreaRegistryDetailDialogParams

View File

@ -6,6 +6,7 @@ import {
html, html,
LitElement, LitElement,
property, property,
internalProperty,
TemplateResult, TemplateResult,
} from "lit-element"; } from "lit-element";
import { ifDefined } from "lit-html/directives/if-defined"; import { ifDefined } from "lit-html/directives/if-defined";
@ -35,7 +36,7 @@ import {
@customElement("ha-config-area-page") @customElement("ha-config-area-page")
class HaConfigAreaPage extends LitElement { class HaConfigAreaPage extends LitElement {
@property() public hass!: HomeAssistant; @property({ attribute: false }) public hass!: HomeAssistant;
@property() public areaId!: string; @property() public areaId!: string;
@ -51,7 +52,7 @@ class HaConfigAreaPage extends LitElement {
@property() public route!: Route; @property() public route!: Route;
@property() private _related?: RelatedResult; @internalProperty() private _related?: RelatedResult;
private _area = memoizeOne((areaId: string, areas: AreaRegistryEntry[]): private _area = memoizeOne((areaId: string, areas: AreaRegistryEntry[]):
| AreaRegistryEntry | AreaRegistryEntry

View File

@ -42,7 +42,7 @@ import { computeRTL } from "../../../common/util/compute_rtl";
@customElement("ha-config-areas-dashboard") @customElement("ha-config-areas-dashboard")
export class HaConfigAreasDashboard extends LitElement { export class HaConfigAreasDashboard extends LitElement {
@property() public hass!: HomeAssistant; @property({ attribute: false }) public hass!: HomeAssistant;
@property() public isWide?: boolean; @property() public isWide?: boolean;

Some files were not shown because too many files have changed in this diff Show More