From 4aacfe67df1aa1ce40d5bc3cb4aa6f2a2c135bb5 Mon Sep 17 00:00:00 2001 From: Petar Petrov Date: Tue, 7 Jan 2025 13:40:24 +0200 Subject: [PATCH 1/8] Fix more-info chart rendering --- src/components/chart/ha-chart-base.ts | 16 ------------- .../chart/state-history-chart-line.ts | 12 ++++------ .../chart/state-history-chart-timeline.ts | 9 +------ src/components/chart/state-history-charts.ts | 24 ++++--------------- src/components/chart/statistics-chart.ts | 17 ++++--------- src/dialogs/more-info/ha-more-info-dialog.ts | 5 ---- .../ha-more-info-history-and-logbook.ts | 11 +-------- src/dialogs/more-info/ha-more-info-history.ts | 17 +++---------- src/dialogs/more-info/ha-more-info-info.ts | 11 +-------- 9 files changed, 19 insertions(+), 103 deletions(-) diff --git a/src/components/chart/ha-chart-base.ts b/src/components/chart/ha-chart-base.ts index 017a5dab07a7..87d106139c08 100644 --- a/src/components/chart/ha-chart-base.ts +++ b/src/components/chart/ha-chart-base.ts @@ -108,22 +108,6 @@ export class HaChartBase extends LitElement { this.chart?.update(mode); }; - public resize = (options?: ChartResizeOptions): void => { - if (options?.aspectRatio && !options.height) { - options.height = Math.round( - (options.width ?? this.clientWidth) / options.aspectRatio - ); - } else if (options?.aspectRatio && !options.width) { - options.width = Math.round( - (options.height ?? this.clientHeight) * options.aspectRatio - ); - } - this.chart?.resize( - options?.width ?? this.clientWidth, - options?.height ?? this.clientHeight - ); - }; - protected firstUpdated() { this._setupChart(); this.data.datasets.forEach((dataset, index) => { diff --git a/src/components/chart/state-history-chart-line.ts b/src/components/chart/state-history-chart-line.ts index e2113b747863..389d47b6a5aa 100644 --- a/src/components/chart/state-history-chart-line.ts +++ b/src/components/chart/state-history-chart-line.ts @@ -1,7 +1,7 @@ import type { ChartData, ChartDataset, ChartOptions } from "chart.js"; import type { PropertyValues } from "lit"; import { html, LitElement } from "lit"; -import { property, query, state } from "lit/decorators"; +import { property, state } from "lit/decorators"; import { getGraphColorByIndex } from "../../common/color/colors"; import { fireEvent } from "../../common/dom/fire_event"; import { computeRTL } from "../../common/util/compute_rtl"; @@ -12,7 +12,6 @@ import { } from "../../common/number/format_number"; import type { LineChartEntity, LineChartState } from "../../data/history"; import type { HomeAssistant } from "../../types"; -import type { ChartResizeOptions, HaChartBase } from "./ha-chart-base"; import { MIN_TIME_BETWEEN_UPDATES } from "./ha-chart-base"; import { clickIsTouch } from "./click_is_touch"; @@ -55,6 +54,8 @@ export class StateHistoryChartLine extends LitElement { @property({ attribute: "fit-y-data", type: Boolean }) public fitYData = false; + @property({ attribute: false, type: Number }) public height?: number; + @state() private _chartData?: ChartData<"line">; @state() private _entityIds: string[] = []; @@ -67,12 +68,6 @@ export class StateHistoryChartLine extends LitElement { private _chartTime: Date = new Date(); - @query("ha-chart-base") private _chart?: HaChartBase; - - public resize = (options?: ChartResizeOptions): void => { - this._chart?.resize(options); - }; - protected render() { return html` `; } diff --git a/src/components/chart/state-history-chart-timeline.ts b/src/components/chart/state-history-chart-timeline.ts index 0806b1cc897a..e57f710a6306 100644 --- a/src/components/chart/state-history-chart-timeline.ts +++ b/src/components/chart/state-history-chart-timeline.ts @@ -2,7 +2,7 @@ import type { ChartData, ChartDataset, ChartOptions } from "chart.js"; import { getRelativePosition } from "chart.js/helpers"; import type { CSSResultGroup, PropertyValues } from "lit"; import { css, html, LitElement } from "lit"; -import { customElement, property, query, state } from "lit/decorators"; +import { customElement, property, state } from "lit/decorators"; import { formatDateTimeWithSeconds } from "../../common/datetime/format_date_time"; import millisecondsToDuration from "../../common/datetime/milliseconds_to_duration"; import { fireEvent } from "../../common/dom/fire_event"; @@ -10,7 +10,6 @@ import { numberFormatToLocale } from "../../common/number/format_number"; import { computeRTL } from "../../common/util/compute_rtl"; import type { TimelineEntity } from "../../data/history"; import type { HomeAssistant } from "../../types"; -import type { ChartResizeOptions, HaChartBase } from "./ha-chart-base"; import { MIN_TIME_BETWEEN_UPDATES } from "./ha-chart-base"; import type { TimeLineData } from "./timeline-chart/const"; import { computeTimelineColor } from "./timeline-chart/timeline-color"; @@ -53,12 +52,6 @@ export class StateHistoryChartTimeline extends LitElement { private _chartTime: Date = new Date(); - @query("ha-chart-base") private _chart?: HaChartBase; - - public resize = (options?: ChartResizeOptions): void => { - this._chart?.resize(options); - }; - protected render() { return html` { - this._charts?.forEach( - (chart: StateHistoryChartLine | StateHistoryChartTimeline) => - chart.resize(options) - ); - }; - protected render() { if (!isComponentLoaded(this.hass, "history")) { return html`
@@ -170,6 +153,7 @@ export class StateHistoryCharts extends LitElement { .maxYAxis=${this.maxYAxis} .fitYData=${this.fitYData} @y-width-changed=${this._yWidthChanged} + .height=${this.height} >
`; } diff --git a/src/components/chart/statistics-chart.ts b/src/components/chart/statistics-chart.ts index 2873df4d6039..1d5199732690 100644 --- a/src/components/chart/statistics-chart.ts +++ b/src/components/chart/statistics-chart.ts @@ -6,7 +6,7 @@ import type { } from "chart.js"; import type { CSSResultGroup, PropertyValues, TemplateResult } from "lit"; import { css, html, LitElement } from "lit"; -import { customElement, property, state, query } from "lit/decorators"; +import { customElement, property, state } from "lit/decorators"; import memoizeOne from "memoize-one"; import { getGraphColorByIndex } from "../../common/color/colors"; import { isComponentLoaded } from "../../common/config/is_component_loaded"; @@ -30,11 +30,7 @@ import { } from "../../data/recorder"; import type { HomeAssistant } from "../../types"; import "./ha-chart-base"; -import type { - ChartResizeOptions, - ChartDatasetExtra, - HaChartBase, -} from "./ha-chart-base"; +import type { ChartDatasetExtra } from "./ha-chart-base"; import { clickIsTouch } from "./click_is_touch"; export const supportedStatTypeMap: Record = { @@ -88,6 +84,8 @@ export class StatisticsChart extends LitElement { @property() public period?: string; + @property({ attribute: false, type: Number }) public height?: number; + @state() private _chartData: ChartData = { datasets: [] }; @state() private _chartDatasetExtra: ChartDatasetExtra[] = []; @@ -98,14 +96,8 @@ export class StatisticsChart extends LitElement { @state() private _hiddenStats = new Set(); - @query("ha-chart-base") private _chart?: HaChartBase; - private _computedStyle?: CSSStyleDeclaration; - public resize = (options?: ChartResizeOptions): void => { - this._chart?.resize(options); - }; - protected shouldUpdate(changedProps: PropertyValues): boolean { return changedProps.size > 1 || !changedProps.has("hass"); } @@ -175,6 +167,7 @@ export class StatisticsChart extends LitElement { .chartType=${this.chartType} @dataset-hidden=${this._datasetHidden} @dataset-unhidden=${this._datasetUnhidden} + .height=${this.height} >
`; } diff --git a/src/dialogs/more-info/ha-more-info-dialog.ts b/src/dialogs/more-info/ha-more-info-dialog.ts index 51d14f1cce77..b7f6b87039ce 100644 --- a/src/dialogs/more-info/ha-more-info-dialog.ts +++ b/src/dialogs/more-info/ha-more-info-dialog.ts @@ -283,7 +283,6 @@ export class MoreInfoDialog extends LitElement { ; - @query("statistics-chart, state-history-charts") private _chart?: - | StateHistoryCharts - | StatisticsChart; - - public resize = (options?: ChartResizeOptions): void => { - if (this._chart) { - this._chart.resize(options); - } - }; - protected render() { if (!this.entityId) { return nothing; @@ -94,6 +81,7 @@ export class MoreInfoHistory extends LitElement { .names=${this._statNames} hide-legend .clickForMoreInfo=${false} + .height=${this.clientWidth / 2} >` : html``}` : ""}`; } diff --git a/src/dialogs/more-info/ha-more-info-info.ts b/src/dialogs/more-info/ha-more-info-info.ts index efee44afbdc8..be4a09e4a0c1 100644 --- a/src/dialogs/more-info/ha-more-info-info.ts +++ b/src/dialogs/more-info/ha-more-info-info.ts @@ -1,8 +1,7 @@ import type { HassEntity } from "home-assistant-js-websocket"; import { css, html, LitElement, nothing } from "lit"; -import { customElement, property, query } from "lit/decorators"; +import { customElement, property } from "lit/decorators"; import { computeDomain } from "../../common/entity/compute_domain"; -import type { ChartResizeOptions } from "../../components/chart/ha-chart-base"; import type { ExtEntityRegistryEntry } from "../../data/entity_registry"; import type { HomeAssistant } from "../../types"; import { @@ -14,7 +13,6 @@ import { DOMAINS_WITH_MORE_INFO, } from "./const"; import "./ha-more-info-history"; -import type { MoreInfoHistory } from "./ha-more-info-history"; import "./ha-more-info-logbook"; import "./more-info-content"; @@ -28,13 +26,6 @@ export class MoreInfoInfo extends LitElement { @property({ attribute: false }) public editMode?: boolean; - @query("ha-more-info-history") - private _history?: MoreInfoHistory; - - public resize(options?: ChartResizeOptions) { - this._history?.resize(options); - } - protected render() { const entityId = this.entityId; const stateObj = this.hass.states[entityId] as HassEntity | undefined; From 4f576150a4e2b397dab768b2e6b3cc43fd076eea Mon Sep 17 00:00:00 2001 From: Petar Petrov Date: Tue, 7 Jan 2025 13:49:42 +0200 Subject: [PATCH 2/8] lint fix --- src/dialogs/more-info/ha-more-info-dialog.ts | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/dialogs/more-info/ha-more-info-dialog.ts b/src/dialogs/more-info/ha-more-info-dialog.ts index b7f6b87039ce..37ea6841f944 100644 --- a/src/dialogs/more-info/ha-more-info-dialog.ts +++ b/src/dialogs/more-info/ha-more-info-dialog.ts @@ -12,7 +12,7 @@ import { import type { HassEntity } from "home-assistant-js-websocket"; import type { PropertyValues } from "lit"; import { LitElement, css, html, nothing } from "lit"; -import { customElement, property, query, state } from "lit/decorators"; +import { customElement, property, state } from "lit/decorators"; import { cache } from "lit/directives/cache"; import { dynamicElement } from "../../common/dom/dynamic-element-directive"; import { fireEvent } from "../../common/dom/fire_event"; @@ -47,9 +47,7 @@ import { } from "./const"; import "./controls/more-info-default"; import "./ha-more-info-history-and-logbook"; -import type { MoreInfoHistoryAndLogbook } from "./ha-more-info-history-and-logbook"; import "./ha-more-info-info"; -import type { MoreInfoInfo } from "./ha-more-info-info"; import "./ha-more-info-settings"; import "./more-info-content"; @@ -98,9 +96,6 @@ export class MoreInfoDialog extends LitElement { @state() private _infoEditMode = false; - @query("ha-more-info-info, ha-more-info-history-and-logbook") - private _history?: MoreInfoInfo | MoreInfoHistoryAndLogbook; - public showDialog(params: MoreInfoDialogParams) { this._entityId = params.entityId; if (!this._entityId) { From 6ea8b9186caae7d611d805c27b55c74f2f4abbf8 Mon Sep 17 00:00:00 2001 From: Petar Petrov Date: Tue, 7 Jan 2025 15:13:12 +0200 Subject: [PATCH 3/8] remove animation-container & _chartHeight --- src/components/chart/ha-chart-base.ts | 202 ++++++++++---------------- 1 file changed, 74 insertions(+), 128 deletions(-) diff --git a/src/components/chart/ha-chart-base.ts b/src/components/chart/ha-chart-base.ts index 87d106139c08..594e130aaeda 100644 --- a/src/components/chart/ha-chart-base.ts +++ b/src/components/chart/ha-chart-base.ts @@ -4,6 +4,7 @@ import type { ChartData, ChartOptions, TooltipModel, + UpdateMode, } from "chart.js"; import type { CSSResultGroup, PropertyValues } from "lit"; import { css, html, nothing, LitElement } from "lit"; @@ -20,12 +21,6 @@ import "../ha-icon-button"; export const MIN_TIME_BETWEEN_UPDATES = 60 * 5 * 1000; -export interface ChartResizeOptions { - aspectRatio?: number; - height?: number; - width?: number; -} - interface Tooltip extends Omit, "tooltipPosition" | "hasValue" | "getProps"> { top: string; @@ -61,8 +56,6 @@ export class HaChartBase extends LitElement { @property({ attribute: "external-hidden", type: Boolean }) public externalHidden = false; - @state() private _chartHeight?: number; - @state() private _legendHeight?: number; @state() private _tooltip?: Tooltip; @@ -94,17 +87,7 @@ export class HaChartBase extends LitElement { } } - public updateChart = ( - mode: - | "resize" - | "reset" - | "none" - | "hide" - | "show" - | "default" - | "active" - | undefined - ): void => { + public updateChart = (mode?: UpdateMode): void => { this.chart?.update(mode); }; @@ -249,96 +232,84 @@ export class HaChartBase extends LitElement { ` : ""}
-
+
- -
-
- ${isMac - ? this.hass.localize( - "ui.components.history_charts.zoom_hint_mac" - ) - : this.hass.localize("ui.components.history_charts.zoom_hint")} -
+
+ ${isMac + ? this.hass.localize("ui.components.history_charts.zoom_hint_mac") + : this.hass.localize("ui.components.history_charts.zoom_hint")}
- ${this._isZoomed && this.chartType !== "timeline" - ? html`` - : nothing} - ${this._tooltip - ? html`
-
${this._tooltip.title}
- ${this._tooltip.beforeBody - ? html`
- ${this._tooltip.beforeBody} -
` - : ""} -
-
    - ${this._tooltip.body.map( - (item, i) => - html`
  • -
    - ${item.lines.join("\n")} -
  • ` - )} -
-
- ${this._tooltip.footer.length - ? html`` - : ""} -
` - : ""}
+ ${this._isZoomed && this.chartType !== "timeline" + ? html`` + : nothing} + ${this._tooltip + ? html`
+
${this._tooltip.title}
+ ${this._tooltip.beforeBody + ? html`
+ ${this._tooltip.beforeBody} +
` + : ""} +
+
    + ${this._tooltip.body.map( + (item, i) => + html`
  • +
    + ${item.lines.join("\n")} +
  • ` + )} +
+
+ ${this._tooltip.footer.length + ? html`` + : ""} +
` + : ""}
`; } @@ -371,7 +342,7 @@ export class HaChartBase extends LitElement { type: this.chartType, data: this.data, options: this._createOptions(), - plugins: this._createPlugins(), + plugins: this.plugins, }); } finally { this._loading = false; @@ -448,26 +419,6 @@ export class HaChartBase extends LitElement { }; } - private _createPlugins() { - return [ - ...(this.plugins || []), - { - id: "resizeHook", - resize: (chart) => { - const change = chart.height - (this._chartHeight ?? 0); - if (!this._chartHeight || change > 12 || change < -12) { - // hysteresis to prevent infinite render loops - this._chartHeight = chart.height; - } - }, - legend: { - ...this.options?.plugins?.legend, - display: false, - }, - }, - ]; - } - private _handleChartScroll(ev: MouseEvent) { const modifier = isMac ? "metaKey" : "ctrlKey"; this._tooltip = undefined; @@ -551,11 +502,6 @@ export class HaChartBase extends LitElement { display: block; position: relative; } - .animation-container { - overflow: hidden; - height: 0; - transition: height 300ms cubic-bezier(0.4, 0, 0.2, 1); - } .chart-container { position: relative; } From ccd6565a1a644555b1ebcbafea4e672f837a6a34 Mon Sep 17 00:00:00 2001 From: Petar Petrov Date: Tue, 7 Jan 2025 15:40:05 +0200 Subject: [PATCH 4/8] don't change height on resize --- src/dialogs/more-info/ha-more-info-history.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/dialogs/more-info/ha-more-info-history.ts b/src/dialogs/more-info/ha-more-info-history.ts index f1fbe4372afc..792a1abb76ab 100644 --- a/src/dialogs/more-info/ha-more-info-history.ts +++ b/src/dialogs/more-info/ha-more-info-history.ts @@ -51,6 +51,12 @@ export class MoreInfoHistory extends LitElement { private _metadata?: Record; + private _chartHeight?: number; + + protected firstUpdated() { + this._chartHeight = this.clientWidth / 2; + } + protected render() { if (!this.entityId) { return nothing; @@ -81,7 +87,7 @@ export class MoreInfoHistory extends LitElement { .names=${this._statNames} hide-legend .clickForMoreInfo=${false} - .height=${this.clientWidth / 2} + .height=${this._chartHeight} >` : html``}` : ""}`; } From 71821438b3f4964b3acf591958cc28985a72c42c Mon Sep 17 00:00:00 2001 From: Petar Petrov Date: Tue, 7 Jan 2025 16:08:26 +0200 Subject: [PATCH 5/8] handle default height in ha-chart-base --- src/components/chart/ha-chart-base.ts | 10 +++++++++- src/components/chart/state-history-chart-line.ts | 3 --- src/components/chart/state-history-charts.ts | 3 --- src/components/chart/statistics-chart.ts | 3 --- src/dialogs/more-info/ha-more-info-history.ts | 8 -------- 5 files changed, 9 insertions(+), 18 deletions(-) diff --git a/src/components/chart/ha-chart-base.ts b/src/components/chart/ha-chart-base.ts index 594e130aaeda..bc9e982b11fc 100644 --- a/src/components/chart/ha-chart-base.ts +++ b/src/components/chart/ha-chart-base.ts @@ -98,6 +98,10 @@ export class HaChartBase extends LitElement { this._hiddenDatasets.add(index); } }); + if (!this.height) { + // lock the height so it doesn't change when the parent element resizes + this.height = this._getDefaultHeight(); + } } public shouldUpdate(changedProps: PropertyValues): boolean { @@ -234,7 +238,7 @@ export class HaChartBase extends LitElement {
; @state() private _entityIds: string[] = []; @@ -76,7 +74,6 @@ export class StateHistoryChartLine extends LitElement { .options=${this._chartOptions} .paddingYAxis=${this.paddingYAxis - this._yWidth} chart-type="line" - .height=${this.height} > `; } diff --git a/src/components/chart/state-history-charts.ts b/src/components/chart/state-history-charts.ts index e6469082fca0..aec82543305b 100644 --- a/src/components/chart/state-history-charts.ts +++ b/src/components/chart/state-history-charts.ts @@ -69,8 +69,6 @@ export class StateHistoryCharts extends LitElement { @property({ attribute: "fit-y-data", type: Boolean }) public fitYData = false; - @property({ attribute: false, type: Number }) public height?: number; - private _computedStartTime!: Date; private _computedEndTime!: Date; @@ -153,7 +151,6 @@ export class StateHistoryCharts extends LitElement { .maxYAxis=${this.maxYAxis} .fitYData=${this.fitYData} @y-width-changed=${this._yWidthChanged} - .height=${this.height} >
`; } diff --git a/src/components/chart/statistics-chart.ts b/src/components/chart/statistics-chart.ts index 1d5199732690..ff0dd5d0feb7 100644 --- a/src/components/chart/statistics-chart.ts +++ b/src/components/chart/statistics-chart.ts @@ -84,8 +84,6 @@ export class StatisticsChart extends LitElement { @property() public period?: string; - @property({ attribute: false, type: Number }) public height?: number; - @state() private _chartData: ChartData = { datasets: [] }; @state() private _chartDatasetExtra: ChartDatasetExtra[] = []; @@ -167,7 +165,6 @@ export class StatisticsChart extends LitElement { .chartType=${this.chartType} @dataset-hidden=${this._datasetHidden} @dataset-unhidden=${this._datasetUnhidden} - .height=${this.height} > `; } diff --git a/src/dialogs/more-info/ha-more-info-history.ts b/src/dialogs/more-info/ha-more-info-history.ts index 792a1abb76ab..ca687477599c 100644 --- a/src/dialogs/more-info/ha-more-info-history.ts +++ b/src/dialogs/more-info/ha-more-info-history.ts @@ -51,12 +51,6 @@ export class MoreInfoHistory extends LitElement { private _metadata?: Record; - private _chartHeight?: number; - - protected firstUpdated() { - this._chartHeight = this.clientWidth / 2; - } - protected render() { if (!this.entityId) { return nothing; @@ -87,7 +81,6 @@ export class MoreInfoHistory extends LitElement { .names=${this._statNames} hide-legend .clickForMoreInfo=${false} - .height=${this._chartHeight} >` : html``}` : ""}`; } From 6005cf930b577499b4e55faed57f06a13fa8f896 Mon Sep 17 00:00:00 2001 From: Petar Petrov Date: Tue, 7 Jan 2025 21:10:48 +0200 Subject: [PATCH 6/8] fix chart height in energy panel --- src/components/chart/ha-chart-base.ts | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/src/components/chart/ha-chart-base.ts b/src/components/chart/ha-chart-base.ts index bc9e982b11fc..dd3cacb91781 100644 --- a/src/components/chart/ha-chart-base.ts +++ b/src/components/chart/ha-chart-base.ts @@ -98,10 +98,6 @@ export class HaChartBase extends LitElement { this._hiddenDatasets.add(index); } }); - if (!this.height) { - // lock the height so it doesn't change when the parent element resizes - this.height = this._getDefaultHeight(); - } } public shouldUpdate(changedProps: PropertyValues): boolean { @@ -346,7 +342,7 @@ export class HaChartBase extends LitElement { type: this.chartType, data: this.data, options: this._createOptions(), - plugins: this.plugins, + plugins: this._createPlugins(), }); } finally { this._loading = false; @@ -423,6 +419,26 @@ export class HaChartBase extends LitElement { }; } + private _createPlugins() { + return [ + ...(this.plugins || []), + { + id: "resizeHook", + resize: (chart: Chart) => { + if (!this.height) { + // lock the height + // this removes empty space below the chart + this.height = chart.height; + } + }, + legend: { + ...this.options?.plugins?.legend, + display: false, + }, + }, + ]; + } + private _getDefaultHeight() { return this.clientWidth / 2; } From bd6130dc69d1296d07a5dfe6fc8617b4931a211a Mon Sep 17 00:00:00 2001 From: Petar Petrov Date: Wed, 8 Jan 2025 13:29:55 +0200 Subject: [PATCH 7/8] lint --- src/dialogs/more-info/ha-more-info-history-and-logbook.ts | 2 +- src/dialogs/more-info/ha-more-info-info.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/dialogs/more-info/ha-more-info-history-and-logbook.ts b/src/dialogs/more-info/ha-more-info-history-and-logbook.ts index 0b2c0c542b49..624022c9927e 100644 --- a/src/dialogs/more-info/ha-more-info-history-and-logbook.ts +++ b/src/dialogs/more-info/ha-more-info-history-and-logbook.ts @@ -1,6 +1,6 @@ import type { CSSResultGroup } from "lit"; import { css, html, LitElement } from "lit"; -import { customElement, property, query, state } from "lit/decorators"; +import { customElement, property, state } from "lit/decorators"; import type { HomeAssistant } from "../../types"; import { computeShowHistoryComponent, diff --git a/src/dialogs/more-info/ha-more-info-info.ts b/src/dialogs/more-info/ha-more-info-info.ts index 89c80983d20a..a460b30ce4dc 100644 --- a/src/dialogs/more-info/ha-more-info-info.ts +++ b/src/dialogs/more-info/ha-more-info-info.ts @@ -1,6 +1,6 @@ import type { HassEntity } from "home-assistant-js-websocket"; import { css, html, LitElement, nothing } from "lit"; -import { customElement, property, query, state } from "lit/decorators"; +import { customElement, property, state } from "lit/decorators"; import { computeDomain } from "../../common/entity/compute_domain"; import type { ExtEntityRegistryEntry } from "../../data/entity_registry"; import type { HomeAssistant } from "../../types"; From 3e541ac3235d0a8cd7a76a121d8f81062b58cb0f Mon Sep 17 00:00:00 2001 From: Petar Petrov Date: Wed, 8 Jan 2025 13:32:40 +0200 Subject: [PATCH 8/8] lint --- src/dialogs/more-info/ha-more-info-dialog.ts | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/dialogs/more-info/ha-more-info-dialog.ts b/src/dialogs/more-info/ha-more-info-dialog.ts index 155427b758a6..abd25648ec40 100644 --- a/src/dialogs/more-info/ha-more-info-dialog.ts +++ b/src/dialogs/more-info/ha-more-info-dialog.ts @@ -97,9 +97,6 @@ export class MoreInfoDialog extends LitElement { @state() private _infoEditMode = false; - @query("ha-more-info-info, ha-more-info-history-and-logbook") - private _history?: MoreInfoInfo | MoreInfoHistoryAndLogbook; - @state() private _sensorNumericDeviceClasses?: string[] = []; public showDialog(params: MoreInfoDialogParams) {