Bump ZHA to 0.0.59 (#145597)

This commit is contained in:
TheJulianJES 2025-05-26 06:53:09 +02:00 committed by GitHub
parent 32eb4af6ef
commit ba0c03ddbb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 19 additions and 25 deletions

View File

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

View File

@ -11,7 +11,6 @@ from homeassistant.const import Platform
from homeassistant.core import HomeAssistant
from homeassistant.helpers.dispatcher import async_dispatcher_connect
from homeassistant.helpers.entity_platform import AddConfigEntryEntitiesCallback
from homeassistant.helpers.typing import UndefinedType
from .entity import ZHAEntity
from .helpers import (
@ -46,17 +45,6 @@ async def async_setup_entry(
class ZhaNumber(ZHAEntity, RestoreNumber):
"""Representation of a ZHA Number entity."""
@property
def name(self) -> str | UndefinedType | None:
"""Return the name of the number entity."""
if (description := self.entity_data.entity.description) is None:
return super().name
# The name of this entity is reported by the device itself.
# For backwards compatibility, we keep the same format as before. This
# should probably be changed in the future to omit the prefix.
return f"{super().name} {description}"
@property
def native_value(self) -> float | None:
"""Return the current value."""

View File

@ -1137,6 +1137,9 @@
},
"external_temperature_sensor_value": {
"name": "External temperature sensor value"
},
"update_frequency": {
"name": "Update frequency"
}
},
"select": {
@ -1367,6 +1370,9 @@
},
"alarm_sound_mode": {
"name": "Alarm sound mode"
},
"external_switch_type": {
"name": "External switch type"
}
},
"sensor": {

2
requirements_all.txt generated
View File

@ -3177,7 +3177,7 @@ zeroconf==0.147.0
zeversolar==0.3.2
# homeassistant.components.zha
zha==0.0.57
zha==0.0.59
# homeassistant.components.zhong_hong
zhong-hong-hvac==1.0.13

View File

@ -2579,7 +2579,7 @@ zeroconf==0.147.0
zeversolar==0.3.2
# homeassistant.components.zha
zha==0.0.57
zha==0.0.59
# homeassistant.components.zwave_js
zwave-js-server-python==0.63.0

View File

@ -75,7 +75,7 @@ def update_attribute_cache(cluster):
attrs.append(make_attribute(attrid, value))
hdr = make_zcl_header(zcl_f.GeneralCommand.Report_Attributes)
hdr.frame_control.disable_default_response = True
hdr.frame_control = hdr.frame_control.replace(disable_default_response=True)
msg = zcl_f.GENERAL_COMMANDS[zcl_f.GeneralCommand.Report_Attributes].schema(
attribute_reports=attrs
)
@ -119,7 +119,7 @@ async def send_attributes_report(
)
hdr = make_zcl_header(zcl_f.GeneralCommand.Report_Attributes)
hdr.frame_control.disable_default_response = True
hdr.frame_control = hdr.frame_control.replace(disable_default_response=True)
cluster.handle_message(hdr, msg)
await hass.async_block_till_done()

View File

@ -92,7 +92,7 @@ async def test_number(hass: HomeAssistant, setup_zha, zigpy_device_mock) -> None
assert (
hass.states.get(entity_id).attributes.get("friendly_name")
== "FakeManufacturer FakeModel Number PWM1"
== "FakeManufacturer FakeModel PWM1"
)
# change value from device

View File

@ -62,10 +62,10 @@ async def async_test_temperature(hass: HomeAssistant, cluster: Cluster, entity_i
async def async_test_pressure(hass: HomeAssistant, cluster: Cluster, entity_id: str):
"""Test pressure sensor."""
await send_attributes_report(hass, cluster, {1: 1, 0: 1000, 2: 10000})
assert_state(hass, entity_id, "1000.0", UnitOfPressure.HPA)
assert_state(hass, entity_id, "1000", UnitOfPressure.HPA)
await send_attributes_report(hass, cluster, {0: 1000, 20: -1, 16: 10000})
assert_state(hass, entity_id, "1000.0", UnitOfPressure.HPA)
assert_state(hass, entity_id, "1000", UnitOfPressure.HPA)
async def async_test_illuminance(hass: HomeAssistant, cluster: Cluster, entity_id: str):
@ -211,17 +211,17 @@ async def async_test_em_power_factor(
# update divisor cached value
await send_attributes_report(hass, cluster, {"ac_power_divisor": 1})
await send_attributes_report(hass, cluster, {0: 1, 0x0510: 100, 10: 1000})
assert_state(hass, entity_id, "100.0", PERCENTAGE)
assert_state(hass, entity_id, "100", PERCENTAGE)
await send_attributes_report(hass, cluster, {0: 1, 0x0510: 99, 10: 1000})
assert_state(hass, entity_id, "99.0", PERCENTAGE)
assert_state(hass, entity_id, "99", PERCENTAGE)
await send_attributes_report(hass, cluster, {"ac_power_divisor": 10})
await send_attributes_report(hass, cluster, {0: 1, 0x0510: 100, 10: 5000})
assert_state(hass, entity_id, "100.0", PERCENTAGE)
assert_state(hass, entity_id, "100", PERCENTAGE)
await send_attributes_report(hass, cluster, {0: 1, 0x0510: 99, 10: 5000})
assert_state(hass, entity_id, "99.0", PERCENTAGE)
assert_state(hass, entity_id, "99", PERCENTAGE)
async def async_test_em_rms_current(
@ -317,7 +317,7 @@ async def async_test_pi_heating_demand(
await send_attributes_report(
hass, cluster, {Thermostat.AttributeDefs.pi_heating_demand.id: 1}
)
assert_state(hass, entity_id, "1.0", "%")
assert_state(hass, entity_id, "1", "%")
@pytest.mark.parametrize(