Bump ZHA to 0.0.51 (#139383)

* Bump ZHA to 0.0.51

* Fix unit tests not accounting for primary entities
This commit is contained in:
puddly 2025-02-26 15:22:08 -05:00 committed by GitHub
parent f3fb7cd8e8
commit 036eef2b6b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 26 additions and 23 deletions

View File

@ -59,6 +59,10 @@ class ZHAEntity(LogMixin, RestoreEntity, Entity):
def name(self) -> str | UndefinedType | None:
"""Return the name of the entity."""
meta = self.entity_data.entity.info_object
if meta.primary:
self._attr_name = None
return super().name
original_name = super().name
if original_name not in (UNDEFINED, None) or meta.fallback_name is None:

View File

@ -21,7 +21,7 @@
"zha",
"universal_silabs_flasher"
],
"requirements": ["zha==0.0.50"],
"requirements": ["zha==0.0.51"],
"usb": [
{
"vid": "10C4",

2
requirements_all.txt generated
View File

@ -3149,7 +3149,7 @@ zeroconf==0.145.1
zeversolar==0.3.2
# homeassistant.components.zha
zha==0.0.50
zha==0.0.51
# homeassistant.components.zhong_hong
zhong-hong-hvac==1.0.13

View File

@ -2538,7 +2538,7 @@ zeroconf==0.145.1
zeversolar==0.3.2
# homeassistant.components.zha
zha==0.0.50
zha==0.0.51
# homeassistant.components.zwave_js
zwave-js-server-python==0.60.1

View File

@ -179,16 +179,7 @@
}),
'0x0010': dict({
'attribute': "ZCLAttributeDef(id=0x0010, name='cie_addr', type=<class 'zigpy.types.named.EUI64'>, zcl_type=<DataTypeId.EUI64: 240>, access=<ZCLAttributeAccess.Read|Write: 3>, mandatory=True, is_manufacturer_specific=False)",
'value': list([
50,
79,
50,
2,
0,
141,
21,
0,
]),
'value': None,
}),
'0x0011': dict({
'attribute': "ZCLAttributeDef(id=0x0011, name='zone_id', type=<class 'zigpy.types.basic.uint8_t'>, zcl_type=<DataTypeId.uint8: 32>, access=<ZCLAttributeAccess.Read: 1>, mandatory=True, is_manufacturer_specific=False)",

View File

@ -30,6 +30,7 @@ from homeassistant.core import HomeAssistant
from .common import send_attributes_report
from .conftest import SIG_EP_INPUT, SIG_EP_OUTPUT, SIG_EP_PROFILE, SIG_EP_TYPE
ENTITY_ID_NO_PREFIX = "sensor.fakemanufacturer_fakemodel"
ENTITY_ID_PREFIX = "sensor.fakemanufacturer_fakemodel_{}"
@ -335,7 +336,7 @@ async def async_test_pi_heating_demand(
"humidity",
async_test_humidity,
1,
None,
{},
None,
STATE_UNKNOWN,
),
@ -344,7 +345,7 @@ async def async_test_pi_heating_demand(
"temperature",
async_test_temperature,
1,
None,
{},
None,
STATE_UNKNOWN,
),
@ -353,7 +354,7 @@ async def async_test_pi_heating_demand(
"pressure",
async_test_pressure,
1,
None,
{},
None,
STATE_UNKNOWN,
),
@ -362,7 +363,7 @@ async def async_test_pi_heating_demand(
"illuminance",
async_test_illuminance,
1,
None,
{},
None,
STATE_UNKNOWN,
),
@ -492,7 +493,7 @@ async def async_test_pi_heating_demand(
"device_temperature",
async_test_device_temperature,
1,
None,
{},
None,
STATE_UNKNOWN,
),
@ -501,7 +502,7 @@ async def async_test_pi_heating_demand(
"setpoint_change_source",
async_test_setpoint_change_source,
10,
None,
{},
None,
STATE_UNKNOWN,
),
@ -510,7 +511,7 @@ async def async_test_pi_heating_demand(
"pi_heating_demand",
async_test_pi_heating_demand,
10,
None,
{},
None,
STATE_UNKNOWN,
),
@ -558,7 +559,6 @@ async def test_sensor(
gateway.get_or_create_device(zigpy_device)
await gateway.async_device_initialized(zigpy_device)
await hass.async_block_till_done(wait_background_tasks=True)
entity_id = ENTITY_ID_PREFIX.format(entity_suffix)
zigpy_device = zigpy_device_mock(
{
@ -570,6 +570,11 @@ async def test_sensor(
}
)
if hass.states.get(ENTITY_ID_NO_PREFIX):
entity_id = ENTITY_ID_NO_PREFIX
else:
entity_id = ENTITY_ID_PREFIX.format(entity_suffix)
assert hass.states.get(entity_id).state == initial_sensor_state
# test sensor associated logic

View File

@ -420,8 +420,11 @@ async def test_list_groupable_devices(
assert entity_reference[ATTR_NAME] is not None
assert entity_reference["entity_id"] is not None
for entity_reference in endpoint["entities"]:
assert entity_reference["original_name"] is not None
if len(endpoint["entities"]) == 1:
assert endpoint["entities"][0]["original_name"] is None
else:
for entity_reference in endpoint["entities"]:
assert entity_reference["original_name"] is not None
# Make sure there are no groupable devices when the device is unavailable
# Make device unavailable