From 4f2cba6447aa075bc164cc7a334c355f11463598 Mon Sep 17 00:00:00 2001 From: Martin Hjelmare Date: Mon, 14 Sep 2020 20:03:32 +0200 Subject: [PATCH 1/5] Hide rpi_power entry during onboarding --- src/onboarding/onboarding-integrations.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/onboarding/onboarding-integrations.ts b/src/onboarding/onboarding-integrations.ts index e2ac111b9fff..210738340ba8 100644 --- a/src/onboarding/onboarding-integrations.ts +++ b/src/onboarding/onboarding-integrations.ts @@ -164,7 +164,9 @@ class OnboardingIntegrations extends LitElement { // We filter out the config entry for the local weather. // It is one that we create automatically and it will confuse the user // if it starts showing up during onboarding. - this._entries = entries.filter((entry) => entry.domain !== "met"); + this._entries = entries.filter( + (entry) => entry.domain !== "met" && entry.domain !== "rpi_power" + ); } private async _finish() { From 66effae2ab2534b408a7a1e2f9b2c60062acd21d Mon Sep 17 00:00:00 2001 From: Martin Hjelmare Date: Mon, 14 Sep 2020 20:09:47 +0200 Subject: [PATCH 2/5] Extend comment --- src/onboarding/onboarding-integrations.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/onboarding/onboarding-integrations.ts b/src/onboarding/onboarding-integrations.ts index 210738340ba8..dadcfef9dcf8 100644 --- a/src/onboarding/onboarding-integrations.ts +++ b/src/onboarding/onboarding-integrations.ts @@ -161,7 +161,7 @@ class OnboardingIntegrations extends LitElement { private async _loadConfigEntries() { const entries = await getConfigEntries(this.hass!); - // We filter out the config entry for the local weather. + // We filter out the config entry for the local weather and rpi_powerEx. // It is one that we create automatically and it will confuse the user // if it starts showing up during onboarding. this._entries = entries.filter( From ca7248fda95686fa116c1c5085211c51a52ae6e7 Mon Sep 17 00:00:00 2001 From: Martin Hjelmare Date: Mon, 14 Sep 2020 20:10:18 +0200 Subject: [PATCH 3/5] Fix typo --- src/onboarding/onboarding-integrations.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/onboarding/onboarding-integrations.ts b/src/onboarding/onboarding-integrations.ts index dadcfef9dcf8..ce1acae20ea8 100644 --- a/src/onboarding/onboarding-integrations.ts +++ b/src/onboarding/onboarding-integrations.ts @@ -161,7 +161,7 @@ class OnboardingIntegrations extends LitElement { private async _loadConfigEntries() { const entries = await getConfigEntries(this.hass!); - // We filter out the config entry for the local weather and rpi_powerEx. + // We filter out the config entry for the local weather and rpi_power. // It is one that we create automatically and it will confuse the user // if it starts showing up during onboarding. this._entries = entries.filter( From 48b2484be99d2162c9793b597b82f64ab65a7d25 Mon Sep 17 00:00:00 2001 From: Martin Hjelmare Date: Tue, 15 Sep 2020 09:40:34 +0200 Subject: [PATCH 4/5] Use constant Co-authored-by: Bram Kragten --- src/onboarding/onboarding-integrations.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/onboarding/onboarding-integrations.ts b/src/onboarding/onboarding-integrations.ts index ce1acae20ea8..68cd3d20ae09 100644 --- a/src/onboarding/onboarding-integrations.ts +++ b/src/onboarding/onboarding-integrations.ts @@ -164,8 +164,9 @@ class OnboardingIntegrations extends LitElement { // We filter out the config entry for the local weather and rpi_power. // It is one that we create automatically and it will confuse the user // if it starts showing up during onboarding. + const HIDDEN_DOMAINS = new Set(["met", "rpi_power"]); this._entries = entries.filter( - (entry) => entry.domain !== "met" && entry.domain !== "rpi_power" + (entry) => !HIDDEN_DOMAINS.has(entry.domain) ); } From 9b15c84e66a05329f4a8aa5b9381d1970b85e02b Mon Sep 17 00:00:00 2001 From: Martin Hjelmare Date: Tue, 15 Sep 2020 09:41:29 +0200 Subject: [PATCH 5/5] Move constant up --- src/onboarding/onboarding-integrations.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/onboarding/onboarding-integrations.ts b/src/onboarding/onboarding-integrations.ts index 68cd3d20ae09..9dede29393de 100644 --- a/src/onboarding/onboarding-integrations.ts +++ b/src/onboarding/onboarding-integrations.ts @@ -29,6 +29,8 @@ import { HomeAssistant } from "../types"; import "./action-badge"; import "./integration-badge"; +const HIDDEN_DOMAINS = new Set(["met", "rpi_power"]); + @customElement("onboarding-integrations") class OnboardingIntegrations extends LitElement { @property({ attribute: false }) public hass!: HomeAssistant; @@ -164,7 +166,6 @@ class OnboardingIntegrations extends LitElement { // We filter out the config entry for the local weather and rpi_power. // It is one that we create automatically and it will confuse the user // if it starts showing up during onboarding. - const HIDDEN_DOMAINS = new Set(["met", "rpi_power"]); this._entries = entries.filter( (entry) => !HIDDEN_DOMAINS.has(entry.domain) );