mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-26 10:46:35 +00:00
Disable ZHA channel changing when multi-PAN is in use (#16731)
* Show baudrate and port in the ZHA network info * Do not allow changing the Zigbee channel with the multiprotocol addon * Include translations as well * Update src/translations/en.json --------- Co-authored-by: Bram Kragten <mail@bramkragten.nl>
This commit is contained in:
parent
33e15eec22
commit
e6bdc3a15e
@ -169,9 +169,16 @@ export interface ZHANetworkBackup {
|
|||||||
node_info: ZHANetworkBackupNodeInfo;
|
node_info: ZHANetworkBackupNodeInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface ZHADeviceSettings {
|
||||||
|
path: string;
|
||||||
|
baudrate?: number;
|
||||||
|
flow_control?: string;
|
||||||
|
}
|
||||||
|
|
||||||
export interface ZHANetworkSettings {
|
export interface ZHANetworkSettings {
|
||||||
settings: ZHANetworkBackup;
|
settings: ZHANetworkBackup;
|
||||||
radio_type: "ezsp" | "znp" | "deconz" | "zigate" | "xbee";
|
radio_type: "ezsp" | "znp" | "deconz" | "zigate" | "xbee";
|
||||||
|
device: ZHADeviceSettings;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ZHANetworkBackupAndMetadata {
|
export interface ZHANetworkBackupAndMetadata {
|
||||||
|
@ -46,6 +46,8 @@ import {
|
|||||||
} from "../../../../../data/zha";
|
} from "../../../../../data/zha";
|
||||||
import { showAlertDialog } from "../../../../../dialogs/generic/show-dialog-box";
|
import { showAlertDialog } from "../../../../../dialogs/generic/show-dialog-box";
|
||||||
|
|
||||||
|
const MULTIPROTOCOL_ADDON_URL = "socket://core-silabs-multiprotocol:9999";
|
||||||
|
|
||||||
export const zhaTabs: PageNavigation[] = [
|
export const zhaTabs: PageNavigation[] = [
|
||||||
{
|
{
|
||||||
translationKey: "ui.panel.config.zha.network.caption",
|
translationKey: "ui.panel.config.zha.network.caption",
|
||||||
@ -181,6 +183,25 @@ class ZHAConfigDashboard extends LitElement {
|
|||||||
>${this._networkSettings.radio_type}</span
|
>${this._networkSettings.radio_type}</span
|
||||||
>
|
>
|
||||||
</ha-settings-row>
|
</ha-settings-row>
|
||||||
|
|
||||||
|
<ha-settings-row>
|
||||||
|
<span slot="description">Serial port</span>
|
||||||
|
<span slot="heading"
|
||||||
|
>${this._networkSettings.device.path}</span
|
||||||
|
>
|
||||||
|
</ha-settings-row>
|
||||||
|
|
||||||
|
${this._networkSettings.device.baudrate &&
|
||||||
|
!this._networkSettings.device.path.startsWith("socket://")
|
||||||
|
? html`
|
||||||
|
<ha-settings-row>
|
||||||
|
<span slot="description">Baudrate</span>
|
||||||
|
<span slot="heading"
|
||||||
|
>${this._networkSettings.device.baudrate}</span
|
||||||
|
>
|
||||||
|
</ha-settings-row>
|
||||||
|
`
|
||||||
|
: ""}
|
||||||
</div>`
|
</div>`
|
||||||
: ""}
|
: ""}
|
||||||
<div class="card-actions">
|
<div class="card-actions">
|
||||||
@ -255,6 +276,19 @@ class ZHAConfigDashboard extends LitElement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private async _showChannelMigrationDialog(): Promise<void> {
|
private async _showChannelMigrationDialog(): Promise<void> {
|
||||||
|
if (this._networkSettings!.device.path === MULTIPROTOCOL_ADDON_URL) {
|
||||||
|
showAlertDialog(this, {
|
||||||
|
title: this.hass.localize(
|
||||||
|
"ui.panel.config.zha.configuration_page.channel_dialog.title"
|
||||||
|
),
|
||||||
|
text: this.hass.localize(
|
||||||
|
"ui.panel.config.zha.configuration_page.channel_dialog.text"
|
||||||
|
),
|
||||||
|
warning: true,
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
showZHAChangeChannelDialog(this, {
|
showZHAChangeChannelDialog(this, {
|
||||||
currentChannel: this._networkSettings!.settings.network_info.channel,
|
currentChannel: this._networkSettings!.settings.network_info.channel,
|
||||||
});
|
});
|
||||||
|
@ -3509,7 +3509,11 @@
|
|||||||
"download_backup": "Download Backup",
|
"download_backup": "Download Backup",
|
||||||
"migrate_radio": "Migrate Radio",
|
"migrate_radio": "Migrate Radio",
|
||||||
"network_settings_title": "Network Settings",
|
"network_settings_title": "Network Settings",
|
||||||
"change_channel": "Change channel"
|
"change_channel": "Change channel",
|
||||||
|
"channel_dialog": {
|
||||||
|
"title": "Multiprotocol addon in use",
|
||||||
|
"text": "Zigbee and Thread share the same radio and must use the same channel. Change the channel of both networks by reconfiguring multiprotocol from the hardware menu."
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"add_device_page": {
|
"add_device_page": {
|
||||||
"spinner": "Searching for Zigbee devices…",
|
"spinner": "Searching for Zigbee devices…",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user