Add message when no preferred network (#15514)

This commit is contained in:
Bram Kragten 2023-02-20 20:45:02 +01:00 committed by GitHub
parent fbf084bf00
commit 74bc6eeda8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 23 additions and 7 deletions

View File

@ -48,16 +48,30 @@ export class ThreadConfigPanel extends SubscribeMixin(LitElement) {
slot="trigger" slot="trigger"
></ha-icon-button> ></ha-icon-button>
<mwc-list-item @click=${this._addOTBR} <mwc-list-item @click=${this._addOTBR}
>Add border router</mwc-list-item >${this.hass.localize(
"ui.panel.config.thread.add_open_thread_border_router"
)}</mwc-list-item
> >
</ha-button-menu> </ha-button-menu>
<div class="content"> <div class="content">
<h1>${this.hass.localize("ui.panel.config.thread.my_network")}</h1>
${networks.preferred ${networks.preferred
? html`<h1> ? this._renderNetwork(networks.preferred)
${this.hass.localize("ui.panel.config.thread.my_network")} : html`<ha-card>
</h1> <div class="card-content no-routers">
${this._renderNetwork(networks.preferred)}` <h3>
: ""} ${this.hass.localize(
"ui.panel.config.thread.no_preferred_network"
)}
</h3>
<ha-svg-icon .path=${mdiDevices}></ha-svg-icon>
<mwc-button @click=${this._addOTBR}
>${this.hass.localize(
"ui.panel.config.thread.add_open_thread_border_router"
)}</mwc-button
>
</div>
</ha-card>`}
${networks.networks.length ${networks.networks.length
? html`<h3> ? html`<h3>
${this.hass.localize("ui.panel.config.thread.other_networks")} ${this.hass.localize("ui.panel.config.thread.other_networks")}
@ -231,7 +245,7 @@ export class ThreadConfigPanel extends SubscribeMixin(LitElement) {
margin: 0 auto; margin: 0 auto;
direction: ltr; direction: ltr;
} }
routers { .routers {
padding-bottom: 0; padding-bottom: 0;
} }
.no-routers { .no-routers {

View File

@ -3268,6 +3268,8 @@
"thread": { "thread": {
"other_networks": "Other networks", "other_networks": "Other networks",
"my_network": "My network", "my_network": "My network",
"no_preferred_network": "You don't have a preferred network yet.",
"add_open_thread_border_router": "Add an OpenTread border router",
"no_border_routers": "No border routers found", "no_border_routers": "No border routers found",
"border_routers": "{count} border {count, plural,\n one {router}\n other {routers}\n}", "border_routers": "{count} border {count, plural,\n one {router}\n other {routers}\n}",
"managed_by_home_assistant": "Managed by Home Assistant", "managed_by_home_assistant": "Managed by Home Assistant",