mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-27 03:06:41 +00:00
Show error if no OZW instances are detected (#7176)
This commit is contained in:
parent
0f59496778
commit
cd32ef60da
@ -28,6 +28,8 @@ import type { PageNavigation } from "../../../../../layouts/hass-tabs-subpage";
|
|||||||
import { haStyle } from "../../../../../resources/styles";
|
import { haStyle } from "../../../../../resources/styles";
|
||||||
import type { HomeAssistant, Route } from "../../../../../types";
|
import type { HomeAssistant, Route } from "../../../../../types";
|
||||||
import "../../../ha-config-section";
|
import "../../../ha-config-section";
|
||||||
|
import "../../../../../layouts/hass-error-screen";
|
||||||
|
import "../../../../../layouts/hass-loading-screen";
|
||||||
|
|
||||||
export const ozwTabs: PageNavigation[] = [];
|
export const ozwTabs: PageNavigation[] = [];
|
||||||
|
|
||||||
@ -43,13 +45,25 @@ class OZWConfigDashboard extends LitElement {
|
|||||||
|
|
||||||
@property() public configEntryId?: string;
|
@property() public configEntryId?: string;
|
||||||
|
|
||||||
@internalProperty() private _instances: OZWInstance[] = [];
|
@internalProperty() private _instances?: OZWInstance[];
|
||||||
|
|
||||||
protected firstUpdated() {
|
protected firstUpdated() {
|
||||||
this._fetchData();
|
this._fetchData();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected render(): TemplateResult {
|
protected render(): TemplateResult {
|
||||||
|
if (!this._instances) {
|
||||||
|
return html`<hass-loading-screen></hass-loading-screen>`;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this._instances.length === 0) {
|
||||||
|
return html`<hass-error-screen
|
||||||
|
.error="${this.hass.localize(
|
||||||
|
"ui.panel.config.ozw.select_instance.none_found"
|
||||||
|
)}"
|
||||||
|
></hass-error-screen>`;
|
||||||
|
}
|
||||||
|
|
||||||
return html`
|
return html`
|
||||||
<hass-tabs-subpage
|
<hass-tabs-subpage
|
||||||
.hass=${this.hass}
|
.hass=${this.hass}
|
||||||
|
@ -1894,7 +1894,8 @@
|
|||||||
},
|
},
|
||||||
"select_instance": {
|
"select_instance": {
|
||||||
"header": "Select an OpenZWave Instance",
|
"header": "Select an OpenZWave Instance",
|
||||||
"introduction": "You have more than one OpenZWave instance running. Which instance would you like to manage?"
|
"introduction": "You have more than one OpenZWave instance running. Which instance would you like to manage?",
|
||||||
|
"none_found": "We couldn't find an OpenZWave instance. If you believe this is incorrect, check your OpenZWave and MQTT setups and ensure that Home Assistant can communicate with your MQTT broker."
|
||||||
},
|
},
|
||||||
"network": {
|
"network": {
|
||||||
"header": "Network Management",
|
"header": "Network Management",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user