Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/components/chart/state-history-chart-line.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { PropertyValues } from "lit";
import { html, LitElement } from "lit";
import { property, state } from "lit/decorators";
import { customElement, property, state } from "lit/decorators";
import type { VisualMapComponentOption } from "echarts/components";
import type { LineSeriesOption } from "echarts/charts";
import type { YAXisOption } from "echarts/types/dist/shared";
Expand All @@ -27,6 +27,7 @@ const safeParseFloat = (value) => {
return isFinite(parsed) ? parsed : null;
};

@customElement("state-history-chart-line")
export class StateHistoryChartLine extends LitElement {
@property({ attribute: false }) public hass!: HomeAssistant;

Expand Down Expand Up @@ -795,7 +796,6 @@ export class StateHistoryChartLine extends LitElement {
return Math.abs(value) < 1 ? value : roundingFn(value);
}
}
customElements.define("state-history-chart-line", StateHistoryChartLine);

declare global {
interface HTMLElementTagNameMap {
Expand Down
5 changes: 2 additions & 3 deletions src/components/entity/state-badge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { mdiAlert } from "@mdi/js";
import type { HassEntity } from "home-assistant-js-websocket";
import type { CSSResultGroup, PropertyValues } from "lit";
import { LitElement, css, html, nothing } from "lit";
import { property, state } from "lit/decorators";
import { customElement, property, state } from "lit/decorators";
import { ifDefined } from "lit/directives/if-defined";
import { styleMap } from "lit/directives/style-map";
import { computeDomain } from "../../common/entity/compute_domain";
Expand All @@ -17,6 +17,7 @@ import { CLIMATE_HVAC_ACTION_TO_MODE } from "../../data/climate";
import type { HomeAssistant } from "../../types";
import "../ha-state-icon";

@customElement("state-badge")
export class StateBadge extends LitElement {
public hass?: HomeAssistant;

Expand Down Expand Up @@ -265,5 +266,3 @@ declare global {
"state-badge": StateBadge;
}
}

customElements.define("state-badge", StateBadge);
5 changes: 2 additions & 3 deletions src/components/map/ha-entity-marker.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import { LitElement, html, css } from "lit";
import { property } from "lit/decorators";
import { customElement, property } from "lit/decorators";
import { styleMap } from "lit/directives/style-map";
import type { HomeAssistant } from "../../types";
import { fireEvent } from "../../common/dom/fire_event";
import "../ha-state-icon";

@customElement("ha-entity-marker")
class HaEntityMarker extends LitElement {
@property({ attribute: false }) public hass!: HomeAssistant;

Expand Down Expand Up @@ -89,8 +90,6 @@ class HaEntityMarker extends LitElement {
`;
}

customElements.define("ha-entity-marker", HaEntityMarker);

declare global {
interface HTMLElementTagNameMap {
"ha-entity-marker": HaEntityMarker;
Expand Down
5 changes: 2 additions & 3 deletions src/dialogs/more-info/controls/more-info-camera.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { css, html, LitElement, nothing } from "lit";
import { property, state } from "lit/decorators";
import { customElement, property, state } from "lit/decorators";
import { slugify } from "../../../common/string/slugify";
import "../../../components/buttons/ha-progress-button";
import "../../../components/ha-camera-stream";
Expand All @@ -9,6 +9,7 @@ import type { HomeAssistant } from "../../../types";
import { fileDownload } from "../../../util/file_download";
import { showToast } from "../../../util/toast";

@customElement("more-info-camera")
class MoreInfoCamera extends LitElement {
@property({ attribute: false }) public hass!: HomeAssistant;

Expand Down Expand Up @@ -112,8 +113,6 @@ class MoreInfoCamera extends LitElement {
`;
}

customElements.define("more-info-camera", MoreInfoCamera);

declare global {
interface HTMLElementTagNameMap {
"more-info-camera": MoreInfoCamera;
Expand Down
5 changes: 2 additions & 3 deletions src/dialogs/more-info/controls/more-info-climate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
} from "@mdi/js";
import type { CSSResultGroup, PropertyValues } from "lit";
import { LitElement, css, html, nothing } from "lit";
import { property, state } from "lit/decorators";
import { customElement, property, state } from "lit/decorators";
import { stopPropagation } from "../../../common/dom/stop_propagation";
import { supportsFeature } from "../../../common/entity/supports-feature";
import "../../../components/ha-attribute-icon";
Expand All @@ -32,6 +32,7 @@ import { moreInfoControlStyle } from "../components/more-info-control-style";

type MainControl = "temperature" | "humidity";

@customElement("more-info-climate")
class MoreInfoClimate extends LitElement {
@property({ attribute: false }) public hass!: HomeAssistant;

Expand Down Expand Up @@ -567,8 +568,6 @@ class MoreInfoClimate extends LitElement {
}
}

customElements.define("more-info-climate", MoreInfoClimate);

declare global {
interface HTMLElementTagNameMap {
"more-info-climate": MoreInfoClimate;
Expand Down
5 changes: 2 additions & 3 deletions src/dialogs/more-info/controls/more-info-group.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { HassEntity } from "home-assistant-js-websocket";
import type { CSSResultGroup, PropertyValues } from "lit";
import { LitElement, css, html, nothing } from "lit";
import { property, state } from "lit/decorators";
import { customElement, property, state } from "lit/decorators";
import { dynamicElement } from "../../../common/dom/dynamic-element-directive";
import type { GroupEntity } from "../../../data/group";
import { computeGroupDomain } from "../../../data/group";
Expand All @@ -13,6 +13,7 @@ import {
importMoreInfoControl,
} from "../state_more_info_control";

@customElement("more-info-group")
class MoreInfoGroup extends LitElement {
@property({ attribute: false }) public hass!: HomeAssistant;

Expand Down Expand Up @@ -106,8 +107,6 @@ class MoreInfoGroup extends LitElement {
}
}

customElements.define("more-info-group", MoreInfoGroup);

declare global {
interface HTMLElementTagNameMap {
"more-info-group": MoreInfoGroup;
Expand Down
5 changes: 2 additions & 3 deletions src/dialogs/more-info/controls/more-info-humidifier.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { mdiPower, mdiTuneVariant } from "@mdi/js";
import type { CSSResultGroup, PropertyValues } from "lit";
import { LitElement, css, html, nothing } from "lit";
import { property, state } from "lit/decorators";
import { customElement, property, state } from "lit/decorators";
import { stopPropagation } from "../../../common/dom/stop_propagation";
import { supportsFeature } from "../../../common/entity/supports-feature";
import "../../../components/ha-control-select-menu";
Expand All @@ -15,6 +15,7 @@ import type { HomeAssistant } from "../../../types";
import "../components/ha-more-info-control-select-container";
import { moreInfoControlStyle } from "../components/more-info-control-style";

@customElement("more-info-humidifier")
class MoreInfoHumidifier extends LitElement {
@property({ attribute: false }) public hass!: HomeAssistant;

Expand Down Expand Up @@ -249,8 +250,6 @@ class MoreInfoHumidifier extends LitElement {
}
}

customElements.define("more-info-humidifier", MoreInfoHumidifier);

declare global {
interface HTMLElementTagNameMap {
"more-info-humidifier": MoreInfoHumidifier;
Expand Down
5 changes: 2 additions & 3 deletions src/layouts/ha-init-page.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import type { PropertyValues } from "lit";
import { css, html, LitElement } from "lit";
import { property, state } from "lit/decorators";
import { customElement, property, state } from "lit/decorators";
import "../components/ha-spinner";
import "../components/ha-button";

@customElement("ha-init-page")
class HaInitPage extends LitElement {
@property({ type: Boolean }) public error = false;

Expand Down Expand Up @@ -120,8 +121,6 @@ class HaInitPage extends LitElement {
`;
}

customElements.define("ha-init-page", HaInitPage);

declare global {
interface HTMLElementTagNameMap {
"ha-init-page": HaInitPage;
Expand Down
5 changes: 2 additions & 3 deletions src/managers/notification-manager.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { mdiClose } from "@mdi/js";
import { html, LitElement, nothing } from "lit";
import { property, query, state } from "lit/decorators";
import { customElement, property, query, state } from "lit/decorators";
import type { LocalizeKeys } from "../common/translations/localize";
import "../components/ha-button";
import "../components/ha-icon-button";
Expand All @@ -26,6 +26,7 @@ export interface ToastActionParams {
| { translationKey: LocalizeKeys; args?: Record<string, string> };
}

@customElement("notification-manager")
class NotificationManager extends LitElement {
@property({ attribute: false }) public hass!: HomeAssistant;

Expand Down Expand Up @@ -115,8 +116,6 @@ class NotificationManager extends LitElement {
}
}

customElements.define("notification-manager", NotificationManager);

declare global {
interface HTMLElementTagNameMap {
"notification-manager": NotificationManager;
Expand Down
8 changes: 2 additions & 6 deletions src/panels/calendar/dialog-calendar-event-detail.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { TZDate } from "@date-fns/tz";
import { addDays, isSameDay } from "date-fns";
import type { CSSResultGroup } from "lit";
import { LitElement, css, html, nothing } from "lit";
import { property, state } from "lit/decorators";
import { customElement, property, state } from "lit/decorators";
import { formatDate } from "../../common/datetime/format_date";
import { formatDateTime } from "../../common/datetime/format_date_time";
import { formatTime } from "../../common/datetime/format_time";
Expand All @@ -26,6 +26,7 @@ import type { CalendarEventDetailDialogParams } from "./show-dialog-calendar-eve
import { showCalendarEventEditDialog } from "./show-dialog-calendar-event-editor";
import { resolveTimeZone } from "../../common/datetime/resolve-time-zone";

@customElement("dialog-calendar-event-detail")
class DialogCalendarEventDetail extends LitElement {
@property({ attribute: false }) public hass!: HomeAssistant;

Expand Down Expand Up @@ -271,8 +272,3 @@ declare global {
"dialog-calendar-event-detail": DialogCalendarEventDetail;
}
}

customElements.define(
"dialog-calendar-event-detail",
DialogCalendarEventDetail
);
5 changes: 2 additions & 3 deletions src/panels/config/areas/dialog-area-registry-detail.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { HassEntity } from "home-assistant-js-websocket";
import type { CSSResultGroup } from "lit";
import { css, html, LitElement, nothing } from "lit";
import { property, state } from "lit/decorators";
import { customElement, property, state } from "lit/decorators";
import { fireEvent } from "../../../common/dom/fire_event";
import "../../../components/entity/ha-entity-picker";
import type { HaEntityPicker } from "../../../components/entity/ha-entity-picker";
Expand Down Expand Up @@ -40,6 +40,7 @@ const SENSOR_DOMAINS = ["sensor"];
const TEMPERATURE_DEVICE_CLASSES = [SENSOR_DEVICE_CLASS_TEMPERATURE];
const HUMIDITY_DEVICE_CLASSES = [SENSOR_DEVICE_CLASS_HUMIDITY];

@customElement("dialog-area-registry-detail")
class DialogAreaDetail extends LitElement {
@property({ attribute: false }) public hass!: HomeAssistant;

Expand Down Expand Up @@ -426,5 +427,3 @@ declare global {
"dialog-area-registry-detail": DialogAreaDetail;
}
}

customElements.define("dialog-area-registry-detail", DialogAreaDetail);
5 changes: 2 additions & 3 deletions src/panels/config/areas/dialog-floor-registry-detail.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { mdiTextureBox } from "@mdi/js";
import type { CSSResultGroup } from "lit";
import { css, html, LitElement, nothing } from "lit";
import { property, state } from "lit/decorators";
import { customElement, property, state } from "lit/decorators";
import { repeat } from "lit/directives/repeat";
import memoizeOne from "memoize-one";
import { fireEvent } from "../../../common/dom/fire_event";
Expand All @@ -27,6 +27,7 @@ import type { HomeAssistant } from "../../../types";
import { showAreaRegistryDetailDialog } from "./show-dialog-area-registry-detail";
import type { FloorRegistryDetailDialogParams } from "./show-dialog-floor-registry-detail";

@customElement("dialog-floor-registry-detail")
class DialogFloorDetail extends LitElement {
@property({ attribute: false }) public hass!: HomeAssistant;

Expand Down Expand Up @@ -357,5 +358,3 @@ declare global {
"dialog-floor-registry-detail": DialogFloorDetail;
}
}

customElements.define("dialog-floor-registry-detail", DialogFloorDetail);
5 changes: 2 additions & 3 deletions src/panels/config/automation/ha-automation-editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import {
import type { UnsubscribeFunc } from "home-assistant-js-websocket";
import type { CSSResultGroup, PropertyValues, TemplateResult } from "lit";
import { css, html, LitElement, nothing } from "lit";
import { property, query, state } from "lit/decorators";
import { customElement, property, query, state } from "lit/decorators";
import { classMap } from "lit/directives/class-map";
import { transform } from "../../../common/decorators/transform";
import { fireEvent } from "../../../common/dom/fire_event";
Expand Down Expand Up @@ -112,6 +112,7 @@ declare global {
}
}

@customElement("ha-automation-editor")
export class HaAutomationEditor extends PreventUnsavedMixin(
KeyboardShortcutMixin(LitElement)
) {
Expand Down Expand Up @@ -1339,5 +1340,3 @@ export class HaAutomationEditor extends PreventUnsavedMixin(
];
}
}

customElements.define("ha-automation-editor", HaAutomationEditor);
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { mdiOpenInNew } from "@mdi/js";
import type { CSSResultGroup } from "lit";
import { css, html, LitElement, nothing } from "lit";
import { state } from "lit/decorators";
import { customElement, state } from "lit/decorators";
import { fireEvent } from "../../../../common/dom/fire_event";
import { createCloseHeading } from "../../../../components/ha-dialog";
import { showConfirmationDialog } from "../../../../dialogs/generic/show-dialog-box";
Expand All @@ -13,6 +13,7 @@ import type { WebhookDialogParams } from "./show-dialog-manage-cloudhook";
import "../../../../components/ha-button";
import "../../../../components/ha-copy-textfield";

@customElement("dialog-manage-cloudhook")
export class DialogManageCloudhook extends LitElement {
protected hass?: HomeAssistant;

Expand Down Expand Up @@ -155,5 +156,3 @@ declare global {
"dialog-manage-cloudhook": DialogManageCloudhook;
}
}

customElements.define("dialog-manage-cloudhook", DialogManageCloudhook);
5 changes: 2 additions & 3 deletions src/panels/config/helpers/forms/dialog-schedule-block-info.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { CSSResultGroup } from "lit";
import { html, LitElement, nothing } from "lit";
import memoizeOne from "memoize-one";
import { property, state } from "lit/decorators";
import { customElement, property, state } from "lit/decorators";
import { fireEvent } from "../../../../common/dom/fire_event";
import { createCloseHeading } from "../../../../components/ha-dialog";
import "../../../../components/ha-form/ha-form";
Expand All @@ -14,6 +14,7 @@ import type {
} from "./show-dialog-schedule-block-info";
import type { SchemaUnion } from "../../../../components/ha-form/types";

@customElement("dialog-schedule-block-info")
class DialogScheduleBlockInfo extends LitElement {
@property({ attribute: false }) public hass!: HomeAssistant;

Expand Down Expand Up @@ -156,5 +157,3 @@ declare global {
"dialog-schedule-block-info": DialogScheduleBlockInfo;
}
}

customElements.define("dialog-schedule-block-info", DialogScheduleBlockInfo);
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { CSSResultGroup, PropertyValues } from "lit";
import { css, html, LitElement, nothing } from "lit";
import { property, state } from "lit/decorators";
import { customElement, property, state } from "lit/decorators";
import { stopPropagation } from "../../../../../common/dom/stop_propagation";
import "../../../../../components/buttons/ha-call-service-button";
import "../../../../../components/ha-card";
Expand All @@ -15,6 +15,7 @@ import type { HomeAssistant } from "../../../../../types";
import { formatAsPaddedHex } from "./functions";
import type { IssueCommandServiceData } from "./types";

@customElement("zha-cluster-commands")
export class ZHAClusterCommands extends LitElement {
@property({ attribute: false }) public hass?: HomeAssistant;

Expand Down Expand Up @@ -259,5 +260,3 @@ declare global {
"zha-cluster-commands": ZHAClusterCommands;
}
}

customElements.define("zha-cluster-commands", ZHAClusterCommands);
Loading
Loading