From f005ae4e66a3b498713518eadfe92bdd43979b67 Mon Sep 17 00:00:00 2001 From: TheJulianJES Date: Wed, 25 Feb 2026 03:58:34 +0100 Subject: [PATCH] Use attribute names for `send_attributes_report` in tests --- tests/test_fan.py | 4 ++-- tests/test_sensor.py | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/test_fan.py b/tests/test_fan.py index f571a420b..9d53226f2 100644 --- a/tests/test_fan.py +++ b/tests/test_fan.py @@ -556,11 +556,11 @@ async def test_fan_ikea( assert entity.state["is_on"] is False # turn on at fan - await send_attributes_report(zha_gateway, cluster, {6: 1}) + await send_attributes_report(zha_gateway, cluster, {"fan_mode": 1}) assert entity.state["is_on"] is True # turn off at fan - await send_attributes_report(zha_gateway, cluster, {6: 0}) + await send_attributes_report(zha_gateway, cluster, {"fan_mode": 0}) assert entity.state["is_on"] is False # turn on from HA diff --git a/tests/test_sensor.py b/tests/test_sensor.py index 65b6bcadf..6e96304df 100644 --- a/tests/test_sensor.py +++ b/tests/test_sensor.py @@ -1546,7 +1546,7 @@ async def test_timestamp_sensor_v2(zha_gateway: Gateway) -> None: assert isinstance(zha_device.device, CustomDeviceV2) entity = get_entity(zha_device, platform=Platform.SENSOR, qualifier="start_time") - await send_attributes_report(zha_gateway, cluster, {0xEF65: 781355715}) + await send_attributes_report(zha_gateway, cluster, {"start_time": 781355715}) assert entity.state["state"] == datetime(2024, 10, 4, 11, 15, 15, tzinfo=UTC) @@ -1650,10 +1650,10 @@ async def test_last_feeding_size_sensor_v2(zha_gateway: Gateway) -> None: zha_device, platform=Platform.SENSOR, qualifier="last_feeding_size" ) - await send_attributes_report(zha_gateway, cluster, {0x010C: 1}) + await send_attributes_report(zha_gateway, cluster, {"last_feeding_size": 1}) assert_state(entity, 1.0, "g") - await send_attributes_report(zha_gateway, cluster, {0x010C: 5}) + await send_attributes_report(zha_gateway, cluster, {"last_feeding_size": 5}) assert_state(entity, 5.0, "g") @@ -1978,7 +1978,7 @@ async def test_danfoss_thermostat_sw_error(zha_gateway: Gateway) -> None: zha_gateway, cluster, { - danfoss_thermostat.DanfossDiagnosticCluster.AttributeDefs.sw_error_code.id: 0x0001 + danfoss_thermostat.DanfossDiagnosticCluster.AttributeDefs.sw_error_code.name: 0x0001 }, )