diff --git a/src/panels/config/integrations/integration-panels/thread/thread-config-panel.ts b/src/panels/config/integrations/integration-panels/thread/thread-config-panel.ts index a1300f813c..8faae7bc79 100644 --- a/src/panels/config/integrations/integration-panels/thread/thread-config-panel.ts +++ b/src/panels/config/integrations/integration-panels/thread/thread-config-panel.ts @@ -164,102 +164,95 @@ export class ThreadConfigPanel extends SubscribeMixin(LitElement) { })} - ${network.routers.map( - (router) => - html` - ${router.brand} - ${router.model_name || - router.server?.replace(".local.", "") || - ""} - ${router.server} - ${(network.dataset && router.border_agent_id) || - router.extended_address === this._otbrInfo?.extended_address - ? html`${network.dataset && - router.border_agent_id === - network.dataset.preferred_border_agent_id - ? html` - ${this.hass.localize( - "ui.panel.config.thread.default_router" - )} - ` - : ""} - - { + const showOverflow = + ("dataset" in network && router.border_agent_id) || + router.extended_address === this._otbrInfo?.extended_address; + return html` + ${router.brand} + ${router.model_name || + router.server?.replace(".local.", "") || + ""} + ${router.server} + ${showOverflow + ? html`${network.dataset && + router.border_agent_id === + network.dataset.preferred_border_agent_id + ? html` + ${this.hass.localize( + "ui.panel.config.thread.default_router" )} - .path=${mdiDotsVertical} - slot="trigger" - > - ${network.dataset && router.border_agent_id - ? html` - ${router.border_agent_id === - network.dataset.preferred_border_agent_id - ? this.hass.localize( - "ui.panel.config.thread.default_router" - ) - : this.hass.localize( - "ui.panel.config.thread.set_default_router" - )} - ` - : ""} - ${router.extended_address === - this._otbrInfo?.extended_address - ? html`` + : ""} + + + ${network.dataset && router.border_agent_id + ? html` + ${router.border_agent_id === + network.dataset.preferred_border_agent_id + ? this.hass.localize( + "ui.panel.config.thread.default_router" + ) + : this.hass.localize( + "ui.panel.config.thread.set_default_router" )} - .path=${mdiDotsVertical} - slot="trigger" - > - - ${this.hass.localize( - "ui.panel.config.thread.reset_border_router" - )} - - ${this.hass.localize( - "ui.panel.config.thread.change_channel" - )} - ${network.dataset?.preferred - ? "" - : html` - ${this.hass.localize( - "ui.panel.config.thread.add_to_my_network" - )} - `}` - : ""} - ` - : ""} - ` - )}` + ` + : ""} + ${router.extended_address === + this._otbrInfo?.extended_address + ? html` + ${this.hass.localize( + "ui.panel.config.thread.reset_border_router" + )} + + ${this.hass.localize( + "ui.panel.config.thread.change_channel" + )} + ${network.dataset?.preferred + ? "" + : html` + ${this.hass.localize( + "ui.panel.config.thread.add_to_my_network" + )} + `}` + : ""} + ` + : ""} + `; + })}` : html`
${network.dataset?.extended_pan_id && @@ -509,7 +502,7 @@ export class ThreadConfigPanel extends SubscribeMixin(LitElement) { ) { const datasetId = dataset.dataset_id; const borderAgentId = router.border_agent_id; - if (!router.border_agent_id) { + if (!borderAgentId) { return; } await setPreferredBorderAgent(this.hass, datasetId, borderAgentId);