From 5e2fcf928c85ec8bcfffe315018696b219a17e38 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Fri, 18 Feb 2022 10:50:01 -0800 Subject: [PATCH 1/4] Bumped version to 20220203.1 --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index 587f449468..96130d2df7 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = home-assistant-frontend -version = 20220203.0 +version = 20220203.1 author = The Home Assistant Authors author_email = hello@home-assistant.io license = Apache-2.0 From f37a5fa0210f111bbc7d0ac053d3aa1fd13b8870 Mon Sep 17 00:00:00 2001 From: lintaba Date: Sat, 12 Feb 2022 23:00:50 +0100 Subject: [PATCH 2/4] hotfix history view on missing state (#11663) Co-authored-by: Paulus Schoutsen --- src/common/entity/compute_state_display.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/common/entity/compute_state_display.ts b/src/common/entity/compute_state_display.ts index f8bf892d8a..7c6955e084 100644 --- a/src/common/entity/compute_state_display.ts +++ b/src/common/entity/compute_state_display.ts @@ -19,6 +19,9 @@ export const computeStateDisplay = ( if (compareState === UNKNOWN || compareState === UNAVAILABLE) { return localize(`state.default.${compareState}`); } + if (compareState === "") { + return localize(`state.default.${UNKNOWN}`); + } // Entities with a `unit_of_measurement` or `state_class` are numeric values and should use `formatNumber` if (isNumericState(stateObj)) { @@ -123,7 +126,11 @@ export const computeStateDisplay = ( domain === "scene" || (domain === "sensor" && stateObj.attributes.device_class === "timestamp") ) { - return formatDateTime(new Date(compareState), locale); + try { + return formatDateTime(new Date(compareState), locale); + } catch (_err) { + return compareState; + } } return ( From dfbf7fb436837c8d370c46450f65df34eb7d1214 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Sun, 13 Feb 2022 11:26:12 -0800 Subject: [PATCH 3/4] Revert compute state display show empty string as unknown (#11677) --- src/common/entity/compute_state_display.ts | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/common/entity/compute_state_display.ts b/src/common/entity/compute_state_display.ts index 7c6955e084..3838218ea4 100644 --- a/src/common/entity/compute_state_display.ts +++ b/src/common/entity/compute_state_display.ts @@ -19,9 +19,6 @@ export const computeStateDisplay = ( if (compareState === UNKNOWN || compareState === UNAVAILABLE) { return localize(`state.default.${compareState}`); } - if (compareState === "") { - return localize(`state.default.${UNKNOWN}`); - } // Entities with a `unit_of_measurement` or `state_class` are numeric values and should use `formatNumber` if (isNumericState(stateObj)) { From 79e1e195a0fa50cd0844406bcbf7892a758fa2f6 Mon Sep 17 00:00:00 2001 From: Bram Kragten Date: Thu, 10 Feb 2022 00:15:00 +0100 Subject: [PATCH 4/4] Fix service control for older browsers (#11629) --- src/components/ha-service-control.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/ha-service-control.ts b/src/components/ha-service-control.ts index 7783544cc4..87b27a36f8 100644 --- a/src/components/ha-service-control.ts +++ b/src/components/ha-service-control.ts @@ -135,7 +135,9 @@ export class HaServiceControl extends LitElement { let updatedDefaultValue = false; if (this._value && serviceData) { // Set mandatory bools without a default value to false - this._value.data ??= {}; + if (!this._value.data) { + this._value.data = {}; + } serviceData.fields.forEach((field) => { if ( field.selector &&