mirror of
https://github.com/home-assistant/core.git
synced 2025-07-22 20:57:21 +00:00
Bump ZHA dependencies (#128539)
* Bump ZHA dependencies * Remove unused ZHA color modes * Rename `cluster` to `ota_cluster` in update tests to unshadow `cluster` in `endpoint_reply` --------- Co-authored-by: TheJulianJES <TheJulianJES@users.noreply.github.com>
This commit is contained in:
parent
72f1c358d9
commit
f6270d9cfc
@ -44,12 +44,7 @@ ZHA_TO_HA_COLOR_MODE = {
|
||||
ZhaColorMode.ONOFF: ColorMode.ONOFF,
|
||||
ZhaColorMode.BRIGHTNESS: ColorMode.BRIGHTNESS,
|
||||
ZhaColorMode.COLOR_TEMP: ColorMode.COLOR_TEMP,
|
||||
ZhaColorMode.HS: ColorMode.HS,
|
||||
ZhaColorMode.XY: ColorMode.XY,
|
||||
ZhaColorMode.RGB: ColorMode.RGB,
|
||||
ZhaColorMode.RGBW: ColorMode.RGBW,
|
||||
ZhaColorMode.RGBWW: ColorMode.RGBWW,
|
||||
ZhaColorMode.WHITE: ColorMode.WHITE,
|
||||
}
|
||||
|
||||
HA_TO_ZHA_COLOR_MODE = {v: k for k, v in ZHA_TO_HA_COLOR_MODE.items()}
|
||||
|
@ -21,7 +21,7 @@
|
||||
"zha",
|
||||
"universal_silabs_flasher"
|
||||
],
|
||||
"requirements": ["universal-silabs-flasher==0.0.22", "zha==0.0.34"],
|
||||
"requirements": ["universal-silabs-flasher==0.0.23", "zha==0.0.35"],
|
||||
"usb": [
|
||||
{
|
||||
"vid": "10C4",
|
||||
|
@ -2887,7 +2887,7 @@ unifi_ap==0.0.1
|
||||
unifiled==0.11
|
||||
|
||||
# homeassistant.components.zha
|
||||
universal-silabs-flasher==0.0.22
|
||||
universal-silabs-flasher==0.0.23
|
||||
|
||||
# homeassistant.components.upb
|
||||
upb-lib==0.5.8
|
||||
@ -3053,7 +3053,7 @@ zeroconf==0.135.0
|
||||
zeversolar==0.3.1
|
||||
|
||||
# homeassistant.components.zha
|
||||
zha==0.0.34
|
||||
zha==0.0.35
|
||||
|
||||
# homeassistant.components.zhong_hong
|
||||
zhong-hong-hvac==1.0.12
|
||||
|
@ -2288,7 +2288,7 @@ ultraheat-api==0.5.7
|
||||
unifi-discovery==1.2.0
|
||||
|
||||
# homeassistant.components.zha
|
||||
universal-silabs-flasher==0.0.22
|
||||
universal-silabs-flasher==0.0.23
|
||||
|
||||
# homeassistant.components.upb
|
||||
upb-lib==0.5.8
|
||||
@ -2430,7 +2430,7 @@ zeroconf==0.135.0
|
||||
zeversolar==0.3.1
|
||||
|
||||
# homeassistant.components.zha
|
||||
zha==0.0.34
|
||||
zha==0.0.35
|
||||
|
||||
# homeassistant.components.zwave_js
|
||||
zwave-js-server-python==0.58.1
|
||||
|
@ -272,7 +272,7 @@ async def test_firmware_update_success(
|
||||
) -> None:
|
||||
"""Test ZHA update platform - firmware update success."""
|
||||
await setup_zha()
|
||||
zha_device, cluster, fw_image, installed_fw_version = await setup_test_data(
|
||||
zha_device, ota_cluster, fw_image, installed_fw_version = await setup_test_data(
|
||||
hass, zigpy_device_mock
|
||||
)
|
||||
|
||||
@ -284,7 +284,7 @@ async def test_firmware_update_success(
|
||||
assert hass.states.get(entity_id).state == STATE_UNKNOWN
|
||||
|
||||
# simulate an image available notification
|
||||
await cluster._handle_query_next_image(
|
||||
await ota_cluster._handle_query_next_image(
|
||||
foundation.ZCLHeader.cluster(
|
||||
tsn=0x12, command_id=general.Ota.ServerCommandDefs.query_next_image.id
|
||||
),
|
||||
@ -306,14 +306,14 @@ async def test_firmware_update_success(
|
||||
attrs[ATTR_LATEST_VERSION] == f"0x{fw_image.firmware.header.file_version:08x}"
|
||||
)
|
||||
|
||||
async def endpoint_reply(cluster_id, tsn, data, command_id):
|
||||
if cluster_id == general.Ota.cluster_id:
|
||||
hdr, cmd = cluster.deserialize(data)
|
||||
async def endpoint_reply(cluster, sequence, data, **kwargs):
|
||||
if cluster == general.Ota.cluster_id:
|
||||
hdr, cmd = ota_cluster.deserialize(data)
|
||||
if isinstance(cmd, general.Ota.ImageNotifyCommand):
|
||||
zha_device.device.device.packet_received(
|
||||
make_packet(
|
||||
zha_device.device.device,
|
||||
cluster,
|
||||
ota_cluster,
|
||||
general.Ota.ServerCommandDefs.query_next_image.name,
|
||||
field_control=general.Ota.QueryNextImageCommand.FieldControl.HardwareVersion,
|
||||
manufacturer_code=fw_image.firmware.header.manufacturer_id,
|
||||
@ -333,7 +333,7 @@ async def test_firmware_update_success(
|
||||
zha_device.device.device.packet_received(
|
||||
make_packet(
|
||||
zha_device.device.device,
|
||||
cluster,
|
||||
ota_cluster,
|
||||
general.Ota.ServerCommandDefs.image_block.name,
|
||||
field_control=general.Ota.ImageBlockCommand.FieldControl.RequestNodeAddr,
|
||||
manufacturer_code=fw_image.firmware.header.manufacturer_id,
|
||||
@ -360,7 +360,7 @@ async def test_firmware_update_success(
|
||||
zha_device.device.device.packet_received(
|
||||
make_packet(
|
||||
zha_device.device.device,
|
||||
cluster,
|
||||
ota_cluster,
|
||||
general.Ota.ServerCommandDefs.image_block.name,
|
||||
field_control=general.Ota.ImageBlockCommand.FieldControl.RequestNodeAddr,
|
||||
manufacturer_code=fw_image.firmware.header.manufacturer_id,
|
||||
@ -398,7 +398,7 @@ async def test_firmware_update_success(
|
||||
zha_device.device.device.packet_received(
|
||||
make_packet(
|
||||
zha_device.device.device,
|
||||
cluster,
|
||||
ota_cluster,
|
||||
general.Ota.ServerCommandDefs.upgrade_end.name,
|
||||
status=foundation.Status.SUCCESS,
|
||||
manufacturer_code=fw_image.firmware.header.manufacturer_id,
|
||||
@ -417,7 +417,7 @@ async def test_firmware_update_success(
|
||||
assert cmd.upgrade_time == 0
|
||||
|
||||
def read_new_fw_version(*args, **kwargs):
|
||||
cluster.update_attribute(
|
||||
ota_cluster.update_attribute(
|
||||
attrid=general.Ota.AttributeDefs.current_file_version.id,
|
||||
value=fw_image.firmware.header.file_version,
|
||||
)
|
||||
@ -427,9 +427,9 @@ async def test_firmware_update_success(
|
||||
)
|
||||
}, {}
|
||||
|
||||
cluster.read_attributes.side_effect = read_new_fw_version
|
||||
ota_cluster.read_attributes.side_effect = read_new_fw_version
|
||||
|
||||
cluster.endpoint.reply = AsyncMock(side_effect=endpoint_reply)
|
||||
ota_cluster.endpoint.reply = AsyncMock(side_effect=endpoint_reply)
|
||||
await hass.services.async_call(
|
||||
UPDATE_DOMAIN,
|
||||
SERVICE_INSTALL,
|
||||
@ -465,7 +465,7 @@ async def test_firmware_update_raises(
|
||||
) -> None:
|
||||
"""Test ZHA update platform - firmware update raises."""
|
||||
await setup_zha()
|
||||
zha_device, cluster, fw_image, installed_fw_version = await setup_test_data(
|
||||
zha_device, ota_cluster, fw_image, installed_fw_version = await setup_test_data(
|
||||
hass, zigpy_device_mock
|
||||
)
|
||||
|
||||
@ -475,7 +475,7 @@ async def test_firmware_update_raises(
|
||||
assert hass.states.get(entity_id).state == STATE_UNKNOWN
|
||||
|
||||
# simulate an image available notification
|
||||
await cluster._handle_query_next_image(
|
||||
await ota_cluster._handle_query_next_image(
|
||||
foundation.ZCLHeader.cluster(
|
||||
tsn=0x12, command_id=general.Ota.ServerCommandDefs.query_next_image.id
|
||||
),
|
||||
@ -498,14 +498,14 @@ async def test_firmware_update_raises(
|
||||
attrs[ATTR_LATEST_VERSION] == f"0x{fw_image.firmware.header.file_version:08x}"
|
||||
)
|
||||
|
||||
async def endpoint_reply(cluster_id, tsn, data, command_id):
|
||||
if cluster_id == general.Ota.cluster_id:
|
||||
hdr, cmd = cluster.deserialize(data)
|
||||
async def endpoint_reply(cluster, sequence, data, **kwargs):
|
||||
if cluster == general.Ota.cluster_id:
|
||||
hdr, cmd = ota_cluster.deserialize(data)
|
||||
if isinstance(cmd, general.Ota.ImageNotifyCommand):
|
||||
zha_device.device.device.packet_received(
|
||||
make_packet(
|
||||
zha_device.device.device,
|
||||
cluster,
|
||||
ota_cluster,
|
||||
general.Ota.ServerCommandDefs.query_next_image.name,
|
||||
field_control=general.Ota.QueryNextImageCommand.FieldControl.HardwareVersion,
|
||||
manufacturer_code=fw_image.firmware.header.manufacturer_id,
|
||||
@ -524,7 +524,7 @@ async def test_firmware_update_raises(
|
||||
assert cmd.image_size == fw_image.firmware.header.image_size
|
||||
raise DeliveryError("failed to deliver")
|
||||
|
||||
cluster.endpoint.reply = AsyncMock(side_effect=endpoint_reply)
|
||||
ota_cluster.endpoint.reply = AsyncMock(side_effect=endpoint_reply)
|
||||
with pytest.raises(HomeAssistantError):
|
||||
await hass.services.async_call(
|
||||
UPDATE_DOMAIN,
|
||||
|
Loading…
x
Reference in New Issue
Block a user