mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-27 03:06:41 +00:00
Fix decorators with properties (#25282)
* Fix decorators with properties * Green build --------- Co-authored-by: Simon Lamon <32477463+silamon@users.noreply.github.com>
This commit is contained in:
parent
678a8a85cb
commit
a820cd4576
@ -1,6 +1,5 @@
|
|||||||
import type { UnsubscribeFunc } from "home-assistant-js-websocket";
|
import type { UnsubscribeFunc } from "home-assistant-js-websocket";
|
||||||
import { ReactiveElement } from "lit";
|
import type { ReactiveElement } from "lit";
|
||||||
import type { InternalPropertyDeclaration } from "lit/decorators";
|
|
||||||
|
|
||||||
type Callback = (oldValue: any, newValue: any) => void;
|
type Callback = (oldValue: any, newValue: any) => void;
|
||||||
|
|
||||||
@ -108,7 +107,6 @@ export function storage(options: {
|
|||||||
storage?: "localStorage" | "sessionStorage";
|
storage?: "localStorage" | "sessionStorage";
|
||||||
subscribe?: boolean;
|
subscribe?: boolean;
|
||||||
state?: boolean;
|
state?: boolean;
|
||||||
stateOptions?: InternalPropertyDeclaration;
|
|
||||||
serializer?: (value: any) => any;
|
serializer?: (value: any) => any;
|
||||||
deserializer?: (value: any) => any;
|
deserializer?: (value: any) => any;
|
||||||
}) {
|
}) {
|
||||||
@ -174,7 +172,7 @@ export function storage(options: {
|
|||||||
performUpdate.call(this);
|
performUpdate.call(this);
|
||||||
};
|
};
|
||||||
|
|
||||||
if (options.state && options.subscribe) {
|
if (options.subscribe) {
|
||||||
const connectedCallback = proto.connectedCallback;
|
const connectedCallback = proto.connectedCallback;
|
||||||
const disconnectedCallback = proto.disconnectedCallback;
|
const disconnectedCallback = proto.disconnectedCallback;
|
||||||
|
|
||||||
@ -192,12 +190,6 @@ export function storage(options: {
|
|||||||
el.__unbsubLocalStorage = undefined;
|
el.__unbsubLocalStorage = undefined;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
if (options.state) {
|
|
||||||
ReactiveElement.createProperty(propertyKey, {
|
|
||||||
noAccessor: true,
|
|
||||||
...options.stateOptions,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
const descriptor = Object.getOwnPropertyDescriptor(proto, propertyKey);
|
const descriptor = Object.getOwnPropertyDescriptor(proto, propertyKey);
|
||||||
let newDescriptor: PropertyDescriptor;
|
let newDescriptor: PropertyDescriptor;
|
||||||
|
@ -1,10 +1,4 @@
|
|||||||
import {
|
import type { ReactiveElement, PropertyValues } from "lit";
|
||||||
ReactiveElement,
|
|
||||||
type PropertyDeclaration,
|
|
||||||
type PropertyValues,
|
|
||||||
} from "lit";
|
|
||||||
import { shallowEqual } from "../util/shallow-equal";
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Transform function type.
|
* Transform function type.
|
||||||
*/
|
*/
|
||||||
@ -23,7 +17,6 @@ type ReactiveTransformElement = ReactiveElement & {
|
|||||||
export function transform<T, V>(config: {
|
export function transform<T, V>(config: {
|
||||||
transformer: Transformer<T, V>;
|
transformer: Transformer<T, V>;
|
||||||
watch?: PropertyKey[];
|
watch?: PropertyKey[];
|
||||||
propertyOptions?: PropertyDeclaration;
|
|
||||||
}) {
|
}) {
|
||||||
return <ElemClass extends ReactiveElement>(
|
return <ElemClass extends ReactiveElement>(
|
||||||
proto: ElemClass,
|
proto: ElemClass,
|
||||||
@ -84,11 +77,6 @@ export function transform<T, V>(config: {
|
|||||||
curWatch.add(propertyKey);
|
curWatch.add(propertyKey);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
ReactiveElement.createProperty(propertyKey, {
|
|
||||||
noAccessor: true,
|
|
||||||
hasChanged: (v: any, o: any) => !shallowEqual(v, o),
|
|
||||||
...config.propertyOptions,
|
|
||||||
});
|
|
||||||
|
|
||||||
const descriptor = Object.getOwnPropertyDescriptor(proto, propertyKey);
|
const descriptor = Object.getOwnPropertyDescriptor(proto, propertyKey);
|
||||||
let newDescriptor: PropertyDescriptor;
|
let newDescriptor: PropertyDescriptor;
|
||||||
|
@ -210,6 +210,7 @@ class HaSidebar extends SubscribeMixin(LitElement) {
|
|||||||
|
|
||||||
private _unsubPersistentNotifications: UnsubscribeFunc | undefined;
|
private _unsubPersistentNotifications: UnsubscribeFunc | undefined;
|
||||||
|
|
||||||
|
@state()
|
||||||
@storage({
|
@storage({
|
||||||
key: "sidebarPanelOrder",
|
key: "sidebarPanelOrder",
|
||||||
state: true,
|
state: true,
|
||||||
@ -217,6 +218,7 @@ class HaSidebar extends SubscribeMixin(LitElement) {
|
|||||||
})
|
})
|
||||||
private _panelOrder: string[] = [];
|
private _panelOrder: string[] = [];
|
||||||
|
|
||||||
|
@state()
|
||||||
@storage({
|
@storage({
|
||||||
key: "sidebarHiddenPanels",
|
key: "sidebarHiddenPanels",
|
||||||
state: true,
|
state: true,
|
||||||
|
@ -42,6 +42,7 @@ class BrowseMediaTTS extends LitElement {
|
|||||||
|
|
||||||
@state() private _provider?: TTSEngine;
|
@state() private _provider?: TTSEngine;
|
||||||
|
|
||||||
|
@state()
|
||||||
@storage({
|
@storage({
|
||||||
key: "TtsMessage",
|
key: "TtsMessage",
|
||||||
state: true,
|
state: true,
|
||||||
|
@ -36,6 +36,7 @@ export class HaVoiceCommandDialog extends LitElement {
|
|||||||
|
|
||||||
@state() private _opened = false;
|
@state() private _opened = false;
|
||||||
|
|
||||||
|
@state()
|
||||||
@storage({
|
@storage({
|
||||||
key: "AssistPipelineId",
|
key: "AssistPipelineId",
|
||||||
state: true,
|
state: true,
|
||||||
|
@ -42,6 +42,7 @@ class PanelCalendar extends LitElement {
|
|||||||
|
|
||||||
@state() private _error?: string = undefined;
|
@state() private _error?: string = undefined;
|
||||||
|
|
||||||
|
@state()
|
||||||
@storage({
|
@storage({
|
||||||
key: "deSelectedCalendars",
|
key: "deSelectedCalendars",
|
||||||
state: true,
|
state: true,
|
||||||
|
@ -69,6 +69,7 @@ export class HaConfigApplicationCredentials extends LitElement {
|
|||||||
})
|
})
|
||||||
private _activeHiddenColumns?: string[];
|
private _activeHiddenColumns?: string[];
|
||||||
|
|
||||||
|
@state()
|
||||||
@storage({
|
@storage({
|
||||||
storage: "sessionStorage",
|
storage: "sessionStorage",
|
||||||
key: "application-credentials-table-search",
|
key: "application-credentials-table-search",
|
||||||
|
@ -36,6 +36,7 @@ export default class HaAutomationAction extends LitElement {
|
|||||||
|
|
||||||
@state() private _showReorder = false;
|
@state() private _showReorder = false;
|
||||||
|
|
||||||
|
@state()
|
||||||
@storage({
|
@storage({
|
||||||
key: "automationClipboard",
|
key: "automationClipboard",
|
||||||
state: true,
|
state: true,
|
||||||
|
@ -36,6 +36,7 @@ export default class HaAutomationCondition extends LitElement {
|
|||||||
|
|
||||||
@state() private _showReorder = false;
|
@state() private _showReorder = false;
|
||||||
|
|
||||||
|
@state()
|
||||||
@storage({
|
@storage({
|
||||||
key: "automationClipboard",
|
key: "automationClipboard",
|
||||||
state: true,
|
state: true,
|
||||||
|
@ -135,6 +135,7 @@ export class HaAutomationEditor extends PreventUnsavedMixin(
|
|||||||
|
|
||||||
@state() private _blueprintConfig?: BlueprintAutomationConfig;
|
@state() private _blueprintConfig?: BlueprintAutomationConfig;
|
||||||
|
|
||||||
|
@state()
|
||||||
@consume({ context: fullEntitiesContext, subscribe: true })
|
@consume({ context: fullEntitiesContext, subscribe: true })
|
||||||
@transform<EntityRegistryEntry[], EntityRegistryEntry>({
|
@transform<EntityRegistryEntry[], EntityRegistryEntry>({
|
||||||
transformer: function (this: HaAutomationEditor, value) {
|
transformer: function (this: HaAutomationEditor, value) {
|
||||||
|
@ -138,6 +138,7 @@ class HaAutomationPicker extends SubscribeMixin(LitElement) {
|
|||||||
|
|
||||||
@state() private _filteredAutomations?: string[] | null;
|
@state() private _filteredAutomations?: string[] | null;
|
||||||
|
|
||||||
|
@state()
|
||||||
@storage({
|
@storage({
|
||||||
storage: "sessionStorage",
|
storage: "sessionStorage",
|
||||||
key: "automation-table-search",
|
key: "automation-table-search",
|
||||||
@ -146,6 +147,7 @@ class HaAutomationPicker extends SubscribeMixin(LitElement) {
|
|||||||
})
|
})
|
||||||
private _filter = "";
|
private _filter = "";
|
||||||
|
|
||||||
|
@state()
|
||||||
@storage({
|
@storage({
|
||||||
storage: "sessionStorage",
|
storage: "sessionStorage",
|
||||||
key: "automation-table-filters-full",
|
key: "automation-table-filters-full",
|
||||||
|
@ -29,6 +29,7 @@ export default class HaAutomationOption extends LitElement {
|
|||||||
|
|
||||||
@state() private _showReorder = false;
|
@state() private _showReorder = false;
|
||||||
|
|
||||||
|
@state()
|
||||||
@storage({
|
@storage({
|
||||||
key: "automationClipboard",
|
key: "automationClipboard",
|
||||||
state: true,
|
state: true,
|
||||||
|
@ -38,6 +38,7 @@ export default class HaAutomationTrigger extends LitElement {
|
|||||||
|
|
||||||
@state() private _showReorder = false;
|
@state() private _showReorder = false;
|
||||||
|
|
||||||
|
@state()
|
||||||
@storage({
|
@storage({
|
||||||
key: "automationClipboard",
|
key: "automationClipboard",
|
||||||
state: true,
|
state: true,
|
||||||
|
@ -98,6 +98,7 @@ class HaConfigBackupBackups extends SubscribeMixin(LitElement) {
|
|||||||
|
|
||||||
@state() private _selected: string[] = [];
|
@state() private _selected: string[] = [];
|
||||||
|
|
||||||
|
@state()
|
||||||
@storage({
|
@storage({
|
||||||
storage: "sessionStorage",
|
storage: "sessionStorage",
|
||||||
key: "backups-table-filters",
|
key: "backups-table-filters",
|
||||||
|
@ -9,7 +9,7 @@ import {
|
|||||||
} from "@mdi/js";
|
} from "@mdi/js";
|
||||||
import type { CSSResultGroup, PropertyValues, TemplateResult } from "lit";
|
import type { CSSResultGroup, PropertyValues, TemplateResult } from "lit";
|
||||||
import { LitElement, html } from "lit";
|
import { LitElement, html } from "lit";
|
||||||
import { customElement, property } from "lit/decorators";
|
import { customElement, property, state } from "lit/decorators";
|
||||||
import memoizeOne from "memoize-one";
|
import memoizeOne from "memoize-one";
|
||||||
import type { HASSDomEvent } from "../../../common/dom/fire_event";
|
import type { HASSDomEvent } from "../../../common/dom/fire_event";
|
||||||
import { fireEvent } from "../../../common/dom/fire_event";
|
import { fireEvent } from "../../../common/dom/fire_event";
|
||||||
@ -118,6 +118,7 @@ class HaBlueprintOverview extends LitElement {
|
|||||||
})
|
})
|
||||||
private _activeHiddenColumns?: string[];
|
private _activeHiddenColumns?: string[];
|
||||||
|
|
||||||
|
@state()
|
||||||
@storage({
|
@storage({
|
||||||
storage: "sessionStorage",
|
storage: "sessionStorage",
|
||||||
key: "blueprint-table-search",
|
key: "blueprint-table-search",
|
||||||
@ -499,9 +500,11 @@ class HaBlueprintOverview extends LitElement {
|
|||||||
list: html`<ul>
|
list: html`<ul>
|
||||||
${[...(related.automation || []), ...(related.script || [])].map(
|
${[...(related.automation || []), ...(related.script || [])].map(
|
||||||
(item) => {
|
(item) => {
|
||||||
const state = this.hass.states[item];
|
const automationState = this.hass.states[item];
|
||||||
return html`<li>
|
return html`<li>
|
||||||
${state ? `${computeStateName(state)} (${item})` : item}
|
${automationState
|
||||||
|
? `${computeStateName(automationState)} (${item})`
|
||||||
|
: item}
|
||||||
</li>`;
|
</li>`;
|
||||||
}
|
}
|
||||||
)}
|
)}
|
||||||
|
@ -120,6 +120,7 @@ export class HaConfigDeviceDashboard extends SubscribeMixin(LitElement) {
|
|||||||
|
|
||||||
@state() private _selected: string[] = [];
|
@state() private _selected: string[] = [];
|
||||||
|
|
||||||
|
@state()
|
||||||
@storage({
|
@storage({
|
||||||
storage: "sessionStorage",
|
storage: "sessionStorage",
|
||||||
key: "devices-table-search",
|
key: "devices-table-search",
|
||||||
@ -128,6 +129,7 @@ export class HaConfigDeviceDashboard extends SubscribeMixin(LitElement) {
|
|||||||
})
|
})
|
||||||
private _filter: string = history.state?.filter || "";
|
private _filter: string = history.state?.filter || "";
|
||||||
|
|
||||||
|
@state()
|
||||||
@storage({
|
@storage({
|
||||||
storage: "sessionStorage",
|
storage: "sessionStorage",
|
||||||
key: "devices-table-filters-full",
|
key: "devices-table-filters-full",
|
||||||
|
@ -159,6 +159,7 @@ export class HaConfigEntities extends SubscribeMixin(LitElement) {
|
|||||||
@consume({ context: fullEntitiesContext, subscribe: true })
|
@consume({ context: fullEntitiesContext, subscribe: true })
|
||||||
_entities!: EntityRegistryEntry[];
|
_entities!: EntityRegistryEntry[];
|
||||||
|
|
||||||
|
@state()
|
||||||
@storage({
|
@storage({
|
||||||
storage: "sessionStorage",
|
storage: "sessionStorage",
|
||||||
key: "entities-table-search",
|
key: "entities-table-search",
|
||||||
@ -169,6 +170,7 @@ export class HaConfigEntities extends SubscribeMixin(LitElement) {
|
|||||||
|
|
||||||
@state() private _searchParms = new URLSearchParams(window.location.search);
|
@state() private _searchParms = new URLSearchParams(window.location.search);
|
||||||
|
|
||||||
|
@state()
|
||||||
@storage({
|
@storage({
|
||||||
storage: "sessionStorage",
|
storage: "sessionStorage",
|
||||||
key: "entities-table-filters",
|
key: "entities-table-filters",
|
||||||
|
@ -168,6 +168,7 @@ export class HaConfigHelpers extends SubscribeMixin(LitElement) {
|
|||||||
})
|
})
|
||||||
private _activeCollapsed?: string;
|
private _activeCollapsed?: string;
|
||||||
|
|
||||||
|
@state()
|
||||||
@storage({
|
@storage({
|
||||||
storage: "sessionStorage",
|
storage: "sessionStorage",
|
||||||
key: "helpers-table-search",
|
key: "helpers-table-search",
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import "@material/mwc-button";
|
import "@material/mwc-button";
|
||||||
import type { CSSResultGroup, TemplateResult } from "lit";
|
import type { CSSResultGroup, TemplateResult } from "lit";
|
||||||
import { css, html, LitElement } from "lit";
|
import { css, html, LitElement } from "lit";
|
||||||
import { customElement, property } from "lit/decorators";
|
import { customElement, property, state } from "lit/decorators";
|
||||||
import { storage } from "../../../../../common/decorators/storage";
|
import { storage } from "../../../../../common/decorators/storage";
|
||||||
import "../../../../../components/ha-card";
|
import "../../../../../components/ha-card";
|
||||||
import "../../../../../components/ha-code-editor";
|
import "../../../../../components/ha-code-editor";
|
||||||
@ -23,6 +23,7 @@ export class MQTTConfigPanel extends LitElement {
|
|||||||
|
|
||||||
@property({ type: Boolean }) public narrow = false;
|
@property({ type: Boolean }) public narrow = false;
|
||||||
|
|
||||||
|
@state()
|
||||||
@storage({
|
@storage({
|
||||||
key: "panel-dev-mqtt-topic-ls",
|
key: "panel-dev-mqtt-topic-ls",
|
||||||
state: true,
|
state: true,
|
||||||
@ -30,6 +31,7 @@ export class MQTTConfigPanel extends LitElement {
|
|||||||
})
|
})
|
||||||
private _topic = "";
|
private _topic = "";
|
||||||
|
|
||||||
|
@state()
|
||||||
@storage({
|
@storage({
|
||||||
key: "panel-dev-mqtt-payload-ls",
|
key: "panel-dev-mqtt-payload-ls",
|
||||||
state: true,
|
state: true,
|
||||||
@ -37,6 +39,7 @@ export class MQTTConfigPanel extends LitElement {
|
|||||||
})
|
})
|
||||||
private _payload = "";
|
private _payload = "";
|
||||||
|
|
||||||
|
@state()
|
||||||
@storage({
|
@storage({
|
||||||
key: "panel-dev-mqtt-qos-ls",
|
key: "panel-dev-mqtt-qos-ls",
|
||||||
state: true,
|
state: true,
|
||||||
@ -44,6 +47,7 @@ export class MQTTConfigPanel extends LitElement {
|
|||||||
})
|
})
|
||||||
private _qos = "0";
|
private _qos = "0";
|
||||||
|
|
||||||
|
@state()
|
||||||
@storage({
|
@storage({
|
||||||
key: "panel-dev-mqtt-retain-ls",
|
key: "panel-dev-mqtt-retain-ls",
|
||||||
state: true,
|
state: true,
|
||||||
@ -51,6 +55,7 @@ export class MQTTConfigPanel extends LitElement {
|
|||||||
})
|
})
|
||||||
private _retain = false;
|
private _retain = false;
|
||||||
|
|
||||||
|
@state()
|
||||||
@storage({
|
@storage({
|
||||||
key: "panel-dev-mqtt-allow-template-ls",
|
key: "panel-dev-mqtt-allow-template-ls",
|
||||||
state: true,
|
state: true,
|
||||||
|
@ -21,6 +21,7 @@ const qosLevel = ["0", "1", "2"];
|
|||||||
class MqttSubscribeCard extends LitElement {
|
class MqttSubscribeCard extends LitElement {
|
||||||
@property({ attribute: false }) public hass!: HomeAssistant;
|
@property({ attribute: false }) public hass!: HomeAssistant;
|
||||||
|
|
||||||
|
@state()
|
||||||
@storage({
|
@storage({
|
||||||
key: "panel-dev-mqtt-topic-subscribe",
|
key: "panel-dev-mqtt-topic-subscribe",
|
||||||
state: true,
|
state: true,
|
||||||
@ -28,6 +29,7 @@ class MqttSubscribeCard extends LitElement {
|
|||||||
})
|
})
|
||||||
private _topic = "";
|
private _topic = "";
|
||||||
|
|
||||||
|
@state()
|
||||||
@storage({
|
@storage({
|
||||||
key: "panel-dev-mqtt-qos-subscribe",
|
key: "panel-dev-mqtt-qos-subscribe",
|
||||||
state: true,
|
state: true,
|
||||||
@ -35,6 +37,7 @@ class MqttSubscribeCard extends LitElement {
|
|||||||
})
|
})
|
||||||
private _qos = "0";
|
private _qos = "0";
|
||||||
|
|
||||||
|
@state()
|
||||||
@storage({
|
@storage({
|
||||||
key: "panel-dev-mqtt-json-format",
|
key: "panel-dev-mqtt-json-format",
|
||||||
state: true,
|
state: true,
|
||||||
|
@ -55,6 +55,7 @@ export class HaConfigLabels extends LitElement {
|
|||||||
|
|
||||||
@state() private _labels: LabelRegistryEntry[] = [];
|
@state() private _labels: LabelRegistryEntry[] = [];
|
||||||
|
|
||||||
|
@state()
|
||||||
@storage({
|
@storage({
|
||||||
storage: "sessionStorage",
|
storage: "sessionStorage",
|
||||||
key: "labels-table-search",
|
key: "labels-table-search",
|
||||||
|
@ -74,6 +74,7 @@ export class HaConfigLovelaceDashboards extends LitElement {
|
|||||||
|
|
||||||
@state() private _dashboards: LovelaceDashboard[] = [];
|
@state() private _dashboards: LovelaceDashboard[] = [];
|
||||||
|
|
||||||
|
@state()
|
||||||
@storage({
|
@storage({
|
||||||
storage: "sessionStorage",
|
storage: "sessionStorage",
|
||||||
key: "lovelace-dashboards-table-search",
|
key: "lovelace-dashboards-table-search",
|
||||||
|
@ -46,6 +46,7 @@ export class HaConfigLovelaceRescources extends LitElement {
|
|||||||
|
|
||||||
@state() private _resources: LovelaceResource[] = [];
|
@state() private _resources: LovelaceResource[] = [];
|
||||||
|
|
||||||
|
@state()
|
||||||
@storage({
|
@storage({
|
||||||
storage: "sessionStorage",
|
storage: "sessionStorage",
|
||||||
key: "lovelace-resources-table-search",
|
key: "lovelace-resources-table-search",
|
||||||
|
@ -133,6 +133,7 @@ class HaSceneDashboard extends SubscribeMixin(LitElement) {
|
|||||||
|
|
||||||
@state() private _filteredScenes?: string[] | null;
|
@state() private _filteredScenes?: string[] | null;
|
||||||
|
|
||||||
|
@state()
|
||||||
@storage({
|
@storage({
|
||||||
storage: "sessionStorage",
|
storage: "sessionStorage",
|
||||||
key: "scene-table-search",
|
key: "scene-table-search",
|
||||||
@ -141,6 +142,7 @@ class HaSceneDashboard extends SubscribeMixin(LitElement) {
|
|||||||
})
|
})
|
||||||
private _filter = "";
|
private _filter = "";
|
||||||
|
|
||||||
|
@state()
|
||||||
@storage({
|
@storage({
|
||||||
storage: "sessionStorage",
|
storage: "sessionStorage",
|
||||||
key: "scene-table-filters-full",
|
key: "scene-table-filters-full",
|
||||||
|
@ -105,6 +105,7 @@ export class HaScriptEditor extends SubscribeMixin(
|
|||||||
|
|
||||||
@state() private _readOnly = false;
|
@state() private _readOnly = false;
|
||||||
|
|
||||||
|
@state()
|
||||||
@consume({ context: fullEntitiesContext, subscribe: true })
|
@consume({ context: fullEntitiesContext, subscribe: true })
|
||||||
@transform<EntityRegistryEntry[], EntityRegistryEntry>({
|
@transform<EntityRegistryEntry[], EntityRegistryEntry>({
|
||||||
transformer: function (this: HaScriptEditor, value) {
|
transformer: function (this: HaScriptEditor, value) {
|
||||||
|
@ -138,6 +138,7 @@ class HaScriptPicker extends SubscribeMixin(LitElement) {
|
|||||||
|
|
||||||
@state() private _filteredScripts?: string[] | null;
|
@state() private _filteredScripts?: string[] | null;
|
||||||
|
|
||||||
|
@state()
|
||||||
@storage({
|
@storage({
|
||||||
storage: "sessionStorage",
|
storage: "sessionStorage",
|
||||||
key: "script-table-search",
|
key: "script-table-search",
|
||||||
@ -146,6 +147,7 @@ class HaScriptPicker extends SubscribeMixin(LitElement) {
|
|||||||
})
|
})
|
||||||
private _filter = "";
|
private _filter = "";
|
||||||
|
|
||||||
|
@state()
|
||||||
@storage({
|
@storage({
|
||||||
storage: "sessionStorage",
|
storage: "sessionStorage",
|
||||||
key: "script-table-filters-full",
|
key: "script-table-filters-full",
|
||||||
|
@ -62,6 +62,7 @@ export class HaConfigTags extends SubscribeMixin(LitElement) {
|
|||||||
return this.hass.auth.external?.config.canWriteTag;
|
return this.hass.auth.external?.config.canWriteTag;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@state()
|
||||||
@storage({
|
@storage({
|
||||||
storage: "sessionStorage",
|
storage: "sessionStorage",
|
||||||
key: "tags-table-search",
|
key: "tags-table-search",
|
||||||
|
@ -76,6 +76,7 @@ export class VoiceAssistantsExpose extends LitElement {
|
|||||||
|
|
||||||
@state() private _extEntities?: Record<string, ExtEntityRegistryEntry>;
|
@state() private _extEntities?: Record<string, ExtEntityRegistryEntry>;
|
||||||
|
|
||||||
|
@state()
|
||||||
@storage({
|
@storage({
|
||||||
storage: "sessionStorage",
|
storage: "sessionStorage",
|
||||||
key: "voice-expose-table-search",
|
key: "voice-expose-table-search",
|
||||||
|
@ -52,6 +52,7 @@ class HaPanelDevAction extends LitElement {
|
|||||||
|
|
||||||
private _yamlValid = true;
|
private _yamlValid = true;
|
||||||
|
|
||||||
|
@state()
|
||||||
@storage({
|
@storage({
|
||||||
key: "panel-dev-action-state-service-data",
|
key: "panel-dev-action-state-service-data",
|
||||||
state: true,
|
state: true,
|
||||||
@ -59,6 +60,7 @@ class HaPanelDevAction extends LitElement {
|
|||||||
})
|
})
|
||||||
private _serviceData?: ServiceAction = { action: "", target: {}, data: {} };
|
private _serviceData?: ServiceAction = { action: "", target: {}, data: {} };
|
||||||
|
|
||||||
|
@state()
|
||||||
@storage({
|
@storage({
|
||||||
key: "panel-dev-action-state-yaml-mode",
|
key: "panel-dev-action-state-yaml-mode",
|
||||||
state: true,
|
state: true,
|
||||||
|
@ -33,6 +33,7 @@ class HaPanelDevAssist extends SubscribeMixin(LitElement) {
|
|||||||
|
|
||||||
@state() supportedLanguages?: string[];
|
@state() supportedLanguages?: string[];
|
||||||
|
|
||||||
|
@state()
|
||||||
@storage({
|
@storage({
|
||||||
key: "assist_debug_language",
|
key: "assist_debug_language",
|
||||||
state: true,
|
state: true,
|
||||||
|
@ -62,6 +62,7 @@ class HaPanelDevState extends LitElement {
|
|||||||
|
|
||||||
@state() private _validJSON = true;
|
@state() private _validJSON = true;
|
||||||
|
|
||||||
|
@state()
|
||||||
@storage({
|
@storage({
|
||||||
key: "devToolsShowAttributes",
|
key: "devToolsShowAttributes",
|
||||||
state: true,
|
state: true,
|
||||||
|
@ -63,6 +63,7 @@ class HaPanelHistory extends LitElement {
|
|||||||
|
|
||||||
@state() private _endDate: Date;
|
@state() private _endDate: Date;
|
||||||
|
|
||||||
|
@state()
|
||||||
@storage({
|
@storage({
|
||||||
key: "historyPickedValue",
|
key: "historyPickedValue",
|
||||||
state: true,
|
state: true,
|
||||||
|
@ -39,6 +39,7 @@ export class HaPanelLogbook extends LitElement {
|
|||||||
@state()
|
@state()
|
||||||
private _showBack?: boolean;
|
private _showBack?: boolean;
|
||||||
|
|
||||||
|
@state()
|
||||||
@storage({
|
@storage({
|
||||||
key: "logbookPickedValue",
|
key: "logbookPickedValue",
|
||||||
state: true,
|
state: true,
|
||||||
|
@ -62,6 +62,7 @@ export class HuiEnergyDevicesDetailGraphCard
|
|||||||
|
|
||||||
@state() private _compareEnd?: Date;
|
@state() private _compareEnd?: Date;
|
||||||
|
|
||||||
|
@state()
|
||||||
@storage({
|
@storage({
|
||||||
key: "energy-devices-hidden-stats",
|
key: "energy-devices-hidden-stats",
|
||||||
state: true,
|
state: true,
|
||||||
|
@ -86,6 +86,7 @@ export class HuiButtonCard extends LitElement implements LovelaceCard {
|
|||||||
|
|
||||||
@state() private _config?: ButtonCardConfig;
|
@state() private _config?: ButtonCardConfig;
|
||||||
|
|
||||||
|
@state()
|
||||||
@consume<any>({ context: statesContext, subscribe: true })
|
@consume<any>({ context: statesContext, subscribe: true })
|
||||||
@transform({
|
@transform({
|
||||||
transformer: function (this: HuiButtonCard, value: HassEntities) {
|
transformer: function (this: HuiButtonCard, value: HassEntities) {
|
||||||
@ -111,6 +112,7 @@ export class HuiButtonCard extends LitElement implements LovelaceCard {
|
|||||||
@consume({ context: configContext, subscribe: true })
|
@consume({ context: configContext, subscribe: true })
|
||||||
_hassConfig!: HassConfig;
|
_hassConfig!: HassConfig;
|
||||||
|
|
||||||
|
@state()
|
||||||
@consume<any>({ context: entitiesContext, subscribe: true })
|
@consume<any>({ context: entitiesContext, subscribe: true })
|
||||||
@transform<HomeAssistant["entities"], EntityRegistryDisplayEntry>({
|
@transform<HomeAssistant["entities"], EntityRegistryDisplayEntry>({
|
||||||
transformer: function (this: HuiButtonCard, value) {
|
transformer: function (this: HuiButtonCard, value) {
|
||||||
|
@ -43,6 +43,7 @@ export class HuiBadgePicker extends LitElement {
|
|||||||
|
|
||||||
@property({ attribute: false }) public suggestedBadges?: string[];
|
@property({ attribute: false }) public suggestedBadges?: string[];
|
||||||
|
|
||||||
|
@state()
|
||||||
@storage({
|
@storage({
|
||||||
key: "dashboardBadgeClipboard",
|
key: "dashboardBadgeClipboard",
|
||||||
state: true,
|
state: true,
|
||||||
|
@ -42,6 +42,7 @@ export class HuiCardPicker extends LitElement {
|
|||||||
|
|
||||||
@property({ attribute: false }) public suggestedCards?: string[];
|
@property({ attribute: false }) public suggestedCards?: string[];
|
||||||
|
|
||||||
|
@state()
|
||||||
@storage({
|
@storage({
|
||||||
key: "dashboardCardClipboard",
|
key: "dashboardCardClipboard",
|
||||||
state: true,
|
state: true,
|
||||||
|
@ -64,6 +64,7 @@ class PanelMediaBrowser extends LitElement {
|
|||||||
|
|
||||||
@state() _currentItem?: MediaPlayerItem;
|
@state() _currentItem?: MediaPlayerItem;
|
||||||
|
|
||||||
|
@state()
|
||||||
@storage({
|
@storage({
|
||||||
key: "mediaBrowserPreferredLayout",
|
key: "mediaBrowserPreferredLayout",
|
||||||
state: true,
|
state: true,
|
||||||
@ -78,6 +79,7 @@ class PanelMediaBrowser extends LitElement {
|
|||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@state()
|
||||||
@storage({
|
@storage({
|
||||||
key: "mediaBrowseEntityId",
|
key: "mediaBrowseEntityId",
|
||||||
state: true,
|
state: true,
|
||||||
|
@ -9,7 +9,7 @@ import {
|
|||||||
} from "@mdi/js";
|
} from "@mdi/js";
|
||||||
import type { CSSResultGroup, PropertyValues, TemplateResult } from "lit";
|
import type { CSSResultGroup, PropertyValues, TemplateResult } from "lit";
|
||||||
import { LitElement, css, html, nothing } from "lit";
|
import { LitElement, css, html, nothing } from "lit";
|
||||||
import { customElement, property } from "lit/decorators";
|
import { customElement, property, state } from "lit/decorators";
|
||||||
import memoizeOne from "memoize-one";
|
import memoizeOne from "memoize-one";
|
||||||
import { isComponentLoaded } from "../../common/config/is_component_loaded";
|
import { isComponentLoaded } from "../../common/config/is_component_loaded";
|
||||||
import { storage } from "../../common/decorators/storage";
|
import { storage } from "../../common/decorators/storage";
|
||||||
@ -55,6 +55,7 @@ class PanelTodo extends LitElement {
|
|||||||
|
|
||||||
@property({ type: Boolean, reflect: true }) public mobile = false;
|
@property({ type: Boolean, reflect: true }) public mobile = false;
|
||||||
|
|
||||||
|
@state()
|
||||||
@storage({
|
@storage({
|
||||||
key: "selectedTodoEntity",
|
key: "selectedTodoEntity",
|
||||||
state: true,
|
state: true,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user