Hide rpi_power entry during onboarding (#7001)

Co-authored-by: Bram Kragten <mail@bramkragten.nl>
This commit is contained in:
Martin Hjelmare 2020-09-28 23:23:52 +02:00 committed by GitHub
parent 50e03d41ab
commit 6b77f08d86
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -29,6 +29,8 @@ import { HomeAssistant } from "../types";
import "./action-badge"; import "./action-badge";
import "./integration-badge"; import "./integration-badge";
const HIDDEN_DOMAINS = new Set(["met", "rpi_power"]);
@customElement("onboarding-integrations") @customElement("onboarding-integrations")
class OnboardingIntegrations extends LitElement { class OnboardingIntegrations extends LitElement {
@property({ attribute: false }) public hass!: HomeAssistant; @property({ attribute: false }) public hass!: HomeAssistant;
@ -161,10 +163,12 @@ class OnboardingIntegrations extends LitElement {
private async _loadConfigEntries() { private async _loadConfigEntries() {
const entries = await getConfigEntries(this.hass!); 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_power.
// It is one that we create automatically and it will confuse the user // It is one that we create automatically and it will confuse the user
// if it starts showing up during onboarding. // if it starts showing up during onboarding.
this._entries = entries.filter((entry) => entry.domain !== "met"); this._entries = entries.filter(
(entry) => !HIDDEN_DOMAINS.has(entry.domain)
);
} }
private async _finish() { private async _finish() {