Make ZHA load quirks earlier (#123027)

pull/123066/head
David F. Mulcahey 2024-08-02 06:22:36 -04:00 committed by GitHub
parent 7670ad0a72
commit 5446dd92a9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 11 additions and 9 deletions

View File

@ -117,6 +117,8 @@ async def async_setup_entry(hass: HomeAssistant, config_entry: ConfigEntry) -> b
ha_zha_data.config_entry = config_entry
zha_lib_data: ZHAData = create_zha_config(hass, ha_zha_data)
zha_gateway = await Gateway.async_from_config(zha_lib_data)
# Load and cache device trigger information early
device_registry = dr.async_get(hass)
radio_mgr = ZhaRadioManager.from_config_entry(hass, config_entry)
@ -140,7 +142,7 @@ async def async_setup_entry(hass: HomeAssistant, config_entry: ConfigEntry) -> b
_LOGGER.debug("Trigger cache: %s", zha_lib_data.device_trigger_cache)
try:
zha_gateway = await Gateway.async_from_config(zha_lib_data)
await zha_gateway.async_initialize()
except NetworkSettingsInconsistent as exc:
await warn_on_inconsistent_network_settings(
hass,

View File

@ -21,7 +21,7 @@
"zha",
"universal_silabs_flasher"
],
"requirements": ["universal-silabs-flasher==0.0.22", "zha==0.0.24"],
"requirements": ["universal-silabs-flasher==0.0.22", "zha==0.0.25"],
"usb": [
{
"vid": "10C4",

View File

@ -2989,7 +2989,7 @@ zeroconf==0.132.2
zeversolar==0.3.1
# homeassistant.components.zha
zha==0.0.24
zha==0.0.25
# homeassistant.components.zhong_hong
zhong-hong-hvac==1.0.12

View File

@ -2363,7 +2363,7 @@ zeroconf==0.132.2
zeversolar==0.3.1
# homeassistant.components.zha
zha==0.0.24
zha==0.0.25
# homeassistant.components.zwave_js
zwave-js-server-python==0.57.0

View File

@ -148,7 +148,7 @@ async def test_multipan_firmware_repair(
autospec=True,
),
patch(
"homeassistant.components.zha.Gateway.async_from_config",
"homeassistant.components.zha.Gateway.async_initialize",
side_effect=RuntimeError(),
),
patch(
@ -199,7 +199,7 @@ async def test_multipan_firmware_no_repair_on_probe_failure(
autospec=True,
),
patch(
"homeassistant.components.zha.Gateway.async_from_config",
"homeassistant.components.zha.Gateway.async_initialize",
side_effect=RuntimeError(),
),
):
@ -236,7 +236,7 @@ async def test_multipan_firmware_retry_on_probe_ezsp(
autospec=True,
),
patch(
"homeassistant.components.zha.Gateway.async_from_config",
"homeassistant.components.zha.Gateway.async_initialize",
side_effect=RuntimeError(),
),
):
@ -311,7 +311,7 @@ async def test_inconsistent_settings_keep_new(
old_state = network_backup
with patch(
"homeassistant.components.zha.Gateway.async_from_config",
"homeassistant.components.zha.Gateway.async_initialize",
side_effect=NetworkSettingsInconsistent(
message="Network settings are inconsistent",
new_state=new_state,
@ -390,7 +390,7 @@ async def test_inconsistent_settings_restore_old(
old_state = network_backup
with patch(
"homeassistant.components.zha.Gateway.async_from_config",
"homeassistant.components.zha.Gateway.async_initialize",
side_effect=NetworkSettingsInconsistent(
message="Network settings are inconsistent",
new_state=new_state,