From cd32ef60da4b6fad04940a207af4f3317e314f1c Mon Sep 17 00:00:00 2001 From: Charles Garwood Date: Wed, 30 Sep 2020 17:09:48 -0400 Subject: [PATCH] Show error if no OZW instances are detected (#7176) --- .../ozw/ozw-config-dashboard.ts | 16 +++++++++++++++- src/translations/en.json | 3 ++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/src/panels/config/integrations/integration-panels/ozw/ozw-config-dashboard.ts b/src/panels/config/integrations/integration-panels/ozw/ozw-config-dashboard.ts index 478ede0f8e..ee05890a37 100644 --- a/src/panels/config/integrations/integration-panels/ozw/ozw-config-dashboard.ts +++ b/src/panels/config/integrations/integration-panels/ozw/ozw-config-dashboard.ts @@ -28,6 +28,8 @@ import type { PageNavigation } from "../../../../../layouts/hass-tabs-subpage"; import { haStyle } from "../../../../../resources/styles"; import type { HomeAssistant, Route } from "../../../../../types"; import "../../../ha-config-section"; +import "../../../../../layouts/hass-error-screen"; +import "../../../../../layouts/hass-loading-screen"; export const ozwTabs: PageNavigation[] = []; @@ -43,13 +45,25 @@ class OZWConfigDashboard extends LitElement { @property() public configEntryId?: string; - @internalProperty() private _instances: OZWInstance[] = []; + @internalProperty() private _instances?: OZWInstance[]; protected firstUpdated() { this._fetchData(); } protected render(): TemplateResult { + if (!this._instances) { + return html``; + } + + if (this._instances.length === 0) { + return html``; + } + return html`