Bump ZHA dependencies (#90547)

* Bump ZHA dependencies

* Ensure the network is formed on channel 15 when multi-PAN is in use
This commit is contained in:
puddly 2023-03-30 20:55:01 -04:00 committed by GitHub
parent 47af325a88
commit 3a3c738945
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 62 additions and 15 deletions

View file

@ -137,6 +137,8 @@ CONF_GROUP_MEMBERS_ASSUME_STATE = "group_members_assume_state"
CONF_ENABLE_IDENTIFY_ON_JOIN = "enable_identify_on_join" CONF_ENABLE_IDENTIFY_ON_JOIN = "enable_identify_on_join"
CONF_ENABLE_QUIRKS = "enable_quirks" CONF_ENABLE_QUIRKS = "enable_quirks"
CONF_FLOWCONTROL = "flow_control" CONF_FLOWCONTROL = "flow_control"
CONF_NWK = "network"
CONF_NWK_CHANNEL = "channel"
CONF_RADIO_TYPE = "radio_type" CONF_RADIO_TYPE = "radio_type"
CONF_USB_PATH = "usb_path" CONF_USB_PATH = "usb_path"
CONF_USE_THREAD = "use_thread" CONF_USE_THREAD = "use_thread"

View file

@ -41,6 +41,8 @@ from .const import (
ATTR_TYPE, ATTR_TYPE,
CONF_DATABASE, CONF_DATABASE,
CONF_DEVICE_PATH, CONF_DEVICE_PATH,
CONF_NWK,
CONF_NWK_CHANNEL,
CONF_RADIO_TYPE, CONF_RADIO_TYPE,
CONF_USE_THREAD, CONF_USE_THREAD,
CONF_ZIGPY, CONF_ZIGPY,
@ -172,6 +174,20 @@ class ZHAGateway:
): ):
app_config[CONF_USE_THREAD] = False app_config[CONF_USE_THREAD] = False
# Local import to avoid circular dependencies
# pylint: disable-next=import-outside-toplevel
from homeassistant.components.homeassistant_hardware.silabs_multiprotocol_addon import (
is_multiprotocol_url,
)
# Until we have a way to coordinate channels with the Thread half of multi-PAN,
# stick to the old zigpy default of channel 15 instead of dynamically scanning
if (
is_multiprotocol_url(app_config[CONF_DEVICE][CONF_DEVICE_PATH])
and app_config.get(CONF_NWK, {}).get(CONF_NWK_CHANNEL) is None
):
app_config.setdefault(CONF_NWK, {})[CONF_NWK_CHANNEL] = 15
return app_controller_cls, app_controller_cls.SCHEMA(app_config) return app_controller_cls, app_controller_cls.SCHEMA(app_config)
async def async_initialize(self) -> None: async def async_initialize(self) -> None:

View file

@ -20,15 +20,15 @@
"zigpy_znp" "zigpy_znp"
], ],
"requirements": [ "requirements": [
"bellows==0.34.10", "bellows==0.35.0",
"pyserial==3.5", "pyserial==3.5",
"pyserial-asyncio==0.6", "pyserial-asyncio==0.6",
"zha-quirks==0.0.95", "zha-quirks==0.0.95",
"zigpy-deconz==0.19.2", "zigpy-deconz==0.20.0",
"zigpy==0.53.2", "zigpy==0.54.0",
"zigpy-xbee==0.16.2", "zigpy-xbee==0.17.0",
"zigpy-zigate==0.10.3", "zigpy-zigate==0.10.3",
"zigpy-znp==0.9.3" "zigpy-znp==0.10.0"
], ],
"usb": [ "usb": [
{ {

View file

@ -422,7 +422,7 @@ beautifulsoup4==4.11.1
# beewi_smartclim==0.0.10 # beewi_smartclim==0.0.10
# homeassistant.components.zha # homeassistant.components.zha
bellows==0.34.10 bellows==0.35.0
# homeassistant.components.bmw_connected_drive # homeassistant.components.bmw_connected_drive
bimmer_connected==0.13.0 bimmer_connected==0.13.0
@ -2710,19 +2710,19 @@ zhong_hong_hvac==1.0.9
ziggo-mediabox-xl==1.1.0 ziggo-mediabox-xl==1.1.0
# homeassistant.components.zha # homeassistant.components.zha
zigpy-deconz==0.19.2 zigpy-deconz==0.20.0
# homeassistant.components.zha # homeassistant.components.zha
zigpy-xbee==0.16.2 zigpy-xbee==0.17.0
# homeassistant.components.zha # homeassistant.components.zha
zigpy-zigate==0.10.3 zigpy-zigate==0.10.3
# homeassistant.components.zha # homeassistant.components.zha
zigpy-znp==0.9.3 zigpy-znp==0.10.0
# homeassistant.components.zha # homeassistant.components.zha
zigpy==0.53.2 zigpy==0.54.0
# homeassistant.components.zoneminder # homeassistant.components.zoneminder
zm-py==0.5.2 zm-py==0.5.2

View file

@ -355,7 +355,7 @@ base36==0.1.1
beautifulsoup4==4.11.1 beautifulsoup4==4.11.1
# homeassistant.components.zha # homeassistant.components.zha
bellows==0.34.10 bellows==0.35.0
# homeassistant.components.bmw_connected_drive # homeassistant.components.bmw_connected_drive
bimmer_connected==0.13.0 bimmer_connected==0.13.0
@ -1944,19 +1944,19 @@ zeversolar==0.3.1
zha-quirks==0.0.95 zha-quirks==0.0.95
# homeassistant.components.zha # homeassistant.components.zha
zigpy-deconz==0.19.2 zigpy-deconz==0.20.0
# homeassistant.components.zha # homeassistant.components.zha
zigpy-xbee==0.16.2 zigpy-xbee==0.17.0
# homeassistant.components.zha # homeassistant.components.zha
zigpy-zigate==0.10.3 zigpy-zigate==0.10.3
# homeassistant.components.zha # homeassistant.components.zha
zigpy-znp==0.9.3 zigpy-znp==0.10.0
# homeassistant.components.zha # homeassistant.components.zha
zigpy==0.53.2 zigpy==0.54.0
# homeassistant.components.zwave_js # homeassistant.components.zwave_js
zwave-js-server-python==0.47.1 zwave-js-server-python==0.47.1

View file

@ -323,3 +323,32 @@ async def test_gateway_initialize_bellows_thread(
await zha_gateway.async_initialize() await zha_gateway.async_initialize()
assert mock_new.mock_calls[0].args[0]["use_thread"] is thread_state assert mock_new.mock_calls[0].args[0]["use_thread"] is thread_state
@pytest.mark.parametrize(
("device_path", "config_override", "expected_channel"),
[
("/dev/ttyUSB0", {}, None),
("socket://192.168.1.123:9999", {}, None),
("socket://192.168.1.123:9999", {"network": {"channel": 20}}, 20),
("socket://core-silabs-multiprotocol:9999", {}, 15),
("socket://core-silabs-multiprotocol:9999", {"network": {"channel": 20}}, 20),
],
)
async def test_gateway_force_multi_pan_channel(
device_path: str,
config_override: dict,
expected_channel: int | None,
hass: HomeAssistant,
coordinator,
) -> None:
"""Test ZHA disabling the UART thread when connecting to a TCP coordinator."""
zha_gateway = get_zha_gateway(hass)
assert zha_gateway is not None
zha_gateway.config_entry.data = dict(zha_gateway.config_entry.data)
zha_gateway.config_entry.data["device"]["path"] = device_path
zha_gateway._config.setdefault("zigpy_config", {}).update(config_override)
_, config = zha_gateway.get_application_controller_data()
assert config["network"]["channel"] == expected_channel