diff --git a/homeassistant/components/zha/manifest.json b/homeassistant/components/zha/manifest.json index ae337c2a5f5..4a5ec7be1dc 100644 --- a/homeassistant/components/zha/manifest.json +++ b/homeassistant/components/zha/manifest.json @@ -21,7 +21,7 @@ "zha", "universal_silabs_flasher" ], - "requirements": ["zha==0.0.57"], + "requirements": ["zha==0.0.59"], "usb": [ { "vid": "10C4", diff --git a/homeassistant/components/zha/number.py b/homeassistant/components/zha/number.py index 567e2a5b37a..7a6e40af7e7 100644 --- a/homeassistant/components/zha/number.py +++ b/homeassistant/components/zha/number.py @@ -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.""" diff --git a/homeassistant/components/zha/strings.json b/homeassistant/components/zha/strings.json index 05ee1f2ac7e..a330fa6b0ee 100644 --- a/homeassistant/components/zha/strings.json +++ b/homeassistant/components/zha/strings.json @@ -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": { diff --git a/requirements_all.txt b/requirements_all.txt index 7391ed7d801..0a0c49ad306 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -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 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index 3e09852a2c4..3267bf3bd18 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -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 diff --git a/tests/components/zha/common.py b/tests/components/zha/common.py index 89526f6431e..3935b66cc32 100644 --- a/tests/components/zha/common.py +++ b/tests/components/zha/common.py @@ -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() diff --git a/tests/components/zha/test_number.py b/tests/components/zha/test_number.py index 180f16e9ae2..91f5e32942f 100644 --- a/tests/components/zha/test_number.py +++ b/tests/components/zha/test_number.py @@ -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 diff --git a/tests/components/zha/test_sensor.py b/tests/components/zha/test_sensor.py index 863ea3964ab..2e6b9e8bd6a 100644 --- a/tests/components/zha/test_sensor.py +++ b/tests/components/zha/test_sensor.py @@ -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(