From 1dd3e2a83b99722fdbcf72b22a139d66c2790a26 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Tue, 3 Aug 2021 15:15:21 -0700 Subject: [PATCH 1/5] 20210803.2 (#9704) * Add energy distribution card to arsaboo demo (#9702) * Add energy distribution card to arsaboo demo * Make link dashboard conform * Bumped version to 20210803.2 --- demo/src/configs/arsaboo/lovelace.ts | 5 +++++ setup.py | 2 +- .../lovelace/cards/energy/hui-energy-distribution-card.ts | 2 +- src/panels/lovelace/cards/types.ts | 2 +- src/panels/lovelace/common/generate-lovelace-config.ts | 2 +- 5 files changed, 9 insertions(+), 4 deletions(-) diff --git a/demo/src/configs/arsaboo/lovelace.ts b/demo/src/configs/arsaboo/lovelace.ts index 5d3107dfdd..e6195d20f4 100644 --- a/demo/src/configs/arsaboo/lovelace.ts +++ b/demo/src/configs/arsaboo/lovelace.ts @@ -29,6 +29,11 @@ export const demoLovelaceArsaboo: DemoConfig["lovelace"] = (localize) => ({ }, ], }, + { + title: "Energy distribution today", + type: "energy-distribution", + link_dashboard: true, + }, { type: "thermostat", entity: "climate.upstairs", diff --git a/setup.py b/setup.py index 9c988b0d73..b9a780aa48 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ from setuptools import setup, find_packages setup( name="home-assistant-frontend", - version="20210803.1", + version="20210803.2", description="The Home Assistant frontend", url="https://github.com/home-assistant/frontend", author="The Home Assistant Authors", diff --git a/src/panels/lovelace/cards/energy/hui-energy-distribution-card.ts b/src/panels/lovelace/cards/energy/hui-energy-distribution-card.ts index 6e233c50f7..78b13d914c 100644 --- a/src/panels/lovelace/cards/energy/hui-energy-distribution-card.ts +++ b/src/panels/lovelace/cards/energy/hui-energy-distribution-card.ts @@ -402,7 +402,7 @@ class HuiEnergyDistrubutionCard - ${this._config.linkDashboard + ${this._config.link_dashboard ? html`
Date: Wed, 4 Aug 2021 00:16:08 +0200 Subject: [PATCH 2/5] Add support for statistics card to demo (#9703) --- demo/src/stubs/history.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/demo/src/stubs/history.ts b/demo/src/stubs/history.ts index f5000a70a3..342b6cc4f0 100644 --- a/demo/src/stubs/history.ts +++ b/demo/src/stubs/history.ts @@ -85,8 +85,8 @@ const generateMeanStatistics = ( statistic_id: id, start: currentDate.toISOString(), mean, - min: mean, - max: mean, + min: mean - Math.random() * maxDiff, + max: mean + Math.random() * maxDiff, last_reset: "1970-01-01T00:00:00+00:00", state: mean, sum: null, @@ -340,11 +340,12 @@ export const mockHistory = (mockHass: MockHomeAssistant) => { return results; } ); + mockHass.mockWS("history/list_statistic_ids", () => []); mockHass.mockWS( "history/statistics_during_period", ({ statistic_ids, start_time, end_time }, hass) => { const start = new Date(start_time); - const end = new Date(end_time); + const end = end_time ? new Date(end_time) : new Date(); const statistics: Record = {}; From 5a0f13c4855788abb8cd1ba56c58c7b382d54a32 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Tue, 3 Aug 2021 21:55:15 -0700 Subject: [PATCH 3/5] Specify YARN version on netlify (#9705) --- netlify.toml | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 netlify.toml diff --git a/netlify.toml b/netlify.toml new file mode 100644 index 0000000000..fbd2ea0764 --- /dev/null +++ b/netlify.toml @@ -0,0 +1,2 @@ +[build.environment] + YARN_VERSION = "1.22.11" From fdb10515c38bfa4018dbf19f706afcf8d0b6d450 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Tue, 3 Aug 2021 22:00:13 -0700 Subject: [PATCH 4/5] SET NODE_OPTIONS --- netlify.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/netlify.toml b/netlify.toml index fbd2ea0764..6bd9b585cd 100644 --- a/netlify.toml +++ b/netlify.toml @@ -1,2 +1,3 @@ [build.environment] YARN_VERSION = "1.22.11" + NODE_OPTIONS: --max_old_space_size=4096 From 6d7c5584828d278d85c90ab1a725111055c7f626 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Tue, 3 Aug 2021 22:02:38 -0700 Subject: [PATCH 5/5] TOML --- netlify.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/netlify.toml b/netlify.toml index 6bd9b585cd..548eb2f450 100644 --- a/netlify.toml +++ b/netlify.toml @@ -1,3 +1,3 @@ [build.environment] YARN_VERSION = "1.22.11" - NODE_OPTIONS: --max_old_space_size=4096 + NODE_OPTIONS = "--max_old_space_size=4096"