mirror of
https://github.com/home-assistant/frontend.git
synced 2025-09-15 16:09:43 +00:00
Compare commits
74 Commits
20200714.0
...
fix-long-t
Author | SHA1 | Date | |
---|---|---|---|
![]() |
685d28229e | ||
![]() |
8634ee536d | ||
![]() |
632d3cda24 | ||
![]() |
29b6a907d4 | ||
![]() |
7474d09e5d | ||
![]() |
fc7bcd7e00 | ||
![]() |
f6fb2e4b1d | ||
![]() |
8c8673a272 | ||
![]() |
4404a1173b | ||
![]() |
e08c10315e | ||
![]() |
16473c9177 | ||
![]() |
235fd5603f | ||
![]() |
d07d5832f5 | ||
![]() |
ef8be5d559 | ||
![]() |
ccafdc6e1f | ||
![]() |
11827aa4c0 | ||
![]() |
6b0589d343 | ||
![]() |
cec1eed99e | ||
![]() |
d7e1e9e284 | ||
![]() |
cae46453a7 | ||
![]() |
a6e948c808 | ||
![]() |
7638020bfc | ||
![]() |
10a62ca17c | ||
![]() |
0afc7c184f | ||
![]() |
168e26aeb4 | ||
![]() |
e6b9389b33 | ||
![]() |
377c37425e | ||
![]() |
4af26602bb | ||
![]() |
c6624e5cb6 | ||
![]() |
f7ae5b91bf | ||
![]() |
07e68496c0 | ||
![]() |
d5a947e2cc | ||
![]() |
3f920767f1 | ||
![]() |
3e14d27a1e | ||
![]() |
cfa4c14108 | ||
![]() |
209056dbe1 | ||
![]() |
10356a7496 | ||
![]() |
d4ae74de44 | ||
![]() |
88d5e7dd5e | ||
![]() |
06c7b0b82e | ||
![]() |
689febda60 | ||
![]() |
80bc6fda8b | ||
![]() |
346eb78c4e | ||
![]() |
2df02f1b09 | ||
![]() |
92915eddc2 | ||
![]() |
cddbf460f8 | ||
![]() |
3c63c23e5a | ||
![]() |
ba67b1291f | ||
![]() |
7bced28327 | ||
![]() |
db2b60700c | ||
![]() |
9034822c44 | ||
![]() |
a14179b81a | ||
![]() |
427c5db7f4 | ||
![]() |
fcb5865468 | ||
![]() |
41370be2b8 | ||
![]() |
d7d8dd8986 | ||
![]() |
a0f596e419 | ||
![]() |
0a8894feb7 | ||
![]() |
1db9eea0f8 | ||
![]() |
489783c398 | ||
![]() |
be62f327ee | ||
![]() |
32359adb6d | ||
![]() |
d154fcbd71 | ||
![]() |
21e277b8a2 | ||
![]() |
f98cdd0749 | ||
![]() |
e60e306426 | ||
![]() |
135232d880 | ||
![]() |
9c42ca0315 | ||
![]() |
9ad9c569a6 | ||
![]() |
a9071d7920 | ||
![]() |
1b4a10fac1 | ||
![]() |
d340f3b383 | ||
![]() |
f8c5eeab5d | ||
![]() |
9cd2d0df93 |
@@ -8,6 +8,7 @@ import {
|
||||
html,
|
||||
LitElement,
|
||||
property,
|
||||
internalProperty,
|
||||
TemplateResult,
|
||||
} from "lit-element";
|
||||
import { CastManager } from "../../../../src/cast/cast_manager";
|
||||
@@ -41,9 +42,9 @@ class HcCast extends LitElement {
|
||||
|
||||
@property() public castManager!: CastManager;
|
||||
|
||||
@property() private askWrite = false;
|
||||
@internalProperty() private askWrite = false;
|
||||
|
||||
@property() private lovelaceConfig?: LovelaceConfig | null;
|
||||
@internalProperty() private lovelaceConfig?: LovelaceConfig | null;
|
||||
|
||||
protected render(): TemplateResult {
|
||||
if (this.lovelaceConfig === undefined) {
|
||||
|
@@ -17,8 +17,8 @@ import {
|
||||
customElement,
|
||||
html,
|
||||
LitElement,
|
||||
property,
|
||||
TemplateResult,
|
||||
internalProperty,
|
||||
} from "lit-element";
|
||||
import { CastManager, getCastManager } from "../../../../src/cast/cast_manager";
|
||||
import { castSendShowDemo } from "../../../../src/cast/receiver_messages";
|
||||
@@ -60,19 +60,19 @@ const INTRO = html`
|
||||
|
||||
@customElement("hc-connect")
|
||||
export class HcConnect extends LitElement {
|
||||
@property() private loading = false;
|
||||
@internalProperty() private loading = false;
|
||||
|
||||
// If we had stored credentials but we cannot connect,
|
||||
// show a screen asking retry or logout.
|
||||
@property() private cannotConnect = false;
|
||||
@internalProperty() private cannotConnect = false;
|
||||
|
||||
@property() private error?: string | TemplateResult;
|
||||
@internalProperty() private error?: string | TemplateResult;
|
||||
|
||||
@property() private auth?: Auth;
|
||||
@internalProperty() private auth?: Auth;
|
||||
|
||||
@property() private connection?: Connection;
|
||||
@internalProperty() private connection?: Connection;
|
||||
|
||||
@property() private castManager?: CastManager | null;
|
||||
@internalProperty() private castManager?: CastManager | null;
|
||||
|
||||
private openDemo = false;
|
||||
|
||||
|
@@ -1,4 +1,10 @@
|
||||
import { customElement, html, property, TemplateResult } from "lit-element";
|
||||
import {
|
||||
customElement,
|
||||
html,
|
||||
property,
|
||||
internalProperty,
|
||||
TemplateResult,
|
||||
} from "lit-element";
|
||||
import { mockHistory } from "../../../../demo/src/stubs/history";
|
||||
import { LovelaceConfig } from "../../../../src/data/lovelace";
|
||||
import {
|
||||
@@ -13,9 +19,9 @@ import "./hc-lovelace";
|
||||
|
||||
@customElement("hc-demo")
|
||||
class HcDemo extends HassElement {
|
||||
@property() public lovelacePath!: string;
|
||||
@property({ attribute: false }) public lovelacePath!: string;
|
||||
|
||||
@property() private _lovelaceConfig?: LovelaceConfig;
|
||||
@internalProperty() private _lovelaceConfig?: LovelaceConfig;
|
||||
|
||||
protected render(): TemplateResult {
|
||||
if (!this._lovelaceConfig) {
|
||||
|
@@ -11,7 +11,7 @@ import { HomeAssistant } from "../../../../src/types";
|
||||
|
||||
@customElement("hc-launch-screen")
|
||||
class HcLaunchScreen extends LitElement {
|
||||
@property() public hass?: HomeAssistant;
|
||||
@property({ attribute: false }) public hass?: HomeAssistant;
|
||||
|
||||
@property() public error?: string;
|
||||
|
||||
|
@@ -16,9 +16,9 @@ import "./hc-launch-screen";
|
||||
|
||||
@customElement("hc-lovelace")
|
||||
class HcLovelace extends LitElement {
|
||||
@property() public hass!: HomeAssistant;
|
||||
@property({ attribute: false }) public hass!: HomeAssistant;
|
||||
|
||||
@property() public lovelaceConfig!: LovelaceConfig;
|
||||
@property({ attribute: false }) public lovelaceConfig!: LovelaceConfig;
|
||||
|
||||
@property() public viewPath?: string | number;
|
||||
|
||||
|
@@ -3,7 +3,12 @@ import {
|
||||
getAuth,
|
||||
UnsubscribeFunc,
|
||||
} from "home-assistant-js-websocket";
|
||||
import { customElement, html, property, TemplateResult } from "lit-element";
|
||||
import {
|
||||
customElement,
|
||||
html,
|
||||
internalProperty,
|
||||
TemplateResult,
|
||||
} from "lit-element";
|
||||
import { CAST_NS } from "../../../../src/cast/const";
|
||||
import {
|
||||
ConnectMessage,
|
||||
@@ -31,13 +36,13 @@ let resourcesLoaded = false;
|
||||
|
||||
@customElement("hc-main")
|
||||
export class HcMain extends HassElement {
|
||||
@property() private _showDemo = false;
|
||||
@internalProperty() private _showDemo = false;
|
||||
|
||||
@property() private _lovelaceConfig?: LovelaceConfig;
|
||||
@internalProperty() private _lovelaceConfig?: LovelaceConfig;
|
||||
|
||||
@property() private _lovelacePath: string | number | null = null;
|
||||
@internalProperty() private _lovelacePath: string | number | null = null;
|
||||
|
||||
@property() private _error?: string;
|
||||
@internalProperty() private _error?: string;
|
||||
|
||||
private _unsubLovelace?: UnsubscribeFunc;
|
||||
|
||||
|
@@ -4,7 +4,7 @@ import {
|
||||
customElement,
|
||||
html,
|
||||
LitElement,
|
||||
property,
|
||||
internalProperty,
|
||||
TemplateResult,
|
||||
} from "lit-element";
|
||||
import { CastManager } from "../../../src/cast/cast_manager";
|
||||
@@ -20,7 +20,7 @@ import { HomeAssistant } from "../../../src/types";
|
||||
class CastDemoRow extends LitElement implements LovelaceRow {
|
||||
public hass!: HomeAssistant;
|
||||
|
||||
@property() private _castManager?: CastManager | null;
|
||||
@internalProperty() private _castManager?: CastManager | null;
|
||||
|
||||
public setConfig(_config: CastConfig): void {
|
||||
// No config possible.
|
||||
@@ -52,7 +52,6 @@ class CastDemoRow extends LitElement implements LovelaceRow {
|
||||
});
|
||||
mgr.castContext.addEventListener(
|
||||
// eslint-disable-next-line no-undef
|
||||
// @ts-ignore
|
||||
cast.framework.CastContextEventType.SESSION_STATE_CHANGED,
|
||||
(ev) => {
|
||||
// On Android, opening a new session always results in SESSION_RESUMED.
|
||||
|
@@ -5,6 +5,7 @@ import {
|
||||
html,
|
||||
LitElement,
|
||||
property,
|
||||
internalProperty,
|
||||
TemplateResult,
|
||||
} from "lit-element";
|
||||
import { until } from "lit-html/directives/until";
|
||||
@@ -21,11 +22,11 @@ import {
|
||||
} from "../configs/demo-configs";
|
||||
|
||||
export class HADemoCard extends LitElement implements LovelaceCard {
|
||||
@property() public lovelace?: Lovelace;
|
||||
@property({ attribute: false }) public lovelace?: Lovelace;
|
||||
|
||||
@property() public hass!: MockHomeAssistant;
|
||||
@property({ attribute: false }) public hass!: MockHomeAssistant;
|
||||
|
||||
@property() private _switching?: boolean;
|
||||
@internalProperty() private _switching?: boolean;
|
||||
|
||||
private _hidden = localStorage.hide_demo_card;
|
||||
|
||||
|
@@ -21,7 +21,7 @@ import { filterAndSort } from "../components/hassio-filter-addons";
|
||||
import { hassioStyle } from "../resources/hassio-style";
|
||||
|
||||
class HassioAddonRepositoryEl extends LitElement {
|
||||
@property() public hass!: HomeAssistant;
|
||||
@property({ attribute: false }) public hass!: HomeAssistant;
|
||||
|
||||
@property() public repo!: HassioAddonRepository;
|
||||
|
||||
|
@@ -6,6 +6,7 @@ import {
|
||||
CSSResult,
|
||||
LitElement,
|
||||
property,
|
||||
internalProperty,
|
||||
PropertyValues,
|
||||
} from "lit-element";
|
||||
import { html, TemplateResult } from "lit-html";
|
||||
@@ -24,6 +25,7 @@ import { HomeAssistant, Route } from "../../../src/types";
|
||||
import { showRepositoriesDialog } from "../dialogs/repositories/show-dialog-repositories";
|
||||
import { supervisorTabs } from "../hassio-tabs";
|
||||
import "./hassio-addon-repository";
|
||||
import { ActionDetail } from "@material/mwc-list/mwc-list-foundation";
|
||||
|
||||
const sortRepos = (a: HassioAddonRepository, b: HassioAddonRepository) => {
|
||||
if (a.slug === "local") {
|
||||
@@ -52,7 +54,7 @@ class HassioAddonStore extends LitElement {
|
||||
|
||||
@property({ attribute: false }) private _repos?: HassioAddonRepository[];
|
||||
|
||||
@property() private _filter?: string;
|
||||
@internalProperty() private _filter?: string;
|
||||
|
||||
public async refreshData() {
|
||||
this._repos = undefined;
|
||||
@@ -96,14 +98,18 @@ class HassioAddonStore extends LitElement {
|
||||
.tabs=${supervisorTabs}
|
||||
>
|
||||
<span slot="header">Add-on store</span>
|
||||
<ha-button-menu corner="BOTTOM_START" slot="toolbar-icon">
|
||||
<ha-button-menu
|
||||
corner="BOTTOM_START"
|
||||
slot="toolbar-icon"
|
||||
@action=${this._handleAction}
|
||||
>
|
||||
<mwc-icon-button slot="trigger" alt="menu">
|
||||
<ha-svg-icon path=${mdiDotsVertical}></ha-svg-icon>
|
||||
</mwc-icon-button>
|
||||
<mwc-list-item @tap=${this._manageRepositories}>
|
||||
<mwc-list-item>
|
||||
Repositories
|
||||
</mwc-list-item>
|
||||
<mwc-list-item @tap=${this.refreshData}>
|
||||
<mwc-list-item>
|
||||
Reload
|
||||
</mwc-list-item>
|
||||
</ha-button-menu>
|
||||
@@ -142,6 +148,17 @@ class HassioAddonStore extends LitElement {
|
||||
this._loadData();
|
||||
}
|
||||
|
||||
private _handleAction(ev: CustomEvent<ActionDetail>) {
|
||||
switch (ev.detail.index) {
|
||||
case 0:
|
||||
this._manageRepositories();
|
||||
break;
|
||||
case 1:
|
||||
this.refreshData();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private apiCalled(ev) {
|
||||
if (ev.detail.success) {
|
||||
this._loadData();
|
||||
|
@@ -9,6 +9,7 @@ import {
|
||||
html,
|
||||
LitElement,
|
||||
property,
|
||||
internalProperty,
|
||||
PropertyValues,
|
||||
TemplateResult,
|
||||
} from "lit-element";
|
||||
@@ -34,15 +35,15 @@ class HassioAddonAudio extends LitElement {
|
||||
|
||||
@property({ attribute: false }) public addon!: HassioAddonDetails;
|
||||
|
||||
@property() private _error?: string;
|
||||
@internalProperty() private _error?: string;
|
||||
|
||||
@property() private _inputDevices?: HassioHardwareAudioDevice[];
|
||||
@internalProperty() private _inputDevices?: HassioHardwareAudioDevice[];
|
||||
|
||||
@property() private _outputDevices?: HassioHardwareAudioDevice[];
|
||||
@internalProperty() private _outputDevices?: HassioHardwareAudioDevice[];
|
||||
|
||||
@property() private _selectedInput!: null | string;
|
||||
@internalProperty() private _selectedInput!: null | string;
|
||||
|
||||
@property() private _selectedOutput!: null | string;
|
||||
@internalProperty() private _selectedOutput!: null | string;
|
||||
|
||||
protected render(): TemplateResult {
|
||||
return html`
|
||||
|
@@ -7,6 +7,7 @@ import {
|
||||
html,
|
||||
LitElement,
|
||||
property,
|
||||
internalProperty,
|
||||
PropertyValues,
|
||||
query,
|
||||
TemplateResult,
|
||||
@@ -32,7 +33,7 @@ class HassioAddonConfig extends LitElement {
|
||||
|
||||
@property({ attribute: false }) public addon!: HassioAddonDetails;
|
||||
|
||||
@property() private _error?: string;
|
||||
@internalProperty() private _error?: string;
|
||||
|
||||
@property({ type: Boolean }) private _configHasChanged = false;
|
||||
|
||||
|
@@ -6,6 +6,7 @@ import {
|
||||
html,
|
||||
LitElement,
|
||||
property,
|
||||
internalProperty,
|
||||
PropertyValues,
|
||||
TemplateResult,
|
||||
} from "lit-element";
|
||||
@@ -37,9 +38,9 @@ class HassioAddonNetwork extends LitElement {
|
||||
|
||||
@property({ attribute: false }) public addon!: HassioAddonDetails;
|
||||
|
||||
@property() private _error?: string;
|
||||
@internalProperty() private _error?: string;
|
||||
|
||||
@property() private _config?: NetworkItem[];
|
||||
@internalProperty() private _config?: NetworkItem[];
|
||||
|
||||
public connectedCallback(): void {
|
||||
super.connectedCallback();
|
||||
|
@@ -5,6 +5,7 @@ import {
|
||||
html,
|
||||
LitElement,
|
||||
property,
|
||||
internalProperty,
|
||||
TemplateResult,
|
||||
} from "lit-element";
|
||||
import "../../../../src/components/ha-markdown";
|
||||
@@ -24,9 +25,9 @@ class HassioAddonDocumentationDashboard extends LitElement {
|
||||
|
||||
@property({ attribute: false }) public addon?: HassioAddonDetails;
|
||||
|
||||
@property() private _error?: string;
|
||||
@internalProperty() private _error?: string;
|
||||
|
||||
@property() private _content?: string;
|
||||
@internalProperty() private _content?: string;
|
||||
|
||||
public async connectedCallback(): Promise<void> {
|
||||
super.connectedCallback();
|
||||
|
@@ -23,6 +23,7 @@ import {
|
||||
html,
|
||||
LitElement,
|
||||
property,
|
||||
internalProperty,
|
||||
TemplateResult,
|
||||
} from "lit-element";
|
||||
import { classMap } from "lit-html/directives/class-map";
|
||||
@@ -124,7 +125,7 @@ class HassioAddonInfo extends LitElement {
|
||||
|
||||
@property({ attribute: false }) public addon!: HassioAddonDetails;
|
||||
|
||||
@property() private _error?: string;
|
||||
@internalProperty() private _error?: string;
|
||||
|
||||
@property({ type: Boolean }) private _installing = false;
|
||||
|
||||
|
@@ -6,6 +6,7 @@ import {
|
||||
html,
|
||||
LitElement,
|
||||
property,
|
||||
internalProperty,
|
||||
TemplateResult,
|
||||
} from "lit-element";
|
||||
import "../../../../src/components/ha-card";
|
||||
@@ -24,9 +25,9 @@ class HassioAddonLogs extends LitElement {
|
||||
|
||||
@property({ attribute: false }) public addon!: HassioAddonDetails;
|
||||
|
||||
@property() private _error?: string;
|
||||
@internalProperty() private _error?: string;
|
||||
|
||||
@property() private _content?: string;
|
||||
@internalProperty() private _content?: string;
|
||||
|
||||
public async connectedCallback(): Promise<void> {
|
||||
super.connectedCallback();
|
||||
|
@@ -14,7 +14,7 @@ import { HomeAssistant } from "../../../src/types";
|
||||
|
||||
@customElement("hassio-card-content")
|
||||
class HassioCardContent extends LitElement {
|
||||
@property() public hass!: HomeAssistant;
|
||||
@property({ attribute: false }) public hass!: HomeAssistant;
|
||||
|
||||
@property() public title!: string;
|
||||
|
||||
|
@@ -19,7 +19,7 @@ import { hassioStyle } from "../resources/hassio-style";
|
||||
|
||||
@customElement("hassio-addons")
|
||||
class HassioAddons extends LitElement {
|
||||
@property() public hass!: HomeAssistant;
|
||||
@property({ attribute: false }) public hass!: HomeAssistant;
|
||||
|
||||
@property() public addons?: HassioAddonInfo[];
|
||||
|
||||
|
@@ -7,6 +7,7 @@ import {
|
||||
html,
|
||||
LitElement,
|
||||
property,
|
||||
internalProperty,
|
||||
TemplateResult,
|
||||
} from "lit-element";
|
||||
import "../../../src/components/buttons/ha-call-api-button";
|
||||
@@ -23,15 +24,15 @@ import { hassioStyle } from "../resources/hassio-style";
|
||||
|
||||
@customElement("hassio-update")
|
||||
export class HassioUpdate extends LitElement {
|
||||
@property() public hass!: HomeAssistant;
|
||||
@property({ attribute: false }) public hass!: HomeAssistant;
|
||||
|
||||
@property() public hassInfo: HassioHomeAssistantInfo;
|
||||
@property({ attribute: false }) public hassInfo: HassioHomeAssistantInfo;
|
||||
|
||||
@property() public hassOsInfo?: HassioHassOSInfo;
|
||||
@property({ attribute: false }) public hassOsInfo?: HassioHassOSInfo;
|
||||
|
||||
@property() public supervisorInfo: HassioSupervisorInfo;
|
||||
|
||||
@property() private _error?: string;
|
||||
@internalProperty() private _error?: string;
|
||||
|
||||
protected render(): TemplateResult {
|
||||
const updatesAvailable: number = [
|
||||
|
@@ -5,6 +5,7 @@ import {
|
||||
html,
|
||||
LitElement,
|
||||
property,
|
||||
internalProperty,
|
||||
TemplateResult,
|
||||
} from "lit-element";
|
||||
import { createCloseHeading } from "../../../../src/components/ha-dialog";
|
||||
@@ -16,13 +17,13 @@ import { HassioMarkdownDialogParams } from "./show-dialog-hassio-markdown";
|
||||
|
||||
@customElement("dialog-hassio-markdown")
|
||||
class HassioMarkdownDialog extends LitElement {
|
||||
@property() public hass!: HomeAssistant;
|
||||
@property({ attribute: false }) public hass!: HomeAssistant;
|
||||
|
||||
@property() public title!: string;
|
||||
|
||||
@property() public content!: string;
|
||||
|
||||
@property() private _opened = false;
|
||||
@internalProperty() private _opened = false;
|
||||
|
||||
public showDialog(params: HassioMarkdownDialogParams) {
|
||||
this.title = params.title;
|
||||
|
@@ -13,6 +13,7 @@ import {
|
||||
html,
|
||||
LitElement,
|
||||
property,
|
||||
internalProperty,
|
||||
query,
|
||||
TemplateResult,
|
||||
} from "lit-element";
|
||||
@@ -39,11 +40,11 @@ class HassioRepositoriesDialog extends LitElement {
|
||||
|
||||
@query("#repository_input") private _optionInput?: PaperInputElement;
|
||||
|
||||
@property() private _opened = false;
|
||||
@internalProperty() private _opened = false;
|
||||
|
||||
@property() private _prosessing = false;
|
||||
@internalProperty() private _prosessing = false;
|
||||
|
||||
@property() private _error?: string;
|
||||
@internalProperty() private _error?: string;
|
||||
|
||||
public async showDialog(_dialogParams: any): Promise<void> {
|
||||
this._dialogParams = _dialogParams;
|
||||
|
@@ -9,6 +9,7 @@ import {
|
||||
html,
|
||||
LitElement,
|
||||
property,
|
||||
internalProperty,
|
||||
TemplateResult,
|
||||
} from "lit-element";
|
||||
import { createCloseHeading } from "../../../../src/components/ha-dialog";
|
||||
@@ -68,21 +69,21 @@ interface FolderItem {
|
||||
|
||||
@customElement("dialog-hassio-snapshot")
|
||||
class HassioSnapshotDialog extends LitElement {
|
||||
@property() public hass!: HomeAssistant;
|
||||
@property({ attribute: false }) public hass!: HomeAssistant;
|
||||
|
||||
@property() private _error?: string;
|
||||
@internalProperty() private _error?: string;
|
||||
|
||||
@property() private _snapshot?: HassioSnapshotDetail;
|
||||
@internalProperty() private _snapshot?: HassioSnapshotDetail;
|
||||
|
||||
@property() private _folders!: FolderItem[];
|
||||
@internalProperty() private _folders!: FolderItem[];
|
||||
|
||||
@property() private _addons!: AddonItem[];
|
||||
@internalProperty() private _addons!: AddonItem[];
|
||||
|
||||
@property() private _dialogParams?: HassioSnapshotDialogParams;
|
||||
@internalProperty() private _dialogParams?: HassioSnapshotDialogParams;
|
||||
|
||||
@property() private _snapshotPassword!: string;
|
||||
@internalProperty() private _snapshotPassword!: string;
|
||||
|
||||
@property() private _restoreHass: boolean | null | undefined = true;
|
||||
@internalProperty() private _restoreHass: boolean | null | undefined = true;
|
||||
|
||||
public async showDialog(params: HassioSnapshotDialogParams) {
|
||||
this._snapshot = await fetchHassioSnapshotInfo(this.hass, params.slug);
|
||||
|
@@ -1,5 +1,10 @@
|
||||
import { PolymerElement } from "@polymer/polymer";
|
||||
import { customElement, property, PropertyValues } from "lit-element";
|
||||
import {
|
||||
customElement,
|
||||
property,
|
||||
internalProperty,
|
||||
PropertyValues,
|
||||
} from "lit-element";
|
||||
import { applyThemesOnElement } from "../../src/common/dom/apply_themes_on_element";
|
||||
import { fireEvent } from "../../src/common/dom/fire_event";
|
||||
import { navigate } from "../../src/common/navigate";
|
||||
@@ -37,7 +42,7 @@ import "./hassio-panel";
|
||||
|
||||
@customElement("hassio-main")
|
||||
class HassioMain extends ProvideHassLitMixin(HassRouterPage) {
|
||||
@property() public hass!: HomeAssistant;
|
||||
@property({ attribute: false }) public hass!: HomeAssistant;
|
||||
|
||||
@property() public panel!: HassioPanelInfo;
|
||||
|
||||
@@ -73,15 +78,15 @@ class HassioMain extends ProvideHassLitMixin(HassRouterPage) {
|
||||
},
|
||||
};
|
||||
|
||||
@property() private _supervisorInfo: HassioSupervisorInfo;
|
||||
@internalProperty() private _supervisorInfo: HassioSupervisorInfo;
|
||||
|
||||
@property() private _hostInfo: HassioHostInfo;
|
||||
@internalProperty() private _hostInfo: HassioHostInfo;
|
||||
|
||||
@property() private _hassioInfo?: HassioInfo;
|
||||
@internalProperty() private _hassioInfo?: HassioInfo;
|
||||
|
||||
@property() private _hassOsInfo?: HassioHassOSInfo;
|
||||
@internalProperty() private _hassOsInfo?: HassioHassOSInfo;
|
||||
|
||||
@property() private _hassInfo: HassioHomeAssistantInfo;
|
||||
@internalProperty() private _hassInfo: HassioHomeAssistantInfo;
|
||||
|
||||
protected firstUpdated(changedProps: PropertyValues) {
|
||||
super.firstUpdated(changedProps);
|
||||
|
@@ -5,6 +5,7 @@ import {
|
||||
html,
|
||||
LitElement,
|
||||
property,
|
||||
internalProperty,
|
||||
PropertyValues,
|
||||
TemplateResult,
|
||||
} from "lit-element";
|
||||
@@ -19,11 +20,11 @@ import { HomeAssistant, Route } from "../../../src/types";
|
||||
|
||||
@customElement("hassio-ingress-view")
|
||||
class HassioIngressView extends LitElement {
|
||||
@property() public hass!: HomeAssistant;
|
||||
@property({ attribute: false }) public hass!: HomeAssistant;
|
||||
|
||||
@property() public route!: Route;
|
||||
|
||||
@property() private _addon?: HassioAddonDetails;
|
||||
@internalProperty() private _addon?: HassioAddonDetails;
|
||||
|
||||
protected render(): TemplateResult {
|
||||
if (!this._addon) {
|
||||
|
@@ -15,6 +15,7 @@ import {
|
||||
html,
|
||||
LitElement,
|
||||
property,
|
||||
internalProperty,
|
||||
PropertyValues,
|
||||
TemplateResult,
|
||||
} from "lit-element";
|
||||
@@ -56,19 +57,19 @@ class HassioSnapshots extends LitElement {
|
||||
|
||||
@property({ attribute: false }) public supervisorInfo!: HassioSupervisorInfo;
|
||||
|
||||
@property() private _snapshotName = "";
|
||||
@internalProperty() private _snapshotName = "";
|
||||
|
||||
@property() private _snapshotPassword = "";
|
||||
@internalProperty() private _snapshotPassword = "";
|
||||
|
||||
@property() private _snapshotHasPassword = false;
|
||||
@internalProperty() private _snapshotHasPassword = false;
|
||||
|
||||
@property() private _snapshotType: HassioSnapshot["type"] = "full";
|
||||
@internalProperty() private _snapshotType: HassioSnapshot["type"] = "full";
|
||||
|
||||
@property() private _snapshots?: HassioSnapshot[] = [];
|
||||
@internalProperty() private _snapshots?: HassioSnapshot[] = [];
|
||||
|
||||
@property() private _addonList: CheckboxItem[] = [];
|
||||
@internalProperty() private _addonList: CheckboxItem[] = [];
|
||||
|
||||
@property() private _folderList: CheckboxItem[] = [
|
||||
@internalProperty() private _folderList: CheckboxItem[] = [
|
||||
{
|
||||
slug: "homeassistant",
|
||||
name: "Home Assistant configuration",
|
||||
@@ -79,9 +80,9 @@ class HassioSnapshots extends LitElement {
|
||||
{ slug: "addons/local", name: "Local add-ons", checked: true },
|
||||
];
|
||||
|
||||
@property() private _creatingSnapshot = false;
|
||||
@internalProperty() private _creatingSnapshot = false;
|
||||
|
||||
@property() private _error = "";
|
||||
@internalProperty() private _error = "";
|
||||
|
||||
public async refreshData() {
|
||||
await reloadHassioSnapshots(this.hass);
|
||||
|
@@ -6,6 +6,7 @@ import {
|
||||
html,
|
||||
LitElement,
|
||||
property,
|
||||
internalProperty,
|
||||
TemplateResult,
|
||||
} from "lit-element";
|
||||
import "../../../src/components/buttons/ha-call-api-button";
|
||||
@@ -32,15 +33,15 @@ import { hassioStyle } from "../resources/hassio-style";
|
||||
|
||||
@customElement("hassio-host-info")
|
||||
class HassioHostInfo extends LitElement {
|
||||
@property() public hass!: HomeAssistant;
|
||||
@property({ attribute: false }) public hass!: HomeAssistant;
|
||||
|
||||
@property() public hostInfo!: HassioHostInfoType;
|
||||
|
||||
@property({ attribute: false }) public hassioInfo!: HassioInfo;
|
||||
|
||||
@property() public hassOsInfo!: HassioHassOSInfo;
|
||||
@property({ attribute: false }) public hassOsInfo!: HassioHassOSInfo;
|
||||
|
||||
@property() private _errors?: string;
|
||||
@internalProperty() private _errors?: string;
|
||||
|
||||
public render(): TemplateResult | void {
|
||||
return html`
|
||||
|
@@ -6,6 +6,7 @@ import {
|
||||
html,
|
||||
LitElement,
|
||||
property,
|
||||
internalProperty,
|
||||
TemplateResult,
|
||||
} from "lit-element";
|
||||
import { fireEvent } from "../../../src/common/dom/fire_event";
|
||||
@@ -23,11 +24,11 @@ import { hassioStyle } from "../resources/hassio-style";
|
||||
|
||||
@customElement("hassio-supervisor-info")
|
||||
class HassioSupervisorInfo extends LitElement {
|
||||
@property() public hass!: HomeAssistant;
|
||||
@property({ attribute: false }) public hass!: HomeAssistant;
|
||||
|
||||
@property() public supervisorInfo!: HassioSupervisorInfoType;
|
||||
|
||||
@property() private _errors?: string;
|
||||
@internalProperty() private _errors?: string;
|
||||
|
||||
public render(): TemplateResult | void {
|
||||
return html`
|
||||
|
@@ -9,6 +9,7 @@ import {
|
||||
html,
|
||||
LitElement,
|
||||
property,
|
||||
internalProperty,
|
||||
TemplateResult,
|
||||
} from "lit-element";
|
||||
import "../../../src/components/ha-card";
|
||||
@@ -55,11 +56,11 @@ const logProviders: LogProvider[] = [
|
||||
class HassioSupervisorLog extends LitElement {
|
||||
@property({ attribute: false }) public hass!: HomeAssistant;
|
||||
|
||||
@property() private _error?: string;
|
||||
@internalProperty() private _error?: string;
|
||||
|
||||
@property() private _selectedLogProvider = "supervisor";
|
||||
@internalProperty() private _selectedLogProvider = "supervisor";
|
||||
|
||||
@property() private _content?: string;
|
||||
@internalProperty() private _content?: string;
|
||||
|
||||
public async connectedCallback(): Promise<void> {
|
||||
super.connectedCallback();
|
||||
|
10
package.json
10
package.json
@@ -13,7 +13,7 @@
|
||||
"lint:prettier": "prettier '**/src/**/*.{js,ts,json,css,md}' --check",
|
||||
"format:prettier": "prettier '**/src/**/*.{js,ts,json,css,md}' --write",
|
||||
"lint:types": "tsc",
|
||||
"lint:lit": "lit-analyzer '**/src/**/*.ts'",
|
||||
"lint:lit": "lit-analyzer '**/src/**/*.ts' --format markdown --outFile result.md",
|
||||
"lint": "npm run lint:eslint && npm run lint:prettier && npm run lint:types",
|
||||
"format": "npm run format:eslint && npm run format:prettier",
|
||||
"mocha": "node_modules/.bin/ts-mocha -p test-mocha/tsconfig.test.json --opts test-mocha/mocha.opts",
|
||||
@@ -74,6 +74,7 @@
|
||||
"@polymer/paper-tooltip": "^3.0.1",
|
||||
"@polymer/polymer": "3.1.0",
|
||||
"@thomasloven/round-slider": "0.5.0",
|
||||
"@types/chromecast-caf-sender": "^1.0.3",
|
||||
"@vaadin/vaadin-combo-box": "^5.0.10",
|
||||
"@vaadin/vaadin-date-picker": "^4.0.7",
|
||||
"@vue/web-component-wrapper": "^1.2.0",
|
||||
@@ -107,8 +108,7 @@
|
||||
"regenerator-runtime": "^0.13.2",
|
||||
"resize-observer-polyfill": "^1.5.1",
|
||||
"roboto-fontface": "^0.10.0",
|
||||
"superstruct": "^0.6.1",
|
||||
"svg-gauge": "^1.0.6",
|
||||
"superstruct": "^0.10.12",
|
||||
"unfetch": "^4.1.0",
|
||||
"vue": "^2.6.11",
|
||||
"vue2-daterange-picker": "^0.5.1",
|
||||
@@ -171,7 +171,7 @@
|
||||
"html-minifier": "^4.0.0",
|
||||
"husky": "^1.3.1",
|
||||
"lint-staged": "^8.1.5",
|
||||
"lit-analyzer": "^1.1.10",
|
||||
"lit-analyzer": "^1.2.0",
|
||||
"lodash.template": "^4.5.0",
|
||||
"magic-string": "^0.25.7",
|
||||
"map-stream": "^0.0.7",
|
||||
@@ -192,7 +192,7 @@
|
||||
"source-map-url": "^0.4.0",
|
||||
"systemjs": "^6.3.2",
|
||||
"terser-webpack-plugin": "^3.0.6",
|
||||
"ts-lit-plugin": "^1.1.10",
|
||||
"ts-lit-plugin": "^1.2.0",
|
||||
"ts-mocha": "^6.0.0",
|
||||
"typescript": "^3.8.3",
|
||||
"vinyl-buffer": "^1.0.1",
|
||||
|
2
setup.py
2
setup.py
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
|
||||
|
||||
setup(
|
||||
name="home-assistant-frontend",
|
||||
version="20200714.0",
|
||||
version="20200716.0",
|
||||
description="The Home Assistant frontend",
|
||||
url="https://github.com/home-assistant/home-assistant-polymer",
|
||||
author="The Home Assistant Authors",
|
||||
|
@@ -5,6 +5,7 @@ import {
|
||||
html,
|
||||
LitElement,
|
||||
property,
|
||||
internalProperty,
|
||||
PropertyValues,
|
||||
TemplateResult,
|
||||
} from "lit-element";
|
||||
@@ -28,13 +29,13 @@ class HaAuthFlow extends litLocalizeLiteMixin(LitElement) {
|
||||
|
||||
@property() public oauth2State?: string;
|
||||
|
||||
@property() private _state: State = "loading";
|
||||
@internalProperty() private _state: State = "loading";
|
||||
|
||||
@property() private _stepData: any = {};
|
||||
@internalProperty() private _stepData: any = {};
|
||||
|
||||
@property() private _step?: DataEntryFlowStep;
|
||||
@internalProperty() private _step?: DataEntryFlowStep;
|
||||
|
||||
@property() private _errorMessage?: string;
|
||||
@internalProperty() private _errorMessage?: string;
|
||||
|
||||
protected render() {
|
||||
return html`
|
||||
|
@@ -4,6 +4,7 @@ import {
|
||||
html,
|
||||
LitElement,
|
||||
property,
|
||||
internalProperty,
|
||||
PropertyValues,
|
||||
} from "lit-element";
|
||||
import {
|
||||
@@ -25,9 +26,9 @@ class HaAuthorize extends litLocalizeLiteMixin(LitElement) {
|
||||
|
||||
@property() public oauth2State?: string;
|
||||
|
||||
@property() private _authProvider?: AuthProvider;
|
||||
@internalProperty() private _authProvider?: AuthProvider;
|
||||
|
||||
@property() private _authProviders?: AuthProvider[];
|
||||
@internalProperty() private _authProviders?: AuthProvider[];
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
|
@@ -1,4 +1,8 @@
|
||||
/* eslint-disable no-undef, no-console */
|
||||
import {
|
||||
CastStateEventData,
|
||||
SessionStateEventData,
|
||||
} from "chromecast-caf-receiver/cast.framework";
|
||||
import { Auth } from "home-assistant-js-websocket";
|
||||
import { castApiAvailable } from "./cast_framework";
|
||||
import { CAST_APP_ID, CAST_DEV, CAST_NS } from "./const";
|
||||
@@ -40,16 +44,13 @@ export class CastManager {
|
||||
const context = this.castContext;
|
||||
context.setOptions({
|
||||
receiverApplicationId: CAST_APP_ID,
|
||||
// @ts-ignore
|
||||
autoJoinPolicy: chrome.cast.AutoJoinPolicy.ORIGIN_SCOPED,
|
||||
});
|
||||
context.addEventListener(
|
||||
// @ts-ignore
|
||||
cast.framework.CastContextEventType.SESSION_STATE_CHANGED,
|
||||
(ev) => this._sessionStateChanged(ev)
|
||||
);
|
||||
context.addEventListener(
|
||||
// @ts-ignore
|
||||
cast.framework.CastContextEventType.CAST_STATE_CHANGED,
|
||||
(ev) => this._castStateChanged(ev)
|
||||
);
|
||||
@@ -118,7 +119,7 @@ export class CastManager {
|
||||
}
|
||||
}
|
||||
|
||||
private _sessionStateChanged(ev) {
|
||||
private _sessionStateChanged(ev: SessionStateEventData) {
|
||||
if (__DEV__) {
|
||||
console.log("Cast session state changed", ev.sessionState);
|
||||
}
|
||||
@@ -141,7 +142,7 @@ export class CastManager {
|
||||
}
|
||||
}
|
||||
|
||||
private _castStateChanged(ev) {
|
||||
private _castStateChanged(ev: CastStateEventData) {
|
||||
if (__DEV__) {
|
||||
console.log("Cast state changed", ev.castState);
|
||||
}
|
||||
|
@@ -1,4 +1,10 @@
|
||||
export default function durationToSeconds(duration: string): number {
|
||||
let days = 0;
|
||||
if (duration.includes("day")) {
|
||||
const position = duration.indexOf("day");
|
||||
days = Number(duration.substr(0, position));
|
||||
duration = duration.split(",")[1];
|
||||
}
|
||||
const parts = duration.split(":").map(Number);
|
||||
return parts[0] * 3600 + parts[1] * 60 + parts[2];
|
||||
return (days * 24 + parts[0]) * 3600 + parts[1] * 60 + parts[2];
|
||||
}
|
||||
|
@@ -23,7 +23,8 @@ const _load = (
|
||||
if (type) {
|
||||
(element as HTMLScriptElement).type = type;
|
||||
// https://github.com/home-assistant/frontend/pull/6328
|
||||
(element as HTMLScriptElement).crossOrigin = url.substr(0, 1) === "/" ? "use-credentials" : "anonymous";
|
||||
(element as HTMLScriptElement).crossOrigin =
|
||||
url.substr(0, 1) === "/" ? "use-credentials" : "anonymous";
|
||||
}
|
||||
break;
|
||||
case "link":
|
||||
|
14
src/common/mwc/handle-request-selected-event.ts
Normal file
14
src/common/mwc/handle-request-selected-event.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import {
|
||||
RequestSelectedDetail,
|
||||
ListItem,
|
||||
} from "@material/mwc-list/mwc-list-item";
|
||||
|
||||
export const shouldHandleRequestSelectedEvent = (
|
||||
ev: CustomEvent<RequestSelectedDetail>
|
||||
): boolean => {
|
||||
if (!ev.detail.selected && ev.detail.source !== "property") {
|
||||
return false;
|
||||
}
|
||||
(ev.target as ListItem).selected = false;
|
||||
return true;
|
||||
};
|
@@ -19,7 +19,13 @@ export const iconColorCSS = css`
|
||||
ha-icon[data-domain="sun"][data-state="above_horizon"],
|
||||
ha-icon[data-domain="switch"][data-state="on"],
|
||||
ha-icon[data-domain="timer"][data-state="active"],
|
||||
ha-icon[data-domain="vacuum"][data-state="cleaning"] {
|
||||
ha-icon[data-domain="vacuum"][data-state="cleaning"],
|
||||
ha-icon[data-domain="group"][data-state="on"],
|
||||
ha-icon[data-domain="group"][data-state="home"],
|
||||
ha-icon[data-domain="group"][data-state="open"],
|
||||
ha-icon[data-domain="group"][data-state="locked"],
|
||||
ha-icon[data-domain="group"][data-state="problem"]
|
||||
{
|
||||
color: var(--paper-item-icon-active-color, #fdd835);
|
||||
}
|
||||
|
||||
|
@@ -9,5 +9,9 @@ export function computeRTL(hass: HomeAssistant) {
|
||||
}
|
||||
|
||||
export function computeRTLDirection(hass: HomeAssistant) {
|
||||
return computeRTL(hass) ? "rtl" : "ltr";
|
||||
return emitRTLDirection(computeRTL(hass));
|
||||
}
|
||||
|
||||
export function emitRTLDirection(rtl: boolean) {
|
||||
return rtl ? "rtl" : "ltr";
|
||||
}
|
||||
|
@@ -6,11 +6,11 @@ import {
|
||||
html,
|
||||
LitElement,
|
||||
property,
|
||||
internalProperty,
|
||||
PropertyValues,
|
||||
query,
|
||||
TemplateResult,
|
||||
eventOptions,
|
||||
internalProperty,
|
||||
} from "lit-element";
|
||||
import { classMap } from "lit-html/directives/class-map";
|
||||
import { ifDefined } from "lit-html/directives/if-defined";
|
||||
@@ -98,6 +98,8 @@ export class HaDataTable extends LitElement {
|
||||
|
||||
@property({ type: String }) public noDataText?: string;
|
||||
|
||||
@property({ type: String }) public searchLabel?: string;
|
||||
|
||||
@property({ type: String }) public filter = "";
|
||||
|
||||
@internalProperty() private _filterable = false;
|
||||
@@ -202,6 +204,7 @@ export class HaDataTable extends LitElement {
|
||||
<div class="table-header">
|
||||
<search-input
|
||||
@value-changed=${this._handleSearchChange}
|
||||
.label=${this.searchLabel}
|
||||
></search-input>
|
||||
</div>
|
||||
`
|
||||
|
@@ -13,6 +13,7 @@ import {
|
||||
html,
|
||||
LitElement,
|
||||
property,
|
||||
internalProperty,
|
||||
PropertyValues,
|
||||
TemplateResult,
|
||||
} from "lit-element";
|
||||
@@ -87,7 +88,7 @@ const rowRenderer = (
|
||||
|
||||
@customElement("ha-area-devices-picker")
|
||||
export class HaAreaDevicesPicker extends SubscribeMixin(LitElement) {
|
||||
@property() public hass!: HomeAssistant;
|
||||
@property({ attribute: false }) public hass!: HomeAssistant;
|
||||
|
||||
@property() public label?: string;
|
||||
|
||||
@@ -124,13 +125,13 @@ export class HaAreaDevicesPicker extends SubscribeMixin(LitElement) {
|
||||
@property({ type: Boolean })
|
||||
private _opened?: boolean;
|
||||
|
||||
@property() private _areaPicker = true;
|
||||
@internalProperty() private _areaPicker = true;
|
||||
|
||||
@property() private _devices?: DeviceRegistryEntry[];
|
||||
@internalProperty() private _devices?: DeviceRegistryEntry[];
|
||||
|
||||
@property() private _areas?: AreaRegistryEntry[];
|
||||
@internalProperty() private _areas?: AreaRegistryEntry[];
|
||||
|
||||
@property() private _entities?: EntityRegistryEntry[];
|
||||
@internalProperty() private _entities?: EntityRegistryEntry[];
|
||||
|
||||
private _selectedDevices: string[] = [];
|
||||
|
||||
|
@@ -8,6 +8,7 @@ import {
|
||||
html,
|
||||
LitElement,
|
||||
property,
|
||||
internalProperty,
|
||||
TemplateResult,
|
||||
} from "lit-element";
|
||||
import { fireEvent } from "../../common/dom/fire_event";
|
||||
@@ -24,7 +25,7 @@ const UNKNOWN_AUTOMATION_KEY = "UNKNOWN_AUTOMATION";
|
||||
export abstract class HaDeviceAutomationPicker<
|
||||
T extends DeviceAutomation
|
||||
> extends LitElement {
|
||||
@property() public hass!: HomeAssistant;
|
||||
@property({ attribute: false }) public hass!: HomeAssistant;
|
||||
|
||||
@property() public label?: string;
|
||||
|
||||
@@ -36,11 +37,11 @@ export abstract class HaDeviceAutomationPicker<
|
||||
|
||||
protected UNKNOWN_AUTOMATION_TEXT = "Unknown automation";
|
||||
|
||||
@property() private _automations: T[] = [];
|
||||
@internalProperty() private _automations: T[] = [];
|
||||
|
||||
// Trigger an empty render so we start with a clean DOM.
|
||||
// paper-listbox does not like changing things around.
|
||||
@property() private _renderEmpty = false;
|
||||
@internalProperty() private _renderEmpty = false;
|
||||
|
||||
private _localizeDeviceAutomation: (
|
||||
hass: HomeAssistant,
|
||||
@@ -116,11 +117,7 @@ export abstract class HaDeviceAutomationPicker<
|
||||
>
|
||||
${this.NO_AUTOMATION_TEXT}
|
||||
</paper-item>
|
||||
<paper-item
|
||||
key=${UNKNOWN_AUTOMATION_KEY}
|
||||
.automation=${this.value}
|
||||
hidden
|
||||
>
|
||||
<paper-item key=${UNKNOWN_AUTOMATION_KEY} hidden>
|
||||
${this.UNKNOWN_AUTOMATION_TEXT}
|
||||
</paper-item>
|
||||
${this._automations.map(
|
||||
@@ -174,18 +171,17 @@ export abstract class HaDeviceAutomationPicker<
|
||||
}
|
||||
|
||||
private _automationChanged(ev) {
|
||||
this._setValue(ev.detail.item.automation);
|
||||
if (ev.detail.item.automation) {
|
||||
this._setValue(ev.detail.item.automation);
|
||||
}
|
||||
}
|
||||
|
||||
private _setValue(automation: T) {
|
||||
if (this.value && deviceAutomationsEqual(automation, this.value)) {
|
||||
return;
|
||||
}
|
||||
this.value = automation;
|
||||
setTimeout(() => {
|
||||
fireEvent(this, "change");
|
||||
fireEvent(this, "value-changed", { value: automation });
|
||||
}, 0);
|
||||
fireEvent(this, "change");
|
||||
fireEvent(this, "value-changed", { value: automation });
|
||||
}
|
||||
|
||||
static get styles(): CSSResult {
|
||||
|
@@ -66,7 +66,7 @@ const rowRenderer = (root: HTMLElement, _owner, model: { item: Device }) => {
|
||||
|
||||
@customElement("ha-device-picker")
|
||||
export class HaDevicePicker extends SubscribeMixin(LitElement) {
|
||||
@property() public hass!: HomeAssistant;
|
||||
@property({ attribute: false }) public hass!: HomeAssistant;
|
||||
|
||||
@property() public label?: string;
|
||||
|
||||
|
@@ -12,7 +12,7 @@ import "./ha-device-picker";
|
||||
|
||||
@customElement("ha-devices-picker")
|
||||
class HaDevicesPicker extends LitElement {
|
||||
@property() public hass?: HomeAssistant;
|
||||
@property({ attribute: false }) public hass?: HomeAssistant;
|
||||
|
||||
@property() public value?: string[];
|
||||
|
||||
|
@@ -15,7 +15,7 @@ import type { HaEntityPickerEntityFilterFunc } from "./ha-entity-picker";
|
||||
|
||||
@customElement("ha-entities-picker")
|
||||
class HaEntitiesPickerLight extends LitElement {
|
||||
@property() public hass?: HomeAssistant;
|
||||
@property({ attribute: false }) public hass?: HomeAssistant;
|
||||
|
||||
@property() public value?: string[];
|
||||
|
||||
|
@@ -59,7 +59,7 @@ class HaEntityPicker extends LitElement {
|
||||
@property({ type: Boolean, attribute: "allow-custom-entity" })
|
||||
public allowCustomEntity;
|
||||
|
||||
@property() public hass?: HomeAssistant;
|
||||
@property({ attribute: false }) public hass?: HomeAssistant;
|
||||
|
||||
@property() public label?: string;
|
||||
|
||||
|
@@ -6,6 +6,7 @@ import {
|
||||
html,
|
||||
LitElement,
|
||||
property,
|
||||
internalProperty,
|
||||
PropertyValues,
|
||||
TemplateResult,
|
||||
} from "lit-element";
|
||||
@@ -28,7 +29,7 @@ export class HaEntityToggle extends LitElement {
|
||||
|
||||
@property() public stateObj?: HassEntity;
|
||||
|
||||
@property() private _isOn = false;
|
||||
@internalProperty() private _isOn = false;
|
||||
|
||||
protected render(): TemplateResult {
|
||||
if (!this.stateObj) {
|
||||
|
@@ -6,6 +6,7 @@ import {
|
||||
html,
|
||||
LitElement,
|
||||
property,
|
||||
internalProperty,
|
||||
PropertyValues,
|
||||
TemplateResult,
|
||||
} from "lit-element";
|
||||
@@ -22,7 +23,7 @@ import "../ha-label-badge";
|
||||
|
||||
@customElement("ha-state-label-badge")
|
||||
export class HaStateLabelBadge extends LitElement {
|
||||
@property() public hass?: HomeAssistant;
|
||||
@property({ attribute: false }) public hass?: HomeAssistant;
|
||||
|
||||
@property() public state?: HassEntity;
|
||||
|
||||
@@ -32,7 +33,7 @@ export class HaStateLabelBadge extends LitElement {
|
||||
|
||||
@property() public image?: string;
|
||||
|
||||
@property() private _timerTimeRemaining?: number;
|
||||
@internalProperty() private _timerTimeRemaining?: number;
|
||||
|
||||
private _connected?: boolean;
|
||||
|
||||
|
@@ -6,6 +6,7 @@ import {
|
||||
html,
|
||||
LitElement,
|
||||
property,
|
||||
internalProperty,
|
||||
PropertyValues,
|
||||
TemplateResult,
|
||||
} from "lit-element";
|
||||
@@ -31,7 +32,7 @@ export class StateBadge extends LitElement {
|
||||
@property({ type: Boolean, reflect: true, attribute: "icon" })
|
||||
private _showIcon = true;
|
||||
|
||||
@property() private _iconStyle: { [name: string]: string } = {};
|
||||
@internalProperty() private _iconStyle: { [name: string]: string } = {};
|
||||
|
||||
protected render(): TemplateResult {
|
||||
const stateObj = this.stateObj;
|
||||
|
@@ -12,6 +12,7 @@ import {
|
||||
html,
|
||||
LitElement,
|
||||
property,
|
||||
internalProperty,
|
||||
TemplateResult,
|
||||
} from "lit-element";
|
||||
import { fireEvent } from "../common/dom/fire_event";
|
||||
@@ -61,7 +62,7 @@ const rowRenderer = (
|
||||
|
||||
@customElement("ha-area-picker")
|
||||
export class HaAreaPicker extends SubscribeMixin(LitElement) {
|
||||
@property() public hass!: HomeAssistant;
|
||||
@property({ attribute: false }) public hass!: HomeAssistant;
|
||||
|
||||
@property() public label?: string;
|
||||
|
||||
@@ -72,7 +73,7 @@ export class HaAreaPicker extends SubscribeMixin(LitElement) {
|
||||
@property({ type: Boolean, attribute: "no-add" })
|
||||
public noAdd?: boolean;
|
||||
|
||||
@property() private _opened?: boolean;
|
||||
@internalProperty() private _opened?: boolean;
|
||||
|
||||
public hassSubscribe(): UnsubscribeFunc[] {
|
||||
return [
|
||||
|
@@ -17,7 +17,7 @@ let jsYamlPromise: Promise<typeof import("js-yaml")>;
|
||||
class HaAttributes extends LitElement {
|
||||
@property() public stateObj?: HassEntity;
|
||||
|
||||
@property() public extraFilters?: string;
|
||||
@property({ attribute: "extra-filters" }) public extraFilters?: string;
|
||||
|
||||
protected render(): TemplateResult {
|
||||
if (!this.stateObj) {
|
||||
|
@@ -10,7 +10,6 @@ import {
|
||||
} from "lit-element";
|
||||
import "@material/mwc-button";
|
||||
import "@material/mwc-menu";
|
||||
import "@material/mwc-list/mwc-list-item";
|
||||
import type { Menu, Corner } from "@material/mwc-menu";
|
||||
|
||||
import "./ha-icon-button";
|
||||
@@ -19,14 +18,30 @@ import "./ha-icon-button";
|
||||
export class HaButtonMenu extends LitElement {
|
||||
@property() public corner: Corner = "TOP_START";
|
||||
|
||||
@property({ type: Boolean }) public multi = false;
|
||||
|
||||
@property({ type: Boolean }) public activatable = false;
|
||||
|
||||
@query("mwc-menu") private _menu?: Menu;
|
||||
|
||||
public get items() {
|
||||
return this._menu?.items;
|
||||
}
|
||||
|
||||
public get selected() {
|
||||
return this._menu?.selected;
|
||||
}
|
||||
|
||||
protected render(): TemplateResult {
|
||||
return html`
|
||||
<div @click=${this._handleClick}>
|
||||
<slot name="trigger"></slot>
|
||||
</div>
|
||||
<mwc-menu .corner=${this.corner}>
|
||||
<mwc-menu
|
||||
.corner=${this.corner}
|
||||
.multi=${this.multi}
|
||||
.activatable=${this.activatable}
|
||||
>
|
||||
<slot></slot>
|
||||
</mwc-menu>
|
||||
`;
|
||||
|
@@ -5,6 +5,7 @@ import {
|
||||
html,
|
||||
LitElement,
|
||||
property,
|
||||
internalProperty,
|
||||
PropertyValues,
|
||||
TemplateResult,
|
||||
} from "lit-element";
|
||||
@@ -22,17 +23,17 @@ type HLSModule = typeof import("hls.js");
|
||||
|
||||
@customElement("ha-camera-stream")
|
||||
class HaCameraStream extends LitElement {
|
||||
@property() public hass?: HomeAssistant;
|
||||
@property({ attribute: false }) public hass?: HomeAssistant;
|
||||
|
||||
@property() public stateObj?: CameraEntity;
|
||||
|
||||
@property({ type: Boolean }) public showControls = false;
|
||||
|
||||
@property() private _attached = false;
|
||||
@internalProperty() private _attached = false;
|
||||
|
||||
// We keep track if we should force MJPEG with a string
|
||||
// that way it automatically resets if we change entity.
|
||||
@property() private _forceMJPEG: string | undefined = undefined;
|
||||
@internalProperty() private _forceMJPEG: string | undefined = undefined;
|
||||
|
||||
private _hlsPolyfillInstance?: Hls;
|
||||
|
||||
|
@@ -9,7 +9,7 @@ import {
|
||||
} from "lit-element";
|
||||
|
||||
@customElement("ha-card")
|
||||
class HaCard extends LitElement {
|
||||
export class HaCard extends LitElement {
|
||||
@property() public header?: string;
|
||||
|
||||
@property({ type: Boolean, reflect: true }) public outlined = false;
|
||||
|
@@ -2,6 +2,7 @@ import { Editor } from "codemirror";
|
||||
import {
|
||||
customElement,
|
||||
property,
|
||||
internalProperty,
|
||||
PropertyValues,
|
||||
UpdatingElement,
|
||||
} from "lit-element";
|
||||
@@ -28,7 +29,7 @@ export class HaCodeEditor extends UpdatingElement {
|
||||
|
||||
@property() public error = false;
|
||||
|
||||
@property() private _value = "";
|
||||
@internalProperty() private _value = "";
|
||||
|
||||
public set value(value: string) {
|
||||
this._value = value;
|
||||
|
@@ -17,6 +17,8 @@ import "./ha-svg-icon";
|
||||
import "@polymer/paper-input/paper-input";
|
||||
import "@material/mwc-list/mwc-list";
|
||||
import "./date-range-picker";
|
||||
import { computeRTLDirection } from "../common/util/compute_rtl";
|
||||
import { ActionDetail } from "@material/mwc-list/mwc-list-foundation";
|
||||
|
||||
export interface DateRangePickerRanges {
|
||||
[key: string]: [Date, Date];
|
||||
@@ -24,7 +26,7 @@ export interface DateRangePickerRanges {
|
||||
|
||||
@customElement("ha-date-range-picker")
|
||||
export class HaDateRangePicker extends LitElement {
|
||||
@property() public hass!: HomeAssistant;
|
||||
@property({ attribute: false }) public hass!: HomeAssistant;
|
||||
|
||||
@property() public startDate!: Date;
|
||||
|
||||
@@ -36,11 +38,14 @@ export class HaDateRangePicker extends LitElement {
|
||||
|
||||
@property({ type: Boolean }) private _hour24format = false;
|
||||
|
||||
@property({ type: String }) private _rtlDirection = "ltr";
|
||||
|
||||
protected updated(changedProps: PropertyValues) {
|
||||
if (changedProps.has("hass")) {
|
||||
const oldHass = changedProps.get("hass") as HomeAssistant | undefined;
|
||||
if (!oldHass || oldHass.language !== this.hass.language) {
|
||||
this._hour24format = this._compute24hourFormat();
|
||||
this._rtlDirection = computeRTLDirection(this.hass);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -76,16 +81,14 @@ export class HaDateRangePicker extends LitElement {
|
||||
></paper-input>
|
||||
</div>
|
||||
${this.ranges
|
||||
? html`<div slot="ranges" class="date-range-ranges">
|
||||
<mwc-list @click=${this._setDateRange}>
|
||||
${Object.entries(this.ranges).map(
|
||||
([name, dates]) => html`<mwc-list-item
|
||||
.activated=${this.startDate.getTime() ===
|
||||
dates[0].getTime() &&
|
||||
this.endDate.getTime() === dates[1].getTime()}
|
||||
.startDate=${dates[0]}
|
||||
.endDate=${dates[1]}
|
||||
>
|
||||
? html`<div
|
||||
slot="ranges"
|
||||
class="date-range-ranges"
|
||||
.dir=${this._rtlDirection}
|
||||
>
|
||||
<mwc-list @action=${this._setDateRange} activatable>
|
||||
${Object.keys(this.ranges).map(
|
||||
(name) => html`<mwc-list-item>
|
||||
${name}
|
||||
</mwc-list-item>`
|
||||
)}
|
||||
@@ -116,12 +119,10 @@ export class HaDateRangePicker extends LitElement {
|
||||
);
|
||||
}
|
||||
|
||||
private _setDateRange(ev: Event) {
|
||||
const target = ev.target as any;
|
||||
const startDate = target.startDate;
|
||||
const endDate = target.endDate;
|
||||
private _setDateRange(ev: CustomEvent<ActionDetail>) {
|
||||
const dateRange = Object.values(this.ranges!)[ev.detail.index];
|
||||
const dateRangePicker = this._dateRangePicker;
|
||||
dateRangePicker.clickRange([startDate, endDate]);
|
||||
dateRangePicker.clickRange(dateRange);
|
||||
dateRangePicker.clickedApply();
|
||||
}
|
||||
|
||||
|
@@ -5,7 +5,7 @@ import "./ha-icon-button";
|
||||
import { css, CSSResult, customElement, html } from "lit-element";
|
||||
import type { Constructor, HomeAssistant } from "../types";
|
||||
import { mdiClose } from "@mdi/js";
|
||||
import { computeRTL } from "../common/util/compute_rtl";
|
||||
import { computeRTLDirection } from "../common/util/compute_rtl";
|
||||
|
||||
const MwcDialog = customElements.get("mwc-dialog") as Constructor<Dialog>;
|
||||
|
||||
@@ -14,8 +14,8 @@ export const createCloseHeading = (hass: HomeAssistant, title: string) => html`
|
||||
<mwc-icon-button
|
||||
aria-label=${hass.localize("ui.dialogs.generic.close")}
|
||||
dialogAction="close"
|
||||
?rtl=${computeRTL(hass)}
|
||||
class="header_button"
|
||||
dir=${computeRTLDirection(hass)}
|
||||
>
|
||||
<ha-svg-icon path=${mdiClose}></ha-svg-icon>
|
||||
</mwc-icon-button>
|
||||
@@ -51,7 +51,7 @@ export class HaDialog extends MwcDialog {
|
||||
padding: var(--dialog-content-padding, 20px 24px);
|
||||
}
|
||||
.mdc-dialog .mdc-dialog__surface {
|
||||
position: var(--dialog-content-position, relative);
|
||||
position: var(--dialog-surface-position, relative);
|
||||
min-height: var(--mdc-dialog-min-height, auto);
|
||||
}
|
||||
.header_button {
|
||||
@@ -61,7 +61,7 @@ export class HaDialog extends MwcDialog {
|
||||
text-decoration: none;
|
||||
color: inherit;
|
||||
}
|
||||
mwc-icon-button[rtl].header_button {
|
||||
[dir="rtl"].header_button {
|
||||
right: auto;
|
||||
left: 16px;
|
||||
}
|
||||
|
@@ -11,6 +11,7 @@ import {
|
||||
html,
|
||||
LitElement,
|
||||
property,
|
||||
internalProperty,
|
||||
query,
|
||||
TemplateResult,
|
||||
} from "lit-element";
|
||||
@@ -32,7 +33,7 @@ export class HaFormMultiSelect extends LitElement implements HaFormElement {
|
||||
|
||||
@property() public suffix!: string;
|
||||
|
||||
@property() private _init = false;
|
||||
@internalProperty() private _init = false;
|
||||
|
||||
@query("paper-menu-button") private _input?: HTMLElement;
|
||||
|
||||
|
@@ -6,6 +6,7 @@ import {
|
||||
html,
|
||||
LitElement,
|
||||
property,
|
||||
internalProperty,
|
||||
query,
|
||||
TemplateResult,
|
||||
} from "lit-element";
|
||||
@@ -26,7 +27,7 @@ export class HaFormString extends LitElement implements HaFormElement {
|
||||
|
||||
@property() public suffix!: string;
|
||||
|
||||
@property() private _unmaskedPassword = false;
|
||||
@internalProperty() private _unmaskedPassword = false;
|
||||
|
||||
@query("paper-input") private _input?: HTMLElement;
|
||||
|
||||
|
130
src/components/ha-gauge.ts
Normal file
130
src/components/ha-gauge.ts
Normal file
@@ -0,0 +1,130 @@
|
||||
import {
|
||||
LitElement,
|
||||
svg,
|
||||
customElement,
|
||||
css,
|
||||
property,
|
||||
internalProperty,
|
||||
PropertyValues,
|
||||
} from "lit-element";
|
||||
import { styleMap } from "lit-html/directives/style-map";
|
||||
import { afterNextRender } from "../common/util/render-status";
|
||||
|
||||
const getAngle = (value: number, min: number, max: number) => {
|
||||
const percentage = getValueInPercentage(normalize(value, min, max), min, max);
|
||||
return (percentage * 180) / 100;
|
||||
};
|
||||
|
||||
const normalize = (value: number, min: number, max: number) => {
|
||||
if (value > max) return max;
|
||||
if (value < min) return min;
|
||||
return value;
|
||||
};
|
||||
|
||||
const getValueInPercentage = (value: number, min: number, max: number) => {
|
||||
const newMax = max - min;
|
||||
const newVal = value - min;
|
||||
return (100 * newVal) / newMax;
|
||||
};
|
||||
|
||||
@customElement("ha-gauge")
|
||||
export class Gauge extends LitElement {
|
||||
@property({ type: Number }) public min = 0;
|
||||
|
||||
@property({ type: Number }) public max = 100;
|
||||
|
||||
@property({ type: Number }) public value = 0;
|
||||
|
||||
@property() public label = "";
|
||||
|
||||
@internalProperty() private _angle = 0;
|
||||
|
||||
@internalProperty() private _updated = false;
|
||||
|
||||
protected firstUpdated(changedProperties: PropertyValues) {
|
||||
super.firstUpdated(changedProperties);
|
||||
// Wait for the first render for the initial animation to work
|
||||
afterNextRender(() => {
|
||||
this._updated = true;
|
||||
this._angle = getAngle(this.value, this.min, this.max);
|
||||
this._rescale_svg();
|
||||
});
|
||||
}
|
||||
|
||||
protected updated(changedProperties: PropertyValues) {
|
||||
super.updated(changedProperties);
|
||||
if (!this._updated || !changedProperties.has("value")) {
|
||||
return;
|
||||
}
|
||||
this._angle = getAngle(this.value, this.min, this.max);
|
||||
this._rescale_svg();
|
||||
}
|
||||
|
||||
protected render() {
|
||||
return svg`
|
||||
<svg viewBox="0 0 100 50" class="gauge">
|
||||
<path
|
||||
class="dial"
|
||||
d="M 10 50 A 40 40 0 0 1 90 50"
|
||||
></path>
|
||||
<path
|
||||
class="value"
|
||||
style=${styleMap({ transform: `rotate(${this._angle}deg)` })}
|
||||
d="M 90 50.001 A 40 40 0 0 1 10 50"
|
||||
></path>
|
||||
</svg>
|
||||
<svg class="text">
|
||||
<text class="value-text">
|
||||
${this.value} ${this.label}
|
||||
</text>
|
||||
</svg>`;
|
||||
}
|
||||
|
||||
private _rescale_svg() {
|
||||
// Set the viewbox of the SVG containing the value to perfectly
|
||||
// fit the text
|
||||
// That way it will auto-scale correctly
|
||||
const svgRoot = this.shadowRoot!.querySelector(".text")!;
|
||||
const box = svgRoot.querySelector("text")!.getBBox()!;
|
||||
svgRoot.setAttribute(
|
||||
"viewBox",
|
||||
`${box.x} ${box!.y} ${box.width} ${box.height}`
|
||||
);
|
||||
}
|
||||
|
||||
static get styles() {
|
||||
return css`
|
||||
:host {
|
||||
position: relative;
|
||||
}
|
||||
.dial {
|
||||
fill: none;
|
||||
stroke: var(--primary-background-color);
|
||||
stroke-width: 15;
|
||||
}
|
||||
.value {
|
||||
fill: none;
|
||||
stroke-width: 15;
|
||||
stroke: var(--gauge-color);
|
||||
transition: all 1000ms ease 0s;
|
||||
transform-origin: 50% 100%;
|
||||
}
|
||||
.gauge {
|
||||
display: block;
|
||||
}
|
||||
.text {
|
||||
position: absolute;
|
||||
max-height: 40%;
|
||||
max-width: 55%;
|
||||
left: 50%;
|
||||
bottom: -6%;
|
||||
transform: translate(-50%, 0%);
|
||||
}
|
||||
.value-text {
|
||||
font-size: 50px;
|
||||
fill: var(--primary-text-color);
|
||||
text-anchor: middle;
|
||||
}
|
||||
`;
|
||||
}
|
||||
}
|
@@ -1,6 +1,7 @@
|
||||
import {
|
||||
LitElement,
|
||||
property,
|
||||
internalProperty,
|
||||
TemplateResult,
|
||||
html,
|
||||
customElement,
|
||||
@@ -13,7 +14,7 @@ import "./ha-svg-icon";
|
||||
export class HaIconButtonArrowNext extends LitElement {
|
||||
@property({ type: Boolean }) public disabled = false;
|
||||
|
||||
@property() private _icon = mdiArrowRight;
|
||||
@internalProperty() private _icon = mdiArrowRight;
|
||||
|
||||
public connectedCallback() {
|
||||
super.connectedCallback();
|
||||
|
@@ -1,6 +1,7 @@
|
||||
import {
|
||||
LitElement,
|
||||
property,
|
||||
internalProperty,
|
||||
TemplateResult,
|
||||
html,
|
||||
customElement,
|
||||
@@ -13,7 +14,7 @@ import "./ha-svg-icon";
|
||||
export class HaIconButtonArrowPrev extends LitElement {
|
||||
@property({ type: Boolean }) public disabled = false;
|
||||
|
||||
@property() private _icon = mdiArrowLeft;
|
||||
@internalProperty() private _icon = mdiArrowLeft;
|
||||
|
||||
public connectedCallback() {
|
||||
super.connectedCallback();
|
||||
|
@@ -1,6 +1,7 @@
|
||||
import {
|
||||
LitElement,
|
||||
property,
|
||||
internalProperty,
|
||||
TemplateResult,
|
||||
html,
|
||||
customElement,
|
||||
@@ -13,7 +14,7 @@ import "./ha-svg-icon";
|
||||
export class HaIconButtonNext extends LitElement {
|
||||
@property({ type: Boolean }) public disabled = false;
|
||||
|
||||
@property() private _icon = mdiChevronRight;
|
||||
@internalProperty() private _icon = mdiChevronRight;
|
||||
|
||||
public connectedCallback() {
|
||||
super.connectedCallback();
|
||||
|
@@ -1,6 +1,7 @@
|
||||
import {
|
||||
LitElement,
|
||||
property,
|
||||
internalProperty,
|
||||
TemplateResult,
|
||||
html,
|
||||
customElement,
|
||||
@@ -13,7 +14,7 @@ import "./ha-svg-icon";
|
||||
export class HaIconButtonPrev extends LitElement {
|
||||
@property({ type: Boolean }) public disabled = false;
|
||||
|
||||
@property() private _icon = mdiChevronLeft;
|
||||
@internalProperty() private _icon = mdiChevronLeft;
|
||||
|
||||
public connectedCallback() {
|
||||
super.connectedCallback();
|
||||
|
@@ -3,6 +3,7 @@ import {
|
||||
customElement,
|
||||
LitElement,
|
||||
property,
|
||||
internalProperty,
|
||||
PropertyValues,
|
||||
html,
|
||||
TemplateResult,
|
||||
@@ -88,7 +89,7 @@ const mdiRenameMapping = {
|
||||
"library-movie": "filmstrip-box-multiple",
|
||||
"library-music": "music-box-multiple",
|
||||
"library-music-outline": "music-box-multiple-outline",
|
||||
"library-video": "play-box-mutiple",
|
||||
"library-video": "play-box-multiple",
|
||||
markdown: "language-markdown",
|
||||
"markdown-outline": "language-markdown-outline",
|
||||
"message-settings-variant": "message-cog",
|
||||
@@ -150,6 +151,8 @@ const mdiRenameMapping = {
|
||||
"textbox-lock": "form-textbox-lock",
|
||||
"textbox-password": "form-textbox-password",
|
||||
"syllabary-katakana-half-width": "syllabary-katakana-halfwidth",
|
||||
"visual-studio-code": "microsoft-visual-studio-code",
|
||||
"visual-studio": "microsoft-visual-studio",
|
||||
};
|
||||
|
||||
const mdiRemovedIcons = new Set([
|
||||
@@ -233,11 +236,11 @@ const cachedIcons: { [key: string]: string } = {};
|
||||
export class HaIcon extends LitElement {
|
||||
@property() public icon?: string;
|
||||
|
||||
@property() private _path?: string;
|
||||
@internalProperty() private _path?: string;
|
||||
|
||||
@property() private _viewBox?;
|
||||
@internalProperty() private _viewBox?;
|
||||
|
||||
@property() private _legacy = false;
|
||||
@internalProperty() private _legacy = false;
|
||||
|
||||
protected updated(changedProps: PropertyValues) {
|
||||
if (changedProps.has("icon")) {
|
||||
|
@@ -15,7 +15,7 @@ class HaLabeledSlider extends PolymerElement {
|
||||
|
||||
.title {
|
||||
margin-bottom: 16px;
|
||||
opacity: var(--dark-primary-opacity);
|
||||
color: var(--secondary-text-color);
|
||||
}
|
||||
|
||||
.slider-container {
|
||||
@@ -24,7 +24,7 @@ class HaLabeledSlider extends PolymerElement {
|
||||
|
||||
ha-icon {
|
||||
margin-top: 4px;
|
||||
opacity: var(--dark-secondary-opacity);
|
||||
color: var(--secondary-text-color);
|
||||
}
|
||||
|
||||
ha-paper-slider {
|
||||
|
@@ -8,6 +8,7 @@ import {
|
||||
html,
|
||||
LitElement,
|
||||
property,
|
||||
internalProperty,
|
||||
TemplateResult,
|
||||
} from "lit-element";
|
||||
import { fireEvent } from "../common/dom/fire_event";
|
||||
@@ -22,9 +23,9 @@ class HaMenuButton extends LitElement {
|
||||
|
||||
@property() public narrow!: boolean;
|
||||
|
||||
@property() public hass!: HomeAssistant;
|
||||
@property({ attribute: false }) public hass!: HomeAssistant;
|
||||
|
||||
@property() private _hasNotifications = false;
|
||||
@internalProperty() private _hasNotifications = false;
|
||||
|
||||
private _alwaysVisible = false;
|
||||
|
||||
|
@@ -6,6 +6,7 @@ import {
|
||||
html,
|
||||
LitElement,
|
||||
property,
|
||||
internalProperty,
|
||||
PropertyValues,
|
||||
TemplateResult,
|
||||
} from "lit-element";
|
||||
@@ -27,19 +28,19 @@ import "./ha-switch";
|
||||
|
||||
@customElement("ha-related-items")
|
||||
export class HaRelatedItems extends SubscribeMixin(LitElement) {
|
||||
@property() public hass!: HomeAssistant;
|
||||
@property({ attribute: false }) public hass!: HomeAssistant;
|
||||
|
||||
@property() public itemType!: ItemType;
|
||||
|
||||
@property() public itemId!: string;
|
||||
|
||||
@property() private _entries?: ConfigEntry[];
|
||||
@internalProperty() private _entries?: ConfigEntry[];
|
||||
|
||||
@property() private _devices?: DeviceRegistryEntry[];
|
||||
@internalProperty() private _devices?: DeviceRegistryEntry[];
|
||||
|
||||
@property() private _areas?: AreaRegistryEntry[];
|
||||
@internalProperty() private _areas?: AreaRegistryEntry[];
|
||||
|
||||
@property() private _related?: RelatedResult;
|
||||
@internalProperty() private _related?: RelatedResult;
|
||||
|
||||
public hassSubscribe(): UnsubscribeFunc[] {
|
||||
return [
|
||||
|
@@ -18,6 +18,7 @@ import {
|
||||
customElement,
|
||||
LitElement,
|
||||
property,
|
||||
internalProperty,
|
||||
PropertyValues,
|
||||
} from "lit-element";
|
||||
import { classMap } from "lit-html/directives/class-map";
|
||||
@@ -111,7 +112,7 @@ const computePanels = (hass: HomeAssistant): [PanelInfo[], PanelInfo[]] => {
|
||||
|
||||
@customElement("ha-sidebar")
|
||||
class HaSidebar extends LitElement {
|
||||
@property() public hass!: HomeAssistant;
|
||||
@property({ attribute: false }) public hass!: HomeAssistant;
|
||||
|
||||
@property() public narrow!: boolean;
|
||||
|
||||
@@ -119,9 +120,9 @@ class HaSidebar extends LitElement {
|
||||
|
||||
@property({ type: Boolean, reflect: true }) public expanded = false;
|
||||
|
||||
@property() private _externalConfig?: ExternalConfig;
|
||||
@internalProperty() private _externalConfig?: ExternalConfig;
|
||||
|
||||
@property() private _notifications?: PersistentNotification[];
|
||||
@internalProperty() private _notifications?: PersistentNotification[];
|
||||
|
||||
// property used only in css
|
||||
// @ts-ignore
|
||||
|
@@ -4,10 +4,10 @@ import {
|
||||
customElement,
|
||||
LitElement,
|
||||
property,
|
||||
internalProperty,
|
||||
TemplateResult,
|
||||
html,
|
||||
queryAsync,
|
||||
internalProperty,
|
||||
eventOptions,
|
||||
} from "lit-element";
|
||||
import "@material/mwc-ripple/mwc-ripple";
|
||||
|
@@ -4,6 +4,7 @@ import {
|
||||
html,
|
||||
LitElement,
|
||||
property,
|
||||
internalProperty,
|
||||
query,
|
||||
TemplateResult,
|
||||
} from "lit-element";
|
||||
@@ -41,7 +42,7 @@ export class HaYamlEditor extends LitElement {
|
||||
|
||||
@property() public label?: string;
|
||||
|
||||
@property() private _yaml = "";
|
||||
@internalProperty() private _yaml = "";
|
||||
|
||||
@query("ha-code-editor") private _editor?: HaCodeEditor;
|
||||
|
||||
|
@@ -22,7 +22,7 @@ import { HomeAssistant } from "../../types";
|
||||
|
||||
@customElement("ha-map")
|
||||
class HaMap extends LitElement {
|
||||
@property() public hass?: HomeAssistant;
|
||||
@property({ attribute: false }) public hass?: HomeAssistant;
|
||||
|
||||
@property() public entities?: string[];
|
||||
|
||||
|
@@ -46,8 +46,8 @@ export interface MqttTrigger {
|
||||
|
||||
export interface GeoLocationTrigger {
|
||||
platform: "geo_location";
|
||||
source: "string";
|
||||
zone: "string";
|
||||
source: string;
|
||||
zone: string;
|
||||
event: "enter" | "leave";
|
||||
}
|
||||
|
||||
|
@@ -5,7 +5,13 @@ import { HomeAssistant } from "../types";
|
||||
import { DataEntryFlowProgress, DataEntryFlowStep } from "./data_entry_flow";
|
||||
import { domainToName } from "./integration";
|
||||
|
||||
export const DISCOVERY_SOURCES = ["unignore", "homekit", "ssdp", "zeroconf", "discovery"];
|
||||
export const DISCOVERY_SOURCES = [
|
||||
"unignore",
|
||||
"homekit",
|
||||
"ssdp",
|
||||
"zeroconf",
|
||||
"discovery",
|
||||
];
|
||||
|
||||
export const createConfigFlow = (hass: HomeAssistant, handler: string) =>
|
||||
hass.callApi<DataEntryFlowStep>("POST", "config/config_entries/flow", {
|
||||
|
@@ -7,6 +7,7 @@ import {
|
||||
html,
|
||||
LitElement,
|
||||
property,
|
||||
internalProperty,
|
||||
TemplateResult,
|
||||
} from "lit-element";
|
||||
import "../../components/dialog/ha-paper-dialog";
|
||||
@@ -26,17 +27,17 @@ import { computeRTLDirection } from "../../common/util/compute_rtl";
|
||||
|
||||
@customElement("dialog-config-entry-system-options")
|
||||
class DialogConfigEntrySystemOptions extends LitElement {
|
||||
@property() public hass!: HomeAssistant;
|
||||
@property({ attribute: false }) public hass!: HomeAssistant;
|
||||
|
||||
@property() private _disableNewEntities!: boolean;
|
||||
@internalProperty() private _disableNewEntities!: boolean;
|
||||
|
||||
@property() private _error?: string;
|
||||
@internalProperty() private _error?: string;
|
||||
|
||||
@property() private _params?: ConfigEntrySystemOptionsDialogParams;
|
||||
@internalProperty() private _params?: ConfigEntrySystemOptionsDialogParams;
|
||||
|
||||
@property() private _loading?: boolean;
|
||||
@internalProperty() private _loading?: boolean;
|
||||
|
||||
@property() private _submitting?: boolean;
|
||||
@internalProperty() private _submitting?: boolean;
|
||||
|
||||
public async showDialog(
|
||||
params: ConfigEntrySystemOptionsDialogParams
|
||||
|
@@ -10,7 +10,7 @@ import {
|
||||
customElement,
|
||||
html,
|
||||
LitElement,
|
||||
property,
|
||||
internalProperty,
|
||||
PropertyValues,
|
||||
TemplateResult,
|
||||
} from "lit-element";
|
||||
@@ -54,23 +54,23 @@ declare global {
|
||||
class DataEntryFlowDialog extends LitElement {
|
||||
public hass!: HomeAssistant;
|
||||
|
||||
@property() private _params?: DataEntryFlowDialogParams;
|
||||
@internalProperty() private _params?: DataEntryFlowDialogParams;
|
||||
|
||||
@property() private _loading = true;
|
||||
@internalProperty() private _loading = true;
|
||||
|
||||
private _instance = instance;
|
||||
|
||||
@property() private _step:
|
||||
@internalProperty() private _step:
|
||||
| DataEntryFlowStep
|
||||
| undefined
|
||||
// Null means we need to pick a config flow
|
||||
| null;
|
||||
|
||||
@property() private _devices?: DeviceRegistryEntry[];
|
||||
@internalProperty() private _devices?: DeviceRegistryEntry[];
|
||||
|
||||
@property() private _areas?: AreaRegistryEntry[];
|
||||
@internalProperty() private _areas?: AreaRegistryEntry[];
|
||||
|
||||
@property() private _handlers?: string[];
|
||||
@internalProperty() private _handlers?: string[];
|
||||
|
||||
private _unsubAreas?: UnsubscribeFunc;
|
||||
|
||||
|
@@ -8,6 +8,7 @@ import {
|
||||
html,
|
||||
LitElement,
|
||||
property,
|
||||
internalProperty,
|
||||
TemplateResult,
|
||||
} from "lit-element";
|
||||
import { classMap } from "lit-html/directives/class-map";
|
||||
@@ -31,13 +32,13 @@ interface HandlerObj {
|
||||
class StepFlowPickHandler extends LitElement {
|
||||
public flowConfig!: FlowConfig;
|
||||
|
||||
@property() public hass!: HomeAssistant;
|
||||
@property({ attribute: false }) public hass!: HomeAssistant;
|
||||
|
||||
@property() public handlers!: string[];
|
||||
|
||||
@property() public showAdvanced?: boolean;
|
||||
|
||||
@property() private filter?: string;
|
||||
@internalProperty() private filter?: string;
|
||||
|
||||
private _width?: number;
|
||||
|
||||
|
@@ -11,6 +11,7 @@ import {
|
||||
html,
|
||||
LitElement,
|
||||
property,
|
||||
internalProperty,
|
||||
TemplateResult,
|
||||
} from "lit-element";
|
||||
import "../../components/dialog/ha-paper-dialog";
|
||||
@@ -23,15 +24,15 @@ import { DeviceRegistryDetailDialogParams } from "./show-dialog-device-registry-
|
||||
|
||||
@customElement("dialog-device-registry-detail")
|
||||
class DialogDeviceRegistryDetail extends LitElement {
|
||||
@property() public hass!: HomeAssistant;
|
||||
@property({ attribute: false }) public hass!: HomeAssistant;
|
||||
|
||||
@property() private _nameByUser!: string;
|
||||
@internalProperty() private _nameByUser!: string;
|
||||
|
||||
@property() private _error?: string;
|
||||
@internalProperty() private _error?: string;
|
||||
|
||||
@property() private _params?: DeviceRegistryDetailDialogParams;
|
||||
@internalProperty() private _params?: DeviceRegistryDetailDialogParams;
|
||||
|
||||
@property() private _areaId?: string;
|
||||
@internalProperty() private _areaId?: string;
|
||||
|
||||
private _submitting?: boolean;
|
||||
|
||||
|
@@ -5,7 +5,7 @@ import {
|
||||
customElement,
|
||||
html,
|
||||
LitElement,
|
||||
property,
|
||||
internalProperty,
|
||||
TemplateResult,
|
||||
} from "lit-element";
|
||||
import "../../components/dialog/ha-paper-dialog";
|
||||
@@ -19,7 +19,7 @@ import { HaDomainTogglerDialogParams } from "./show-dialog-domain-toggler";
|
||||
class DomainTogglerDialog extends LitElement {
|
||||
public hass!: HomeAssistant;
|
||||
|
||||
@property() private _params?: HaDomainTogglerDialogParams;
|
||||
@internalProperty() private _params?: HaDomainTogglerDialogParams;
|
||||
|
||||
public async showDialog(params: HaDomainTogglerDialogParams): Promise<void> {
|
||||
this._params = params;
|
||||
|
@@ -7,6 +7,7 @@ import {
|
||||
html,
|
||||
LitElement,
|
||||
property,
|
||||
internalProperty,
|
||||
TemplateResult,
|
||||
} from "lit-element";
|
||||
import { classMap } from "lit-html/directives/class-map";
|
||||
@@ -20,11 +21,11 @@ import { fireEvent } from "../../common/dom/fire_event";
|
||||
|
||||
@customElement("dialog-box")
|
||||
class DialogBox extends LitElement {
|
||||
@property() public hass!: HomeAssistant;
|
||||
@property({ attribute: false }) public hass!: HomeAssistant;
|
||||
|
||||
@property() private _params?: DialogParams;
|
||||
@internalProperty() private _params?: DialogParams;
|
||||
|
||||
@property() private _value?: string;
|
||||
@internalProperty() private _value?: string;
|
||||
|
||||
public async showDialog(params: DialogParams): Promise<void> {
|
||||
this._params = params;
|
||||
|
@@ -15,7 +15,8 @@ declare global {
|
||||
}
|
||||
}
|
||||
|
||||
interface HassDialog<T = HASSDomEvents[ValidHassDomEvent]> extends HTMLElement {
|
||||
export interface HassDialog<T = HASSDomEvents[ValidHassDomEvent]>
|
||||
extends HTMLElement {
|
||||
showDialog(params: T);
|
||||
closeDialog?: () => boolean | void;
|
||||
}
|
||||
|
@@ -15,7 +15,7 @@ import { HomeAssistant } from "../../../types";
|
||||
|
||||
@customElement("more-info-automation")
|
||||
class MoreInfoAutomation extends LitElement {
|
||||
@property() public hass!: HomeAssistant;
|
||||
@property({ attribute: false }) public hass!: HomeAssistant;
|
||||
|
||||
@property() public stateObj?: HassEntity;
|
||||
|
||||
|
@@ -6,6 +6,7 @@ import {
|
||||
html,
|
||||
LitElement,
|
||||
property,
|
||||
internalProperty,
|
||||
PropertyValues,
|
||||
TemplateResult,
|
||||
} from "lit-element";
|
||||
@@ -20,13 +21,13 @@ import {
|
||||
import type { CameraEntity, HomeAssistant } from "../../../types";
|
||||
|
||||
class MoreInfoCamera extends LitElement {
|
||||
@property() public hass?: HomeAssistant;
|
||||
@property({ attribute: false }) public hass?: HomeAssistant;
|
||||
|
||||
@property() public stateObj?: CameraEntity;
|
||||
|
||||
@property() private _cameraPrefs?: CameraPreferences;
|
||||
@internalProperty() private _cameraPrefs?: CameraPreferences;
|
||||
|
||||
@property() private _attached = false;
|
||||
@internalProperty() private _attached = false;
|
||||
|
||||
public connectedCallback() {
|
||||
super.connectedCallback();
|
||||
|
@@ -32,7 +32,7 @@ import {
|
||||
import { HomeAssistant } from "../../../types";
|
||||
|
||||
class MoreInfoClimate extends LitElement {
|
||||
@property() public hass!: HomeAssistant;
|
||||
@property({ attribute: false }) public hass!: HomeAssistant;
|
||||
|
||||
@property() public stateObj?: ClimateEntity;
|
||||
|
||||
|
@@ -13,7 +13,7 @@ import { HomeAssistant } from "../../../types";
|
||||
|
||||
@customElement("more-info-counter")
|
||||
class MoreInfoCounter extends LitElement {
|
||||
@property() public hass!: HomeAssistant;
|
||||
@property({ attribute: false }) public hass!: HomeAssistant;
|
||||
|
||||
@property() public stateObj?: HassEntity;
|
||||
|
||||
|
@@ -11,7 +11,7 @@ import { HomeAssistant } from "../../../types";
|
||||
|
||||
@customElement("more-info-default")
|
||||
class MoreInfoDefault extends LitElement {
|
||||
@property() public hass!: HomeAssistant;
|
||||
@property({ attribute: false }) public hass!: HomeAssistant;
|
||||
|
||||
@property() public stateObj?: HassEntity;
|
||||
|
||||
|
@@ -24,7 +24,7 @@ import {
|
||||
import { HomeAssistant } from "../../../types";
|
||||
|
||||
class MoreInfoHumidifier extends LitElement {
|
||||
@property() public hass!: HomeAssistant;
|
||||
@property({ attribute: false }) public hass!: HomeAssistant;
|
||||
|
||||
@property() public stateObj?: HumidifierEntity;
|
||||
|
||||
|
@@ -68,26 +68,15 @@ class MoreInfoLight extends LocalizeMixin(EventsMixin(PolymerElement)) {
|
||||
}
|
||||
|
||||
.segmentationButton {
|
||||
display: none;
|
||||
position: absolute;
|
||||
top: 11%;
|
||||
top: 5%;
|
||||
transform: translate(0%, 0%);
|
||||
padding: 0px;
|
||||
max-height: 0px;
|
||||
width: 23px;
|
||||
height: 23px;
|
||||
opacity: var(--dark-secondary-opacity);
|
||||
overflow: hidden;
|
||||
transition: max-height 0.5s ease-in;
|
||||
color: var(--secondary-text-color);
|
||||
}
|
||||
|
||||
.has-color.is-on .segmentationContainer .segmentationButton {
|
||||
position: absolute;
|
||||
top: 11%;
|
||||
transform: translate(0%, 0%);
|
||||
width: 23px;
|
||||
height: 23px;
|
||||
padding: 0px;
|
||||
opacity: var(--dark-secondary-opacity);
|
||||
.has-color.is-on .segmentationButton {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.has-effect_list.is-on .effect_list,
|
||||
@@ -108,11 +97,6 @@ class MoreInfoLight extends LocalizeMixin(EventsMixin(PolymerElement)) {
|
||||
padding-top: 16px;
|
||||
}
|
||||
|
||||
.has-color.is-on .segmentationButton {
|
||||
max-height: 100px;
|
||||
overflow: visible;
|
||||
}
|
||||
|
||||
.has-color.is-on ha-color-picker {
|
||||
max-height: 500px;
|
||||
overflow: visible;
|
||||
@@ -189,7 +173,7 @@ class MoreInfoLight extends LocalizeMixin(EventsMixin(PolymerElement)) {
|
||||
<ha-icon-button
|
||||
icon="mdi:palette"
|
||||
on-click="segmentClick"
|
||||
class="control segmentationButton"
|
||||
class="segmentationButton"
|
||||
></ha-icon-button>
|
||||
</div>
|
||||
|
||||
@@ -217,7 +201,7 @@ class MoreInfoLight extends LocalizeMixin(EventsMixin(PolymerElement)) {
|
||||
|
||||
<ha-attributes
|
||||
state-obj="[[stateObj]]"
|
||||
extra-filters="brightness,color_temp,white_value,effect_list,effect,hs_color,rgb_color,xy_color,min_mireds,max_mireds"
|
||||
extra-filters="brightness,color_temp,white_value,effect_list,effect,hs_color,rgb_color,xy_color,min_mireds,max_mireds,entity_id"
|
||||
></ha-attributes>
|
||||
</div>
|
||||
`;
|
||||
|
@@ -18,7 +18,7 @@ import { HomeAssistant } from "../../../types";
|
||||
|
||||
@customElement("more-info-person")
|
||||
class MoreInfoPerson extends LitElement {
|
||||
@property() public hass!: HomeAssistant;
|
||||
@property({ attribute: false }) public hass!: HomeAssistant;
|
||||
|
||||
@property() public stateObj?: HassEntity;
|
||||
|
||||
|
@@ -11,7 +11,7 @@ import { HomeAssistant } from "../../../types";
|
||||
|
||||
@customElement("more-info-script")
|
||||
class MoreInfoScript extends LitElement {
|
||||
@property() public hass!: HomeAssistant;
|
||||
@property({ attribute: false }) public hass!: HomeAssistant;
|
||||
|
||||
@property() public stateObj?: HassEntity;
|
||||
|
||||
|
@@ -14,7 +14,7 @@ import { HomeAssistant } from "../../../types";
|
||||
|
||||
@customElement("more-info-sun")
|
||||
class MoreInfoSun extends LitElement {
|
||||
@property() public hass!: HomeAssistant;
|
||||
@property({ attribute: false }) public hass!: HomeAssistant;
|
||||
|
||||
@property() public stateObj?: HassEntity;
|
||||
|
||||
|
@@ -14,7 +14,7 @@ import { HomeAssistant } from "../../../types";
|
||||
|
||||
@customElement("more-info-timer")
|
||||
class MoreInfoTimer extends LitElement {
|
||||
@property() public hass!: HomeAssistant;
|
||||
@property({ attribute: false }) public hass!: HomeAssistant;
|
||||
|
||||
@property() public stateObj?: TimerEntity;
|
||||
|
||||
|
@@ -90,7 +90,7 @@ const VACUUM_COMMANDS: VacuumCommand[] = [
|
||||
|
||||
@customElement("more-info-vacuum")
|
||||
class MoreInfoVacuum extends LitElement {
|
||||
@property() public hass!: HomeAssistant;
|
||||
@property({ attribute: false }) public hass!: HomeAssistant;
|
||||
|
||||
@property() public stateObj?: VacuumEntity;
|
||||
|
||||
|
@@ -51,7 +51,7 @@ const weatherIcons = {
|
||||
|
||||
@customElement("more-info-weather")
|
||||
class MoreInfoWeather extends LitElement {
|
||||
@property() public hass!: HomeAssistant;
|
||||
@property({ attribute: false }) public hass!: HomeAssistant;
|
||||
|
||||
@property() public stateObj?: HassEntity;
|
||||
|
||||
|
@@ -18,9 +18,9 @@ import {
|
||||
customElement,
|
||||
LitElement,
|
||||
property,
|
||||
internalProperty,
|
||||
css,
|
||||
html,
|
||||
internalProperty,
|
||||
} from "lit-element";
|
||||
import { haStyleDialog } from "../../resources/styles";
|
||||
import { HomeAssistant } from "../../types";
|
||||
@@ -39,7 +39,7 @@ export interface MoreInfoDialogParams {
|
||||
|
||||
@customElement("ha-more-info-dialog")
|
||||
export class MoreInfoDialog extends LitElement {
|
||||
@property() public hass!: HomeAssistant;
|
||||
@property({ attribute: false }) public hass!: HomeAssistant;
|
||||
|
||||
@property({ type: Boolean, reflect: true }) public large = false;
|
||||
|
||||
@@ -248,6 +248,7 @@ export class MoreInfoDialog extends LitElement {
|
||||
haStyleDialog,
|
||||
css`
|
||||
ha-dialog {
|
||||
--dialog-surface-position: static;
|
||||
--dialog-content-position: static;
|
||||
}
|
||||
|
||||
@@ -272,19 +273,22 @@ export class MoreInfoDialog extends LitElement {
|
||||
--mdc-dialog-max-width: 90vw;
|
||||
}
|
||||
|
||||
ha-dialog:not([data-domain="camera"]) app-toolbar {
|
||||
max-width: 368px;
|
||||
}
|
||||
|
||||
.content {
|
||||
width: 352px;
|
||||
}
|
||||
|
||||
ha-header-bar {
|
||||
width: 400px;
|
||||
}
|
||||
|
||||
.main-title {
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
ha-dialog[data-domain="camera"] .content {
|
||||
ha-dialog[data-domain="camera"] .content,
|
||||
ha-dialog[data-domain="camera"] ha-header-bar {
|
||||
width: auto;
|
||||
}
|
||||
|
||||
@@ -292,18 +296,21 @@ export class MoreInfoDialog extends LitElement {
|
||||
width: calc(90vw - 48px);
|
||||
}
|
||||
|
||||
:host([large]) app-toolbar {
|
||||
max-width: calc(90vw - 32px);
|
||||
:host([large]) ha-dialog[data-domain="camera"] .content,
|
||||
:host([large]) ha-header-bar {
|
||||
width: 90vw;
|
||||
}
|
||||
}
|
||||
|
||||
state-history-charts {
|
||||
margin-top: 16px 0;
|
||||
}
|
||||
|
||||
ha-dialog[data-domain="camera"] {
|
||||
--dialog-content-padding: 0;
|
||||
}
|
||||
|
||||
state-card-content,
|
||||
state-history-charts {
|
||||
display: block;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
`,
|
||||
];
|
||||
}
|
||||
|
@@ -27,7 +27,7 @@ import "./controls/more-info-water_heater";
|
||||
import "./controls/more-info-weather";
|
||||
|
||||
class MoreInfoContent extends UpdatingElement {
|
||||
@property() public hass?: HomeAssistant;
|
||||
@property({ attribute: false }) public hass?: HomeAssistant;
|
||||
|
||||
@property() public stateObj?: HassEntity;
|
||||
|
||||
|
@@ -15,7 +15,7 @@ import "./notification-item-template";
|
||||
|
||||
@customElement("configurator-notification-item")
|
||||
export class HuiConfiguratorNotificationItem extends LitElement {
|
||||
@property() public hass?: HomeAssistant;
|
||||
@property({ attribute: false }) public hass?: HomeAssistant;
|
||||
|
||||
@property() public notification?: PersitentNotificationEntity;
|
||||
|
||||
|
@@ -14,7 +14,7 @@ import "./persistent-notification-item";
|
||||
|
||||
@customElement("notification-item")
|
||||
export class HuiNotificationItem extends LitElement {
|
||||
@property() public hass?: HomeAssistant;
|
||||
@property({ attribute: false }) public hass?: HomeAssistant;
|
||||
|
||||
@property() public notification?: HassEntity | PersistentNotification;
|
||||
|
||||
|
@@ -17,7 +17,7 @@ import "./notification-item-template";
|
||||
|
||||
@customElement("persistent-notification-item")
|
||||
export class HuiPersistentNotificationItem extends LitElement {
|
||||
@property() public hass?: HomeAssistant;
|
||||
@property({ attribute: false }) public hass?: HomeAssistant;
|
||||
|
||||
@property() public notification?: PersistentNotification;
|
||||
|
||||
|
@@ -10,6 +10,7 @@ import {
|
||||
html,
|
||||
LitElement,
|
||||
property,
|
||||
internalProperty,
|
||||
PropertyValues,
|
||||
query,
|
||||
TemplateResult,
|
||||
@@ -41,20 +42,20 @@ interface Results {
|
||||
|
||||
@customElement("ha-voice-command-dialog")
|
||||
export class HaVoiceCommandDialog extends LitElement {
|
||||
@property() public hass!: HomeAssistant;
|
||||
@property({ attribute: false }) public hass!: HomeAssistant;
|
||||
|
||||
@property() public results: Results | null = null;
|
||||
|
||||
@property() private _conversation: Message[] = [
|
||||
@internalProperty() private _conversation: Message[] = [
|
||||
{
|
||||
who: "hass",
|
||||
text: "",
|
||||
},
|
||||
];
|
||||
|
||||
@property() private _opened = false;
|
||||
@internalProperty() private _opened = false;
|
||||
|
||||
@property() private _agentInfo?: AgentInfo;
|
||||
@internalProperty() private _agentInfo?: AgentInfo;
|
||||
|
||||
@query("#messages") private messages!: PaperDialogScrollableElement;
|
||||
|
||||
|
@@ -21,7 +21,7 @@ class HassLoadingScreen extends LitElement {
|
||||
|
||||
@property({ type: Boolean }) public rootnav = false;
|
||||
|
||||
@property() public hass?: HomeAssistant;
|
||||
@property({ attribute: false }) public hass?: HomeAssistant;
|
||||
|
||||
@property() public narrow?: boolean;
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user