Hide network config when not loaded (#9265)

This commit is contained in:
Bram Kragten 2021-05-26 16:53:54 +02:00 committed by GitHub
parent b0e1f0f73a
commit 8291a84e3e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -30,20 +30,17 @@ class ConfigNetwork extends LitElement {
@state() private _error?: string;
protected render(): TemplateResult {
if (!this.hass.userData?.showAdvanced) {
if (
!this.hass.userData?.showAdvanced ||
!isComponentLoaded(this.hass, "network")
) {
return html``;
}
const error = this._error
? this._error
: !isComponentLoaded(this.hass, "network")
? "Network integration not loaded"
: undefined;
return html`
<ha-card header="Network">
<div class="card-content">
${error ? html`<div class="error">${error}</div>` : ""}
${this._error ? html`<div class="error">${this._error}</div>` : ""}
<p>
Configure which network adapters integrations will use. Currently
this setting only affects multicast traffic. A restart is required