From d817e92a576fef5440c6cb7edadc640c7687810d Mon Sep 17 00:00:00 2001 From: Raman Gupta <7243222+raman325@users.noreply.github.com> Date: Wed, 30 Aug 2023 09:52:11 -0400 Subject: [PATCH 01/13] Remove node status from zwave_js device info card (#17732) --- src/data/zwave_js.ts | 2 -- .../zwave_js/ha-device-info-zwave_js.ts | 28 ------------------- src/translations/en.json | 8 ------ 3 files changed, 38 deletions(-) diff --git a/src/data/zwave_js.ts b/src/data/zwave_js.ts index bb93308fd02f..623516ce5941 100644 --- a/src/data/zwave_js.ts +++ b/src/data/zwave_js.ts @@ -404,8 +404,6 @@ export interface RequestedGrant { clientSideAuth: boolean; } -export const nodeStatus = ["unknown", "asleep", "awake", "dead", "alive"]; - export const fetchZwaveNetworkStatus = ( hass: HomeAssistant, device_or_entry_id: { diff --git a/src/panels/config/devices/device-detail/integration-elements/zwave_js/ha-device-info-zwave_js.ts b/src/panels/config/devices/device-detail/integration-elements/zwave_js/ha-device-info-zwave_js.ts index 06e0cad8dc75..64d9d0145b42 100644 --- a/src/panels/config/devices/device-detail/integration-elements/zwave_js/ha-device-info-zwave_js.ts +++ b/src/panels/config/devices/device-detail/integration-elements/zwave_js/ha-device-info-zwave_js.ts @@ -1,4 +1,3 @@ -import { UnsubscribeFunc } from "home-assistant-js-websocket"; import { css, CSSResultGroup, @@ -16,9 +15,7 @@ import { import { DeviceRegistryEntry } from "../../../../../../data/device_registry"; import { fetchZwaveNodeStatus, - nodeStatus, SecurityClass, - subscribeZwaveNodeStatus, ZWaveJSNodeStatus, } from "../../../../../../data/zwave_js"; import { SubscribeMixin } from "../../../../../../mixins/subscribe-mixin"; @@ -44,21 +41,6 @@ export class HaDeviceInfoZWaveJS extends SubscribeMixin(LitElement) { } } - public hassSubscribe(): Array> { - return [ - subscribeZwaveNodeStatus(this.hass, this.device!.id, (message) => { - if (!this._node) { - return; - } - this._node = { - ...this._node, - status: message.status, - ready: message.ready, - }; - }), - ]; - } - protected async _fetchNodeDetails() { if (!this.device) { return; @@ -112,16 +94,6 @@ export class HaDeviceInfoZWaveJS extends SubscribeMixin(LitElement) { ${!this._node.is_controller_node ? html` -
- ${this.hass.localize( - "ui.panel.config.zwave_js.device_info.node_status" - )}: - ${this.hass.localize( - `ui.panel.config.zwave_js.node_status.${ - nodeStatus[this._node.status] - }` - )} -
${this.hass.localize( "ui.panel.config.zwave_js.device_info.node_ready" diff --git a/src/translations/en.json b/src/translations/en.json index 051837943bba..f1f5f7f1e8c4 100644 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -3960,7 +3960,6 @@ "device_info": { "zwave_info": "Z-Wave info", "node_id": "ID", - "node_status": "Status", "node_ready": "Ready", "device_config": "Configure", "reinterview_device": "Re-interview", @@ -4067,13 +4066,6 @@ "parameter": "Parameter", "bitmask": "Bitmask" }, - "node_status": { - "unknown": "Unknown", - "asleep": "Asleep", - "awake": "Awake", - "dead": "Dead", - "alive": "Alive" - }, "network_status": { "connected": "Connected", "connecting": "Connecting", From 63c3d6406d1ed363164ae8a2ae885fae19ff0c4b Mon Sep 17 00:00:00 2001 From: Simon Lamon <32477463+silamon@users.noreply.github.com> Date: Wed, 30 Aug 2023 18:24:31 +0200 Subject: [PATCH 02/13] Remove Polymer app layout (#17739) * Remove legacy app layout * Remove left over ha-app-layout import --- package.json | 1 - src/layouts/ha-app-layout.js | 103 ------------------------- src/panels/mailbox/ha-panel-mailbox.ts | 1 - yarn.lock | 32 -------- 4 files changed, 137 deletions(-) delete mode 100644 src/layouts/ha-app-layout.js diff --git a/package.json b/package.json index 8452d18e26bd..38d22cf82d29 100644 --- a/package.json +++ b/package.json @@ -82,7 +82,6 @@ "@material/web": "=1.0.0-pre.16", "@mdi/js": "7.2.96", "@mdi/svg": "7.2.96", - "@polymer/app-layout": "3.1.0", "@polymer/iron-flex-layout": "3.0.1", "@polymer/iron-input": "3.0.1", "@polymer/iron-resizable-behavior": "3.0.1", diff --git a/src/layouts/ha-app-layout.js b/src/layouts/ha-app-layout.js deleted file mode 100644 index b937574f3b0e..000000000000 --- a/src/layouts/ha-app-layout.js +++ /dev/null @@ -1,103 +0,0 @@ -/* eslint-plugin-disable lit */ -/** -@license -Copyright (c) 2015 The Polymer Project Authors. All rights reserved. -This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt -The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt -The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt -Code distributed by Google as part of the polymer project is also -subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt -*/ -/* -This code is copied from app-header-layout. -'fullbleed' support is removed as Home Assisstant doesn't use it. -transform: translate(0) is added. -*/ -/* - FIXME(polymer-modulizer): the above comments were extracted - from HTML and may be out of place here. Review them and - then delete this comment! -*/ -import "@polymer/app-layout/app-header-layout/app-header-layout"; -import { html } from "@polymer/polymer/lib/utils/html-tag"; -import "@polymer/polymer/polymer-element"; - -class HaAppLayout extends customElements.get("app-header-layout") { - static get template() { - return html` - - -
- - -
- -
- `; - } -} -customElements.define("ha-app-layout", HaAppLayout); diff --git a/src/panels/mailbox/ha-panel-mailbox.ts b/src/panels/mailbox/ha-panel-mailbox.ts index 0d0159902e07..04c155fde584 100644 --- a/src/panels/mailbox/ha-panel-mailbox.ts +++ b/src/panels/mailbox/ha-panel-mailbox.ts @@ -12,7 +12,6 @@ import { formatDateTime } from "../../common/datetime/format_date_time"; import "../../components/ha-card"; import "../../components/ha-menu-button"; import "../../components/ha-tabs"; -import "../../layouts/ha-app-layout"; import "@polymer/paper-item/paper-item"; import "@polymer/paper-item/paper-item-body"; import "@polymer/paper-tabs/paper-tab"; diff --git a/yarn.lock b/yarn.lock index 3452e955613d..7d662c6dbf01 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3418,19 +3418,6 @@ __metadata: languageName: node linkType: hard -"@polymer/app-layout@npm:3.1.0": - version: 3.1.0 - resolution: "@polymer/app-layout@npm:3.1.0" - dependencies: - "@polymer/iron-flex-layout": ^3.0.0-pre.26 - "@polymer/iron-media-query": ^3.0.0-pre.26 - "@polymer/iron-resizable-behavior": ^3.0.0-pre.26 - "@polymer/iron-scroll-target-behavior": ^3.0.0-pre.26 - "@polymer/polymer": ^3.0.0 - checksum: 0da7158de7a44db6f25482ef28a75a4a9372706b0d6a0d08f7b45eb4f75d60dd2e769275bf926f986588bc8273545b55f90a68429c6081cb5cb3f16b1e1f9746 - languageName: node - linkType: hard - "@polymer/font-roboto@npm:^3.0.1": version: 3.0.2 resolution: "@polymer/font-roboto@npm:3.0.2" @@ -3548,15 +3535,6 @@ __metadata: languageName: node linkType: hard -"@polymer/iron-media-query@npm:^3.0.0-pre.26": - version: 3.0.1 - resolution: "@polymer/iron-media-query@npm:3.0.1" - dependencies: - "@polymer/polymer": ^3.0.0 - checksum: 15d7c77608925adea02bf12af1f1eb7dd70abc3349bdff88906a3f0fa5bdfe41171bda1b346f9b7ccfd6de9550ac2a34278a74182ce1407097d3972c23984c5e - languageName: node - linkType: hard - "@polymer/iron-menu-behavior@npm:^3.0.0-pre.26": version: 3.0.2 resolution: "@polymer/iron-menu-behavior@npm:3.0.2" @@ -3608,15 +3586,6 @@ __metadata: languageName: node linkType: hard -"@polymer/iron-scroll-target-behavior@npm:^3.0.0-pre.26": - version: 3.0.1 - resolution: "@polymer/iron-scroll-target-behavior@npm:3.0.1" - dependencies: - "@polymer/polymer": ^3.0.0 - checksum: abf2864aee6049b336aa303110a65cd51cda75247b89edc4f21a6b5290062eb19cd8d2d125198354497df53368bbd305b30d9d31475fd327833cd549d83eb7b9 - languageName: node - linkType: hard - "@polymer/iron-selector@npm:^3.0.0-pre.26": version: 3.0.1 resolution: "@polymer/iron-selector@npm:3.0.1" @@ -9679,7 +9648,6 @@ __metadata: "@octokit/plugin-retry": 6.0.0 "@octokit/rest": 20.0.1 "@open-wc/dev-server-hmr": 0.1.4 - "@polymer/app-layout": 3.1.0 "@polymer/iron-flex-layout": 3.0.1 "@polymer/iron-input": 3.0.1 "@polymer/iron-resizable-behavior": 3.0.1 From cfb698d0a6a41e554cc33b432d2767ce66d17b5e Mon Sep 17 00:00:00 2001 From: karwosts <32912880+karwosts@users.noreply.github.com> Date: Thu, 31 Aug 2023 00:42:57 -0700 Subject: [PATCH 03/13] Fix more info weather forecast (#17747) --- src/dialogs/more-info/controls/more-info-weather.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/dialogs/more-info/controls/more-info-weather.ts b/src/dialogs/more-info/controls/more-info-weather.ts index f7afd6808692..123d3ca4de30 100644 --- a/src/dialogs/more-info/controls/more-info-weather.ts +++ b/src/dialogs/more-info/controls/more-info-weather.ts @@ -252,7 +252,8 @@ class MoreInfoWeather extends LitElement { ${this._showValue(item.templow) ? this.hass.formatEntityAttributeValue( this.stateObj!, - "templow" + "templow", + item.templow ) : hourly ? "" @@ -262,7 +263,8 @@ class MoreInfoWeather extends LitElement { ${this._showValue(item.temperature) ? this.hass.formatEntityAttributeValue( this.stateObj!, - "temperature" + "temperature", + item.temperature ) : "—"}
From dfbaee1649379a516f1bde3672a08d375c3a09ee Mon Sep 17 00:00:00 2001 From: Paul Bottein Date: Thu, 31 Aug 2023 11:02:04 +0200 Subject: [PATCH 04/13] Fix margin between buttons row and attributes in more info (#17738) --- src/components/ha-attributes.ts | 35 +++++++++++++++---- .../components/ha-more-info-control-style.ts | 4 +++ 2 files changed, 32 insertions(+), 7 deletions(-) diff --git a/src/components/ha-attributes.ts b/src/components/ha-attributes.ts index 80cc25031c88..ab277ed726aa 100644 --- a/src/components/ha-attributes.ts +++ b/src/components/ha-attributes.ts @@ -1,12 +1,19 @@ import { HassEntity } from "home-assistant-js-websocket"; -import { css, CSSResultGroup, html, LitElement, nothing } from "lit"; +import { + css, + CSSResultGroup, + html, + LitElement, + nothing, + PropertyValues, +} from "lit"; import { customElement, property, state } from "lit/decorators"; import { computeAttributeNameDisplay } from "../common/entity/compute_attribute_display"; import { STATE_ATTRIBUTES } from "../data/entity_attributes"; import { haStyle } from "../resources/styles"; import { HomeAssistant } from "../types"; -import "./ha-expansion-panel"; import "./ha-attribute-value"; +import "./ha-expansion-panel"; @customElement("ha-attributes") class HaAttributes extends LitElement { @@ -18,16 +25,30 @@ class HaAttributes extends LitElement { @state() private _expanded = false; + private get _filteredAttributes() { + return this.computeDisplayAttributes( + STATE_ATTRIBUTES.concat( + this.extraFilters ? this.extraFilters.split(",") : [] + ) + ); + } + + protected willUpdate(changedProperties: PropertyValues): void { + if ( + changedProperties.has("extraFilters") || + changedProperties.has("stateObj") + ) { + this.toggleAttribute("empty", this._filteredAttributes.length === 0); + } + } + protected render() { if (!this.stateObj) { return nothing; } - const attributes = this.computeDisplayAttributes( - STATE_ATTRIBUTES.concat( - this.extraFilters ? this.extraFilters.split(",") : [] - ) - ); + const attributes = this._filteredAttributes; + if (attributes.length === 0) { return nothing; } diff --git a/src/dialogs/more-info/components/ha-more-info-control-style.ts b/src/dialogs/more-info/components/ha-more-info-control-style.ts index 19d8ae47a2b8..5dd3dd966a06 100644 --- a/src/dialogs/more-info/components/ha-more-info-control-style.ts +++ b/src/dialogs/more-info/components/ha-more-info-control-style.ts @@ -34,6 +34,10 @@ export const moreInfoControlStyle = css` } ha-attributes { + display: block; width: 100%; } + ha-more-info-control-select-container + ha-attributes:not([empty]) { + margin-top: 16px; + } `; From fa788a8223e0997d9fe0f301939e1b7f8c46f9a1 Mon Sep 17 00:00:00 2001 From: Paul Bottein Date: Thu, 31 Aug 2023 13:00:58 +0200 Subject: [PATCH 05/13] Use heat or cool slider mode for auto if there is only one mode (#17748) --- .../ha-more-info-climate-temperature.ts | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/dialogs/more-info/components/climate/ha-more-info-climate-temperature.ts b/src/dialogs/more-info/components/climate/ha-more-info-climate-temperature.ts index 9207bda5e9d2..25a18f810d15 100644 --- a/src/dialogs/more-info/components/climate/ha-more-info-climate-temperature.ts +++ b/src/dialogs/more-info/components/climate/ha-more-info-climate-temperature.ts @@ -280,15 +280,21 @@ export class HaMoreInfoClimateTemperature extends LitElement { ); } - const activeModes = this.stateObj.attributes.hvac_modes.filter( - (m) => m !== "off" - ); - if ( supportsTargetTemperature && this._targetTemperature.value != null && this.stateObj.state !== UNAVAILABLE ) { + const heatCoolModes = this.stateObj.attributes.hvac_modes.filter((m) => + ["heat", "cool", "heat_cool"].includes(m) + ); + const sliderMode = + SLIDER_MODES[ + heatCoolModes.length === 1 && ["off", "auto"].includes(mode) + ? heatCoolModes[0] + : mode + ]; + return html`
Date: Thu, 31 Aug 2023 13:06:29 +0200 Subject: [PATCH 06/13] Fix more info translation keys (#17749) --- .../more-info/controls/more-info-climate.ts | 9 +++----- .../more-info/controls/more-info-fan.ts | 22 ++++++++++++++----- .../controls/more-info-water_heater.ts | 5 +---- .../hui-climate-hvac-modes-tile-feature.ts | 5 +---- ...ter-heater-operation-modes-tile-feature.ts | 5 +---- src/translations/en.json | 11 +++++----- 6 files changed, 28 insertions(+), 29 deletions(-) diff --git a/src/dialogs/more-info/controls/more-info-climate.ts b/src/dialogs/more-info/controls/more-info-climate.ts index 3e3d4b10a48f..c1e4cb0999ef 100644 --- a/src/dialogs/more-info/controls/more-info-climate.ts +++ b/src/dialogs/more-info/controls/more-info-climate.ts @@ -142,7 +142,7 @@ class MoreInfoClimate extends LitElement { .selected=${this._mainControl === "temperature"} .disabled=${this.stateObj!.state === UNAVAILABLE} .label=${this.hass.localize( - "ui.dialogs.more_info_control.light.color" + "ui.dialogs.more_info_control.climate.temperature" )} .control=${"temperature"} @click=${this._setMainControl} @@ -153,7 +153,7 @@ class MoreInfoClimate extends LitElement { .selected=${this._mainControl === "humidity"} .disabled=${this.stateObj!.state === UNAVAILABLE} .label=${this.hass.localize( - "ui.dialogs.more_info_control.light.color_temp" + "ui.dialogs.more_info_control.climate.humidity" )} .control=${"humidity"} @click=${this._setMainControl} @@ -166,10 +166,7 @@ class MoreInfoClimate extends LitElement {
- + - ${this.hass.localize("state.default.on")} + ${this.hass.formatEntityAttributeValue( + this.stateObj, + "oscillating", + true + )} - + - ${this.hass.localize("state.default.off")} + ${this.hass.formatEntityAttributeValue( + this.stateObj, + "oscillating", + false + )} ` diff --git a/src/dialogs/more-info/controls/more-info-water_heater.ts b/src/dialogs/more-info/controls/more-info-water_heater.ts index 1e59453b45bc..d34de2195b91 100644 --- a/src/dialogs/more-info/controls/more-info-water_heater.ts +++ b/src/dialogs/more-info/controls/more-info-water_heater.ts @@ -73,10 +73,7 @@ class MoreInfoWaterHeater extends LitElement { ${supportOperationMode && stateObj.attributes.operation_list ? html` Date: Thu, 31 Aug 2023 14:19:40 +0200 Subject: [PATCH 07/13] Use entity translation for away mode (#17750) * Use entity translation for away mode * Remove keys --- .../more-info/controls/more-info-water_heater.ts | 12 ++++++++++-- src/translations/en.json | 2 -- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/dialogs/more-info/controls/more-info-water_heater.ts b/src/dialogs/more-info/controls/more-info-water_heater.ts index d34de2195b91..99269b6e2c4b 100644 --- a/src/dialogs/more-info/controls/more-info-water_heater.ts +++ b/src/dialogs/more-info/controls/more-info-water_heater.ts @@ -119,11 +119,19 @@ class MoreInfoWaterHeater extends LitElement { slot="graphic" .path=${mdiAccountArrowRight} > - ${this.hass.localize("state.default.on")} + ${this.hass.formatEntityAttributeValue( + stateObj, + "away_mode", + "on" + )} - ${this.hass.localize("state.default.off")} + ${this.hass.formatEntityAttributeValue( + stateObj, + "away_mode", + "off" + )} ` diff --git a/src/translations/en.json b/src/translations/en.json index 216a55763677..0a8d9c6ed777 100644 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -15,8 +15,6 @@ }, "state": { "default": { - "on": "On", - "off": "Off", "unknown": "Unknown", "unavailable": "Unavailable" } From c3a36efaa44f095702ec9840291b304db6a8c12f Mon Sep 17 00:00:00 2001 From: Bram Kragten Date: Thu, 31 Aug 2023 14:20:57 +0200 Subject: [PATCH 08/13] Fix device energy graphs (#17754) --- .../lovelace/cards/energy/hui-energy-devices-graph-card.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/panels/lovelace/cards/energy/hui-energy-devices-graph-card.ts b/src/panels/lovelace/cards/energy/hui-energy-devices-graph-card.ts index 96f69ed914c8..9e99c11ca75c 100644 --- a/src/panels/lovelace/cards/energy/hui-energy-devices-graph-card.ts +++ b/src/panels/lovelace/cards/energy/hui-energy-devices-graph-card.ts @@ -130,7 +130,7 @@ export class HuiEnergyDevicesGraphCard }, }, }, - elements: { bar: { borderWidth: 1.5, borderRadius: 4 } }, + elements: { bar: { borderWidth: 1, borderRadius: 4 } }, plugins: { tooltip: { mode: "nearest", @@ -292,6 +292,7 @@ export class HuiEnergyDevicesGraphCard }); this._chartData = { + labels: chartData.map((d) => d.y), datasets, }; await this.updateComplete; From 38b275f7f970d8b4ea51a0d1cc816e7a37c6c003 Mon Sep 17 00:00:00 2001 From: Bram Kragten Date: Thu, 31 Aug 2023 14:21:35 +0200 Subject: [PATCH 09/13] Dont resize chart-timeline (#17751) --- src/components/chart/state-history-charts.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/chart/state-history-charts.ts b/src/components/chart/state-history-charts.ts index b1debf78702d..d9dd0d983e21 100644 --- a/src/components/chart/state-history-charts.ts +++ b/src/components/chart/state-history-charts.ts @@ -84,8 +84,8 @@ export class StateHistoryCharts extends LitElement { // @ts-ignore @restoreScroll(".container") private _savedScrollPos?: number; - @queryAll("state-history-chart-line, state-history-chart-timeline") - private _charts?: StateHistoryChartLine[] | StateHistoryChartTimeline[]; + @queryAll("state-history-chart-line") + private _charts?: StateHistoryChartLine[]; public resize = (options?: ChartResizeOptions): void => { this._charts?.forEach( From f3ed0160af785d6ef320abb2ad50c4da6193ef4e Mon Sep 17 00:00:00 2001 From: Bram Kragten Date: Thu, 31 Aug 2023 14:22:39 +0200 Subject: [PATCH 10/13] Fix tooltip error for climate charts (#17752) --- src/components/chart/state-history-chart-line.ts | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/components/chart/state-history-chart-line.ts b/src/components/chart/state-history-chart-line.ts index 3474c1eb5b8b..46243893a396 100644 --- a/src/components/chart/state-history-chart-line.ts +++ b/src/components/chart/state-history-chart-line.ts @@ -137,12 +137,16 @@ export class StateHistoryChartLine extends LitElement { `${context.dataset.label}: ${formatNumber( context.parsed.y, this.hass.locale, - getNumberFormatOptions( - this.hass.states[this.data[context.datasetIndex].entity_id], - this.hass.entities[ - this.data[context.datasetIndex].entity_id - ] - ) + this.data[context.datasetIndex]?.entity_id + ? getNumberFormatOptions( + this.hass.states[ + this.data[context.datasetIndex].entity_id + ], + this.hass.entities[ + this.data[context.datasetIndex].entity_id + ] + ) + : undefined )} ${this.unit}`, }, }, From 93846a28670fa76054e5ff6731e951d37ffeaf8b Mon Sep 17 00:00:00 2001 From: Bram Kragten Date: Thu, 31 Aug 2023 14:23:33 +0200 Subject: [PATCH 11/13] Fix unit and currency, always select first result of search (#17753) * Fix unit and currency, always select first result of search * Update onboarding-location.ts --- src/onboarding/onboarding-core-config.ts | 8 ++++---- src/onboarding/onboarding-location.ts | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/onboarding/onboarding-core-config.ts b/src/onboarding/onboarding-core-config.ts index 6306e8ba64b1..efbaacc5d217 100644 --- a/src/onboarding/onboarding-core-config.ts +++ b/src/onboarding/onboarding-core-config.ts @@ -32,10 +32,6 @@ class OnboardingCoreConfig extends LitElement { private _elevation = "0"; - private _unitSystem: ConfigUpdateValues["unit_system"] = "metric"; - - private _currency: ConfigUpdateValues["currency"] = "EUR"; - private _timeZone: ConfigUpdateValues["time_zone"] = Intl.DateTimeFormat?.().resolvedOptions?.().timeZone; @@ -43,6 +39,10 @@ class OnboardingCoreConfig extends LitElement { @state() private _country?: ConfigUpdateValues["country"]; + private _unitSystem?: ConfigUpdateValues["unit_system"]; + + private _currency?: ConfigUpdateValues["currency"]; + @state() private _error?: string; @state() private _skipCore = false; diff --git a/src/onboarding/onboarding-location.ts b/src/onboarding/onboarding-location.ts index b4b3209a9f22..fa5fb385ad3c 100644 --- a/src/onboarding/onboarding-location.ts +++ b/src/onboarding/onboarding-location.ts @@ -336,7 +336,7 @@ class OnboardingLocation extends LitElement { ); try { this._places = await searchPlaces(address, this.hass, true, 3); - if (this._places?.length === 1) { + if (this._places?.length) { this._highlightedMarker = this._places[0].place_id; this._location = [ Number(this._places[0].lat), From 1825749036cdf4cbe64d8fa580d3871134997ac9 Mon Sep 17 00:00:00 2001 From: Bram Kragten Date: Thu, 31 Aug 2023 14:32:30 +0200 Subject: [PATCH 12/13] Get forecasts from large to small (#17755) --- src/data/weather.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/data/weather.ts b/src/data/weather.ts index 4efa71b0c7f7..9e66ada7f34e 100644 --- a/src/data/weather.ts +++ b/src/data/weather.ts @@ -649,11 +649,11 @@ export const getDefaultForecastType = (stateObj: HassEntityBase) => { if (supportsFeature(stateObj, WeatherEntityFeature.FORECAST_DAILY)) { return "daily"; } - if (supportsFeature(stateObj, WeatherEntityFeature.FORECAST_HOURLY)) { - return "hourly"; - } if (supportsFeature(stateObj, WeatherEntityFeature.FORECAST_TWICE_DAILY)) { return "twice_daily"; } + if (supportsFeature(stateObj, WeatherEntityFeature.FORECAST_HOURLY)) { + return "hourly"; + } return undefined; }; From 9c60a047c13b409b8c7e626ba58e0110640ea6da Mon Sep 17 00:00:00 2001 From: Bram Kragten Date: Thu, 31 Aug 2023 14:33:00 +0200 Subject: [PATCH 13/13] Bumped version to 20230831.0 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 811c039f25f7..72d455d5d14d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "home-assistant-frontend" -version = "20230830.0" +version = "20230831.0" license = {text = "Apache-2.0"} description = "The Home Assistant frontend" readme = "README.md"