From 81f6136bdaf08e5ae1c0bc296cea5cf35b59f65b Mon Sep 17 00:00:00 2001 From: puddly <32534428+puddly@users.noreply.github.com> Date: Fri, 30 Jan 2026 05:18:38 -0500 Subject: [PATCH] Bump ZHA to 0.0.88 (#161904) --- homeassistant/components/zha/manifest.json | 2 +- homeassistant/components/zha/websocket_api.py | 18 ++++++++++++++---- requirements_all.txt | 2 +- requirements_test_all.txt | 2 +- tests/components/zha/test_fan.py | 9 +++++---- tests/components/zha/test_number.py | 3 ++- tests/components/zha/test_switch.py | 3 ++- 7 files changed, 26 insertions(+), 13 deletions(-) diff --git a/homeassistant/components/zha/manifest.json b/homeassistant/components/zha/manifest.json index e440941de44..df7fdd8738a 100644 --- a/homeassistant/components/zha/manifest.json +++ b/homeassistant/components/zha/manifest.json @@ -23,7 +23,7 @@ "universal_silabs_flasher", "serialx" ], - "requirements": ["zha==0.0.87", "serialx==0.6.2"], + "requirements": ["zha==0.0.88", "serialx==0.6.2"], "usb": [ { "description": "*2652*", diff --git a/homeassistant/components/zha/websocket_api.py b/homeassistant/components/zha/websocket_api.py index 08097880591..431a567e408 100644 --- a/homeassistant/components/zha/websocket_api.py +++ b/homeassistant/components/zha/websocket_api.py @@ -53,6 +53,10 @@ import zigpy.backups from zigpy.config import CONF_DEVICE from zigpy.config.validators import cv_boolean from zigpy.types.named import EUI64, KeyData +from zigpy.typing import ( + UNDEFINED as ZIGPY_UNDEFINED, + UndefinedType as ZigpyUndefinedType, +) from zigpy.zcl.clusters.security import IasAce import zigpy.zdo.types as zdo_types @@ -850,7 +854,7 @@ async def websocket_read_zigbee_cluster_attributes( cluster_id: int = msg[ATTR_CLUSTER_ID] cluster_type: str = msg[ATTR_CLUSTER_TYPE] attribute: int = msg[ATTR_ATTRIBUTE] - manufacturer: int | None = msg.get(ATTR_MANUFACTURER) + manufacturer: int | ZigpyUndefinedType = msg.get(ATTR_MANUFACTURER, ZIGPY_UNDEFINED) zha_device = zha_gateway.get_device(ieee) success = {} failure = {} @@ -1326,7 +1330,9 @@ def async_load_api(hass: HomeAssistant) -> None: cluster_type: str = service.data[ATTR_CLUSTER_TYPE] attribute: int | str = service.data[ATTR_ATTRIBUTE] value: int | bool | str = service.data[ATTR_VALUE] - manufacturer: int | None = service.data.get(ATTR_MANUFACTURER) + manufacturer: int | ZigpyUndefinedType = service.data.get( + ATTR_MANUFACTURER, ZIGPY_UNDEFINED + ) zha_device = zha_gateway.get_device(ieee) response = None if zha_device is not None: @@ -1380,7 +1386,9 @@ def async_load_api(hass: HomeAssistant) -> None: command_type: str = service.data[ATTR_COMMAND_TYPE] args: list | None = service.data.get(ATTR_ARGS) params: dict | None = service.data.get(ATTR_PARAMS) - manufacturer: int | None = service.data.get(ATTR_MANUFACTURER) + manufacturer: int | ZigpyUndefinedType = service.data.get( + ATTR_MANUFACTURER, ZIGPY_UNDEFINED + ) zha_device = zha_gateway.get_device(ieee) if zha_device is not None: if cluster_id >= MFG_CLUSTER_ID_START and manufacturer is None: @@ -1435,7 +1443,9 @@ def async_load_api(hass: HomeAssistant) -> None: cluster_id: int = service.data[ATTR_CLUSTER_ID] command: int = service.data[ATTR_COMMAND] args: list = service.data[ATTR_ARGS] - manufacturer: int | None = service.data.get(ATTR_MANUFACTURER) + manufacturer: int | ZigpyUndefinedType = service.data.get( + ATTR_MANUFACTURER, ZIGPY_UNDEFINED + ) group = zha_gateway.get_group(group_id) if cluster_id >= MFG_CLUSTER_ID_START and manufacturer is None: _LOGGER.error("Missing manufacturer attribute for cluster: %d", cluster_id) diff --git a/requirements_all.txt b/requirements_all.txt index 36668acedf8..fa557a87ca8 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -3299,7 +3299,7 @@ zeroconf==0.148.0 zeversolar==0.3.2 # homeassistant.components.zha -zha==0.0.87 +zha==0.0.88 # homeassistant.components.zhong_hong zhong-hong-hvac==1.0.13 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index 0bfc992920a..a6478aab8c0 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -2766,7 +2766,7 @@ zeroconf==0.148.0 zeversolar==0.3.2 # homeassistant.components.zha -zha==0.0.87 +zha==0.0.88 # homeassistant.components.zwave_js zwave-js-server-python==0.68.0 diff --git a/tests/components/zha/test_fan.py b/tests/components/zha/test_fan.py index 1bd5325dc92..3e4ed9cb6f8 100644 --- a/tests/components/zha/test_fan.py +++ b/tests/components/zha/test_fan.py @@ -7,6 +7,7 @@ import pytest from zha.application.platforms.fan.const import PRESET_MODE_ON from zigpy.device import Device from zigpy.profiles import zha +from zigpy.typing import UNDEFINED from zigpy.zcl.clusters import general, hvac from homeassistant.components.fan import ( @@ -113,28 +114,28 @@ async def test_fan( cluster.write_attributes.reset_mock() await async_turn_on(hass, entity_id) assert cluster.write_attributes.mock_calls == [ - call({"fan_mode": 2}, manufacturer=None) + call({"fan_mode": 2}, manufacturer=UNDEFINED) ] # turn off from HA cluster.write_attributes.reset_mock() await async_turn_off(hass, entity_id) assert cluster.write_attributes.mock_calls == [ - call({"fan_mode": 0}, manufacturer=None) + call({"fan_mode": 0}, manufacturer=UNDEFINED) ] # change speed from HA cluster.write_attributes.reset_mock() await async_set_percentage(hass, entity_id, percentage=100) assert cluster.write_attributes.mock_calls == [ - call({"fan_mode": 3}, manufacturer=None) + call({"fan_mode": 3}, manufacturer=UNDEFINED) ] # change preset_mode from HA cluster.write_attributes.reset_mock() await async_set_preset_mode(hass, entity_id, preset_mode=PRESET_MODE_ON) assert cluster.write_attributes.mock_calls == [ - call({"fan_mode": 4}, manufacturer=None) + call({"fan_mode": 4}, manufacturer=UNDEFINED) ] # set invalid preset_mode from HA diff --git a/tests/components/zha/test_number.py b/tests/components/zha/test_number.py index 511394161e3..111e852b3e6 100644 --- a/tests/components/zha/test_number.py +++ b/tests/components/zha/test_number.py @@ -6,6 +6,7 @@ from unittest.mock import call, patch import pytest from zigpy.device import Device from zigpy.profiles import zha +from zigpy.typing import UNDEFINED from zigpy.zcl.clusters import general import zigpy.zcl.foundation as zcl_f @@ -122,7 +123,7 @@ async def test_number( blocking=True, ) assert cluster.write_attributes.mock_calls == [ - call({"present_value": 30.0}, manufacturer=None) + call({"present_value": 30.0}, manufacturer=UNDEFINED) ] cluster.PLUGGED_ATTR_READS["present_value"] = 30.0 diff --git a/tests/components/zha/test_switch.py b/tests/components/zha/test_switch.py index b46df1165f8..ef7ff4e50c5 100644 --- a/tests/components/zha/test_switch.py +++ b/tests/components/zha/test_switch.py @@ -6,6 +6,7 @@ from unittest.mock import call, patch import pytest from zigpy.device import Device from zigpy.profiles import zha +from zigpy.typing import UNDEFINED from zigpy.zcl.clusters import general import zigpy.zcl.foundation as zcl_f @@ -143,5 +144,5 @@ async def test_switch( ) assert len(cluster.read_attributes.mock_calls) == 1 assert cluster.read_attributes.call_args == call( - ["on_off"], allow_cache=False, only_cache=False, manufacturer=None + ["on_off"], allow_cache=False, only_cache=False, manufacturer=UNDEFINED )