diff --git a/pyproject.toml b/pyproject.toml index 0de1e8d8da..7ece90691f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "home-assistant-frontend" -version = "20220531.0" +version = "20220601.0" license = {text = "Apache-2.0"} description = "The Home Assistant frontend" readme = "README.md" diff --git a/src/components/chart/state-history-chart-timeline.ts b/src/components/chart/state-history-chart-timeline.ts index 00f7f5cadc..519ae60b5b 100644 --- a/src/components/chart/state-history-chart-timeline.ts +++ b/src/components/chart/state-history-chart-timeline.ts @@ -93,7 +93,7 @@ export class StateHistoryChartTimeline extends LitElement { @property({ type: Boolean }) public isSingleDevice = false; - @property({ type: Boolean }) public dataHasMultipleRows = false; + @property({ type: Boolean }) public chunked = false; @property({ attribute: false }) public startTime!: Date; @@ -117,7 +117,6 @@ export class StateHistoryChartTimeline extends LitElement { public willUpdate(changedProps: PropertyValues) { if (!this.hasUpdated) { const narrow = this.narrow; - const multipleRows = this.data.length !== 1 || this.dataHasMultipleRows; this._chartOptions = { maintainAspectRatio: false, parsing: false, @@ -163,13 +162,14 @@ export class StateHistoryChartTimeline extends LitElement { drawTicks: false, }, ticks: { - display: multipleRows, + display: + this.chunked || !this.isSingleDevice || this.data.length !== 1, }, afterSetDimensions: (y) => { y.maxWidth = y.chart.width * 0.18; }, - afterFit: function (scaleInstance) { - if (multipleRows) { + afterFit: (scaleInstance) => { + if (this.chunked) { // ensure all the chart labels are the same width scaleInstance.width = narrow ? 105 : 185; } diff --git a/src/components/chart/state-history-charts.ts b/src/components/chart/state-history-charts.ts index 58cb0b321d..b00fb19cdf 100644 --- a/src/components/chart/state-history-charts.ts +++ b/src/components/chart/state-history-charts.ts @@ -62,19 +62,19 @@ class StateHistoryCharts extends LitElement { @eventOptions({ passive: true }) protected render(): TemplateResult { if (!isComponentLoaded(this.hass, "history")) { - return html`