From 78869dd41a357ecb9ba3d6109e9a8c85382923d5 Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Tue, 7 Oct 2025 18:53:04 +0200 Subject: [PATCH 1/9] Sorting --- plugwise/common.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugwise/common.py b/plugwise/common.py index 9534a2263..93640b229 100644 --- a/plugwise/common.py +++ b/plugwise/common.py @@ -145,8 +145,8 @@ def _create_gw_entities(self, appl: Munch) -> None: "model": appl.model, "model_id": appl.model_id, "name": appl.name, - "zigbee_mac_address": appl.zigbee_mac, "vendor": appl.vendor_name, + "zigbee_mac_address": appl.zigbee_mac, }.items(): if value is not None or key == "location": appl_key = cast(ApplianceType, key) From e586893911d0c768a400dc71a5aed9260c57a56d Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Wed, 8 Oct 2025 08:31:46 +0200 Subject: [PATCH 2/9] Save updated test-jsons --- tests/data/adam/adam_heatpump_cooling.json | 1 + tests/data/adam/adam_jip.json | 25 ++++++++++++--- .../adam/adam_multiple_devices_per_zone.json | 31 +++++++++++-------- .../adam_onoff_cooling_fake_firmware.json | 5 ++- tests/data/adam/adam_plus_anna.json | 5 +++ tests/data/adam/adam_plus_anna_new.json | 12 +++++-- .../adam_plus_anna_new_regulation_off.json | 12 +++++-- tests/data/adam/adam_zone_per_device.json | 5 +++ tests/data/anna/anna_elga_2.json | 1 + tests/data/anna/anna_elga_2_cooling.json | 1 + tests/data/anna/anna_elga_2_schedule_off.json | 1 + tests/data/anna/anna_elga_no_cooling.json | 1 + tests/data/anna/anna_heatpump_cooling.json | 1 + .../anna_heatpump_cooling_fake_firmware.json | 1 + tests/data/anna/anna_heatpump_heating.json | 1 + .../data/anna/anna_loria_cooling_active.json | 1 + tests/data/anna/anna_loria_driessens.json | 1 + tests/data/anna/anna_loria_heating_idle.json | 1 + tests/data/anna/anna_v4.json | 1 + tests/data/anna/anna_v4_dhw.json | 1 + tests/data/anna/anna_v4_no_tag.json | 1 + .../data/anna/anna_without_boiler_fw441.json | 1 + tests/data/p1/p1v4_442_single.json | 1 + tests/data/p1/p1v4_442_triple.json | 5 +++ tests/data/stretch/stretch_v23.json | 3 +- tests/data/stretch/stretch_v31.json | 6 ++-- 26 files changed, 98 insertions(+), 27 deletions(-) diff --git a/tests/data/adam/adam_heatpump_cooling.json b/tests/data/adam/adam_heatpump_cooling.json index 0dd1354b8..f2c18acdb 100644 --- a/tests/data/adam/adam_heatpump_cooling.json +++ b/tests/data/adam/adam_heatpump_cooling.json @@ -296,6 +296,7 @@ "model": "Gateway", "model_id": "smile_open_therm", "name": "Adam", + "notifications": {}, "regulation_modes": [ "heating", "off", diff --git a/tests/data/adam/adam_jip.json b/tests/data/adam/adam_jip.json index a0fd4ebc2..d7a90ff2e 100644 --- a/tests/data/adam/adam_jip.json +++ b/tests/data/adam/adam_jip.json @@ -2,11 +2,14 @@ "devices": { "06aecb3d00354375924f50c47af36bd2": { "active_preset": "no_frost", + "available_schedules": [], "climate_mode": "heat", "control_state": "idle", "dev_class": "climate", + "model": "ThermoZone", "name": "Slaapkamer", "preset_modes": ["home", "asleep", "away", "vacation", "no_frost"], + "select_schedule": null, "sensors": { "temperature": 24.2 }, @@ -19,15 +22,19 @@ "thermostats": { "primary": ["1346fbd8498d4dbcab7e18d51b771f3d"], "secondary": ["356b65335e274d769c338223e7af9c33"] - } + }, + "vendor": "Plugwise" }, "13228dab8ce04617af318a2888b3c548": { "active_preset": "home", + "available_schedules": [], "climate_mode": "heat", "control_state": "idle", "dev_class": "climate", + "model": "ThermoZone", "name": "Woonkamer", "preset_modes": ["home", "asleep", "away", "vacation", "no_frost"], + "select_schedule": null, "sensors": { "temperature": 27.4 }, @@ -40,7 +47,8 @@ "thermostats": { "primary": ["f61f1a2535f54f52ad006a3d18e459ca"], "secondary": ["833de10f269c4deab58fb9df69901b4e"] - } + }, + "vendor": "Plugwise" }, "1346fbd8498d4dbcab7e18d51b771f3d": { "available": true, @@ -222,6 +230,7 @@ "model": "Gateway", "model_id": "smile_open_therm", "name": "Adam", + "notifications": {}, "regulation_modes": ["heating", "off", "bleeding_cold", "bleeding_hot"], "select_gateway_mode": "full", "select_regulation_mode": "heating", @@ -233,11 +242,14 @@ }, "d27aede973b54be484f6842d1b2802ad": { "active_preset": "home", + "available_schedules": [], "climate_mode": "heat", "control_state": "idle", "dev_class": "climate", + "model": "ThermoZone", "name": "Kinderkamer", "preset_modes": ["home", "asleep", "away", "vacation", "no_frost"], + "select_schedule": null, "sensors": { "temperature": 30.0 }, @@ -250,7 +262,8 @@ "thermostats": { "primary": ["6f3e9d7084214c21b9dfa46f6eeb8700"], "secondary": ["d4496250d0e942cfa7aea3476e9070d5"] - } + }, + "vendor": "Plugwise" }, "d4496250d0e942cfa7aea3476e9070d5": { "available": true, @@ -278,11 +291,14 @@ }, "d58fec52899f4f1c92e4f8fad6d8c48c": { "active_preset": "home", + "available_schedules": [], "climate_mode": "heat", "control_state": "idle", "dev_class": "climate", + "model": "ThermoZone", "name": "Logeerkamer", "preset_modes": ["home", "asleep", "away", "vacation", "no_frost"], + "select_schedule": null, "sensors": { "temperature": 30.0 }, @@ -295,7 +311,8 @@ "thermostats": { "primary": ["a6abc6a129ee499c88a4d420cc413b47"], "secondary": ["1da4d325838e4ad8aac12177214505c9"] - } + }, + "vendor": "Plugwise" }, "e4684553153b44afbef2200885f379dc": { "available": true, diff --git a/tests/data/adam/adam_multiple_devices_per_zone.json b/tests/data/adam/adam_multiple_devices_per_zone.json index da11f37e6..e8229289d 100644 --- a/tests/data/adam/adam_multiple_devices_per_zone.json +++ b/tests/data/adam/adam_multiple_devices_per_zone.json @@ -541,6 +541,19 @@ "vendor": "Plugwise", "zigbee_mac_address": "ABCD012345670A11" }, + "e8ef2a01ed3b4139a53bf749204fe6b4": { + "dev_class": "switching", + "members": [ + "02cf28bfec924855854c544690a609ef", + "4a810418d5394b3f82727340b91ba740" + ], + "model": "Switchgroup", + "name": "Test", + "switches": { + "relay": true + }, + "vendor": "Plugwise" + }, "f1fee6043d3642a9b0a65297455f008e": { "available": true, "binary_sensors": { @@ -567,19 +580,6 @@ "vendor": "Plugwise", "zigbee_mac_address": "ABCD012345670A08" }, - "e8ef2a01ed3b4139a53bf749204fe6b4": { - "dev_class": "switching", - "members": [ - "02cf28bfec924855854c544690a609ef", - "4a810418d5394b3f82727340b91ba740" - ], - "model": "Switchgroup", - "name": "Test", - "switches": { - "relay": true - }, - "vendor": "Plugwise" - }, "fe799307f1624099878210aa0b9f1475": { "binary_sensors": { "plugwise_notification": true @@ -592,6 +592,11 @@ "model": "Gateway", "model_id": "smile_open_therm", "name": "Adam", + "notifications": { + "af82e4ccf9c548528166d38e560662a4": { + "warning": "Node Plug (with MAC address 000D6F000D13CB01, in room 'n.a.') has been unreachable since 23:03 2020-01-18. Please check the connection and restart the device." + } + }, "sensors": { "outdoor_temperature": 7.81 }, diff --git a/tests/data/adam/adam_onoff_cooling_fake_firmware.json b/tests/data/adam/adam_onoff_cooling_fake_firmware.json index 6b0a11666..218667b1e 100644 --- a/tests/data/adam/adam_onoff_cooling_fake_firmware.json +++ b/tests/data/adam/adam_onoff_cooling_fake_firmware.json @@ -50,6 +50,7 @@ "model": "Gateway", "model_id": "smile_open_therm", "name": "Adam", + "notifications": {}, "regulation_modes": [ "heating", "off", @@ -88,6 +89,7 @@ "climate_mode": "auto", "control_state": "idle", "dev_class": "climate", + "model": "ThermoZone", "name": "Woonkamer", "preset_modes": ["no_frost", "vacation", "away", "home", "asleep"], "select_schedule": "Werkdag schema", @@ -105,7 +107,8 @@ "thermostats": { "primary": ["ca79d23ae0094120b877558734cff85c"], "secondary": [] - } + }, + "vendor": "Plugwise" } } } diff --git a/tests/data/adam/adam_plus_anna.json b/tests/data/adam/adam_plus_anna.json index cf02a37e4..2bb20aa0a 100644 --- a/tests/data/adam/adam_plus_anna.json +++ b/tests/data/adam/adam_plus_anna.json @@ -85,6 +85,11 @@ "model": "Gateway", "model_id": "smile_open_therm", "name": "Adam", + "notifications": { + "6fb89e35caeb4b1cb275184895202d84": { + "error": "There is no OpenTherm communication with the boiler." + } + }, "sensors": { "outdoor_temperature": 11.9 }, diff --git a/tests/data/adam/adam_plus_anna_new.json b/tests/data/adam/adam_plus_anna_new.json index 4d1bd7dc5..c060c8082 100644 --- a/tests/data/adam/adam_plus_anna_new.json +++ b/tests/data/adam/adam_plus_anna_new.json @@ -169,6 +169,7 @@ "model": "Gateway", "model_id": "smile_open_therm", "name": "Adam", + "notifications": {}, "regulation_modes": ["bleeding_hot", "bleeding_cold", "off", "heating"], "select_gateway_mode": "full", "select_regulation_mode": "heating", @@ -214,7 +215,8 @@ "name": "Test", "switches": { "relay": true - } + }, + "vendor": "Plugwise" }, "f2bf9048bef64cc5b6d5110154e33c81": { "active_preset": "home", @@ -228,6 +230,7 @@ "climate_mode": "auto", "control_state": "heating", "dev_class": "climate", + "model": "ThermoZone", "name": "Living room", "preset_modes": ["no_frost", "asleep", "vacation", "home", "away"], "select_schedule": "Weekschema", @@ -245,7 +248,8 @@ "thermostats": { "primary": ["ad4838d7d35c4d6ea796ee12ae5aedf8"], "secondary": [] - } + }, + "vendor": "Plugwise" }, "f871b8c4d63549319221e294e4f88074": { "active_preset": "home", @@ -259,6 +263,7 @@ "climate_mode": "auto", "control_state": "preheating", "dev_class": "climate", + "model": "ThermoZone", "name": "Bathroom", "preset_modes": ["no_frost", "asleep", "vacation", "home", "away"], "select_schedule": "Badkamer", @@ -276,7 +281,8 @@ "thermostats": { "primary": ["e2f4322d57924fa090fbbc48b3a140dc"], "secondary": ["1772a4ea304041adb83f357b751341ff"] - } + }, + "vendor": "Plugwise" } } } diff --git a/tests/data/adam/adam_plus_anna_new_regulation_off.json b/tests/data/adam/adam_plus_anna_new_regulation_off.json index c4437c190..97912d874 100644 --- a/tests/data/adam/adam_plus_anna_new_regulation_off.json +++ b/tests/data/adam/adam_plus_anna_new_regulation_off.json @@ -169,6 +169,7 @@ "model": "Gateway", "model_id": "smile_open_therm", "name": "Adam", + "notifications": {}, "regulation_modes": ["bleeding_hot", "bleeding_cold", "off", "heating"], "select_gateway_mode": "full", "select_regulation_mode": "off", @@ -214,7 +215,8 @@ "name": "Test", "switches": { "relay": true - } + }, + "vendor": "Plugwise" }, "f2bf9048bef64cc5b6d5110154e33c81": { "active_preset": "home", @@ -228,6 +230,7 @@ "climate_mode": "off", "control_state": "idle", "dev_class": "climate", + "model": "ThermoZone", "name": "Living room", "preset_modes": ["no_frost", "asleep", "vacation", "home", "away"], "select_schedule": "off", @@ -245,7 +248,8 @@ "thermostats": { "primary": ["ad4838d7d35c4d6ea796ee12ae5aedf8"], "secondary": [] - } + }, + "vendor": "Plugwise" }, "f871b8c4d63549319221e294e4f88074": { "active_preset": "home", @@ -259,6 +263,7 @@ "climate_mode": "off", "control_state": "idle", "dev_class": "climate", + "model": "ThermoZone", "name": "Bathroom", "preset_modes": ["no_frost", "asleep", "vacation", "home", "away"], "select_schedule": "off", @@ -276,7 +281,8 @@ "thermostats": { "primary": ["e2f4322d57924fa090fbbc48b3a140dc"], "secondary": ["1772a4ea304041adb83f357b751341ff"] - } + }, + "vendor": "Plugwise" } } } diff --git a/tests/data/adam/adam_zone_per_device.json b/tests/data/adam/adam_zone_per_device.json index db90d8939..fcc8fa055 100644 --- a/tests/data/adam/adam_zone_per_device.json +++ b/tests/data/adam/adam_zone_per_device.json @@ -576,6 +576,11 @@ "model": "Gateway", "model_id": "smile_open_therm", "name": "Adam", + "notifications": { + "af82e4ccf9c548528166d38e560662a4": { + "warning": "Node Plug (with MAC address 000D6F000D13CB01, in room 'n.a.') has been unreachable since 23:03 2020-01-18. Please check the connection and restart the device." + } + }, "sensors": { "outdoor_temperature": 7.69 }, diff --git a/tests/data/anna/anna_elga_2.json b/tests/data/anna/anna_elga_2.json index e7a3b244b..30e96f68a 100644 --- a/tests/data/anna/anna_elga_2.json +++ b/tests/data/anna/anna_elga_2.json @@ -77,6 +77,7 @@ "model": "Gateway", "model_id": "smile_thermo", "name": "Smile Anna", + "notifications": {}, "sensors": { "outdoor_temperature": 6.38 }, diff --git a/tests/data/anna/anna_elga_2_cooling.json b/tests/data/anna/anna_elga_2_cooling.json index 064248808..fe46b6d0a 100644 --- a/tests/data/anna/anna_elga_2_cooling.json +++ b/tests/data/anna/anna_elga_2_cooling.json @@ -83,6 +83,7 @@ "model": "Gateway", "model_id": "smile_thermo", "name": "Smile Anna", + "notifications": {}, "sensors": { "outdoor_temperature": 31.0 }, diff --git a/tests/data/anna/anna_elga_2_schedule_off.json b/tests/data/anna/anna_elga_2_schedule_off.json index 132c3bcb0..4876a4416 100644 --- a/tests/data/anna/anna_elga_2_schedule_off.json +++ b/tests/data/anna/anna_elga_2_schedule_off.json @@ -83,6 +83,7 @@ "model": "Gateway", "model_id": "smile_thermo", "name": "Smile Anna", + "notifications": {}, "sensors": { "outdoor_temperature": 13.0 }, diff --git a/tests/data/anna/anna_elga_no_cooling.json b/tests/data/anna/anna_elga_no_cooling.json index 2abfc6c21..aa775140f 100644 --- a/tests/data/anna/anna_elga_no_cooling.json +++ b/tests/data/anna/anna_elga_no_cooling.json @@ -12,6 +12,7 @@ "model": "Gateway", "model_id": "smile_thermo", "name": "Smile Anna", + "notifications": {}, "sensors": { "outdoor_temperature": 20.2 }, diff --git a/tests/data/anna/anna_heatpump_cooling.json b/tests/data/anna/anna_heatpump_cooling.json index 1cb97ff31..80cf40202 100644 --- a/tests/data/anna/anna_heatpump_cooling.json +++ b/tests/data/anna/anna_heatpump_cooling.json @@ -12,6 +12,7 @@ "model": "Gateway", "model_id": "smile_thermo", "name": "Smile Anna", + "notifications": {}, "sensors": { "outdoor_temperature": 22.0 }, diff --git a/tests/data/anna/anna_heatpump_cooling_fake_firmware.json b/tests/data/anna/anna_heatpump_cooling_fake_firmware.json index ecbb51ef3..b80a30493 100644 --- a/tests/data/anna/anna_heatpump_cooling_fake_firmware.json +++ b/tests/data/anna/anna_heatpump_cooling_fake_firmware.json @@ -12,6 +12,7 @@ "model": "Gateway", "model_id": "smile_thermo", "name": "Smile Anna", + "notifications": {}, "sensors": { "outdoor_temperature": 22.0 }, diff --git a/tests/data/anna/anna_heatpump_heating.json b/tests/data/anna/anna_heatpump_heating.json index 283ad7c98..8fc5771b6 100644 --- a/tests/data/anna/anna_heatpump_heating.json +++ b/tests/data/anna/anna_heatpump_heating.json @@ -12,6 +12,7 @@ "model": "Gateway", "model_id": "smile_thermo", "name": "Smile Anna", + "notifications": {}, "sensors": { "outdoor_temperature": 20.2 }, diff --git a/tests/data/anna/anna_loria_cooling_active.json b/tests/data/anna/anna_loria_cooling_active.json index aabfa8f80..bd46b01b6 100644 --- a/tests/data/anna/anna_loria_cooling_active.json +++ b/tests/data/anna/anna_loria_cooling_active.json @@ -46,6 +46,7 @@ "model": "Gateway", "model_id": "smile_thermo", "name": "Smile Anna", + "notifications": {}, "sensors": { "outdoor_temperature": 15.5 }, diff --git a/tests/data/anna/anna_loria_driessens.json b/tests/data/anna/anna_loria_driessens.json index 34cf37733..54f6d0fb7 100644 --- a/tests/data/anna/anna_loria_driessens.json +++ b/tests/data/anna/anna_loria_driessens.json @@ -12,6 +12,7 @@ "model": "Gateway", "model_id": "smile_thermo", "name": "Smile Anna", + "notifications": {}, "sensors": { "outdoor_temperature": 6.81 }, diff --git a/tests/data/anna/anna_loria_heating_idle.json b/tests/data/anna/anna_loria_heating_idle.json index 2790624f6..8eaee922f 100644 --- a/tests/data/anna/anna_loria_heating_idle.json +++ b/tests/data/anna/anna_loria_heating_idle.json @@ -46,6 +46,7 @@ "model": "Gateway", "model_id": "smile_thermo", "name": "Smile Anna", + "notifications": {}, "sensors": { "outdoor_temperature": 15.5 }, diff --git a/tests/data/anna/anna_v4.json b/tests/data/anna/anna_v4.json index bcda4c000..8cd59b72e 100644 --- a/tests/data/anna/anna_v4.json +++ b/tests/data/anna/anna_v4.json @@ -44,6 +44,7 @@ "model": "Gateway", "model_id": "smile_thermo", "name": "Smile Anna", + "notifications": {}, "sensors": { "outdoor_temperature": 7.44 }, diff --git a/tests/data/anna/anna_v4_dhw.json b/tests/data/anna/anna_v4_dhw.json index 783fdf1f8..08488701c 100644 --- a/tests/data/anna/anna_v4_dhw.json +++ b/tests/data/anna/anna_v4_dhw.json @@ -44,6 +44,7 @@ "model": "Gateway", "model_id": "smile_thermo", "name": "Smile Anna", + "notifications": {}, "sensors": { "outdoor_temperature": 7.44 }, diff --git a/tests/data/anna/anna_v4_no_tag.json b/tests/data/anna/anna_v4_no_tag.json index 37da0174e..7a4a80705 100644 --- a/tests/data/anna/anna_v4_no_tag.json +++ b/tests/data/anna/anna_v4_no_tag.json @@ -44,6 +44,7 @@ "model": "Gateway", "model_id": "smile_thermo", "name": "Smile Anna", + "notifications": {}, "sensors": { "outdoor_temperature": 7.44 }, diff --git a/tests/data/anna/anna_without_boiler_fw441.json b/tests/data/anna/anna_without_boiler_fw441.json index ebd3a07ad..89d3dc41e 100644 --- a/tests/data/anna/anna_without_boiler_fw441.json +++ b/tests/data/anna/anna_without_boiler_fw441.json @@ -44,6 +44,7 @@ "model": "Gateway", "model_id": "smile_thermo", "name": "Smile Anna", + "notifications": {}, "sensors": { "outdoor_temperature": 8.31 }, diff --git a/tests/data/p1/p1v4_442_single.json b/tests/data/p1/p1v4_442_single.json index bd4397c85..b98202b42 100644 --- a/tests/data/p1/p1v4_442_single.json +++ b/tests/data/p1/p1v4_442_single.json @@ -12,6 +12,7 @@ "model": "Gateway", "model_id": "smile", "name": "Smile P1", + "notifications": {}, "vendor": "Plugwise" }, "ba4de7613517478da82dd9b6abea36af": { diff --git a/tests/data/p1/p1v4_442_triple.json b/tests/data/p1/p1v4_442_triple.json index f455c5bad..62d4def33 100644 --- a/tests/data/p1/p1v4_442_triple.json +++ b/tests/data/p1/p1v4_442_triple.json @@ -12,6 +12,11 @@ "model": "Gateway", "model_id": "smile", "name": "Smile P1", + "notifications": { + "97a04c0c263049b29350a660b4cdd01e": { + "warning": "The Smile P1 is not connected to a smart meter." + } + }, "vendor": "Plugwise" }, "b82b6b3322484f2ea4e25e0bd5f3d61f": { diff --git a/tests/data/stretch/stretch_v23.json b/tests/data/stretch/stretch_v23.json index f0b951d7f..6b0c67708 100644 --- a/tests/data/stretch/stretch_v23.json +++ b/tests/data/stretch/stretch_v23.json @@ -310,7 +310,8 @@ "name": "Test", "switches": { "relay": false - } + }, + "vendor": "Plugwise" }, "fd1b74f59e234a9dae4e23b2b5cf07ed": { "dev_class": "dryer", diff --git a/tests/data/stretch/stretch_v31.json b/tests/data/stretch/stretch_v31.json index a1228049c..a4a0b7b1d 100644 --- a/tests/data/stretch/stretch_v31.json +++ b/tests/data/stretch/stretch_v31.json @@ -96,7 +96,8 @@ "name": "Schakel", "switches": { "relay": true - } + }, + "vendor": "Plugwise" }, "d950b314e9d8499f968e6db8d82ef78c": { "dev_class": "report", @@ -111,7 +112,8 @@ "name": "Stroomvreters", "switches": { "relay": true - } + }, + "vendor": "Plugwise" }, "e1c884e7dede431dadee09506ec4f859": { "dev_class": "refrigerator", From 9afb36830fe82060ef3228e444f169c9d81094fa Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Wed, 8 Oct 2025 08:43:20 +0200 Subject: [PATCH 3/9] Save entity test-asserts for adam_plus_anna_new --- tests/test_adam.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_adam.py b/tests/test_adam.py index da6449ac0..0928feeb3 100644 --- a/tests/test_adam.py +++ b/tests/test_adam.py @@ -36,7 +36,7 @@ async def test_connect_adam_plus_anna_new(self): assert api.gateway_id == "da224107914542988a88561b4452b0f6" assert api._last_active["f2bf9048bef64cc5b6d5110154e33c81"] == "Weekschema" assert api._last_active["f871b8c4d63549319221e294e4f88074"] == "Badkamer" - assert self.entity_items == 178 + assert self.entity_items == 178 # 183 assert self.entity_list == [ "da224107914542988a88561b4452b0f6", "056ee145a816487eaa69243c3280f8bf", From 4a864d67a9b6fb80880065941fcbe69c761ecf75 Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Wed, 8 Oct 2025 13:28:49 +0200 Subject: [PATCH 4/9] Correct wrong counts --- plugwise/common.py | 2 +- plugwise/helper.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/plugwise/common.py b/plugwise/common.py index 93640b229..69ed227c8 100644 --- a/plugwise/common.py +++ b/plugwise/common.py @@ -205,7 +205,7 @@ def _get_group_switches(self) -> dict[str, GwEntityData]: "members": members, "vendor": "Plugwise", } - self._count += 4 + self._count += 5 return switch_groups diff --git a/plugwise/helper.py b/plugwise/helper.py index 49c96fcdd..7ebb4738b 100644 --- a/plugwise/helper.py +++ b/plugwise/helper.py @@ -721,7 +721,7 @@ def _scan_thermostats(self) -> None: }, "vendor": "Plugwise", } - self._count += 3 + self._count += 5 def _match_locations(self) -> dict[str, ThermoLoc]: """Helper-function for _scan_thermostats(). From ae360d5c8ac44fb405f7eab12f3cbdf837a621f0 Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Wed, 8 Oct 2025 18:09:24 +0200 Subject: [PATCH 5/9] Update adam entity_count asserts --- tests/test_adam.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/test_adam.py b/tests/test_adam.py index 0928feeb3..4a6268cdf 100644 --- a/tests/test_adam.py +++ b/tests/test_adam.py @@ -36,7 +36,7 @@ async def test_connect_adam_plus_anna_new(self): assert api.gateway_id == "da224107914542988a88561b4452b0f6" assert api._last_active["f2bf9048bef64cc5b6d5110154e33c81"] == "Weekschema" assert api._last_active["f871b8c4d63549319221e294e4f88074"] == "Badkamer" - assert self.entity_items == 178 # 183 + assert self.entity_items == 183 assert self.entity_list == [ "da224107914542988a88561b4452b0f6", "056ee145a816487eaa69243c3280f8bf", @@ -217,7 +217,7 @@ async def test_connect_adam_zone_per_device(self): assert api._last_active["82fa13f017d240daa0d0ea1775420f24"] == CV_JESSIE assert api._last_active["08963fec7c53423ca5680aa4cb502c63"] == BADKAMER_SCHEMA assert api._last_active["446ac08dd04d4eff8ac57489757b7314"] == BADKAMER_SCHEMA - assert self.entity_items == 369 + assert self.entity_items == 379 assert "af82e4ccf9c548528166d38e560662a4" in self.notifications await api.delete_notification() @@ -295,7 +295,7 @@ async def test_connect_adam_multiple_devices_per_zone(self): assert api._last_active["82fa13f017d240daa0d0ea1775420f24"] == CV_JESSIE assert api._last_active["08963fec7c53423ca5680aa4cb502c63"] == BADKAMER_SCHEMA assert api._last_active["446ac08dd04d4eff8ac57489757b7314"] == BADKAMER_SCHEMA - assert self.entity_items == 374 + assert self.entity_items == 385 assert "af82e4ccf9c548528166d38e560662a4" in self.notifications @@ -341,7 +341,7 @@ async def test_adam_heatpump_cooling(self): assert api._last_active["a562019b0b1f47a4bde8ebe3dbe3e8a9"] == WERKDAG_SCHEMA assert api._last_active["8cf650a4c10c44819e426bed406aec34"] == WERKDAG_SCHEMA assert api._last_active["5cc21042f87f4b4c94ccb5537c47a53f"] == WERKDAG_SCHEMA - assert self.entity_items == 498 + assert self.entity_items == 518 assert self.cooling_present assert self._cooling_enabled @@ -364,7 +364,7 @@ async def test_connect_adam_onoff_cooling_fake_firmware(self): ) await self.device_test(api, "2022-01-02 00:00:01", testdata) - assert self.entity_items == 65 + assert self.entity_items == 67 assert self.cooling_present # assert self._cooling_enabled - no cooling_enabled indication present @@ -389,7 +389,7 @@ async def test_connect_adam_plus_anna(self): await self.device_test(api, "2020-03-22 00:00:01", testdata) assert api.gateway_id == "b128b4bbbd1f47e9bf4d756e8fb5ee94" assert api._last_active["009490cc2f674ce6b576863fbb64f867"] == "Weekschema" - assert self.entity_items == 80 + assert self.entity_items == 82 assert "6fb89e35caeb4b1cb275184895202d84" in self.notifications result = await self.tinker_thermostat( @@ -433,7 +433,7 @@ async def test_adam_plus_jip(self): assert api._last_active["06aecb3d00354375924f50c47af36bd2"] is None assert api._last_active["d27aede973b54be484f6842d1b2802ad"] is None assert api._last_active["13228dab8ce04617af318a2888b3c548"] is None - assert self.entity_items == 253 + assert self.entity_items == 261 # Negative test result = await self.tinker_thermostat( From 433a6d3367fe9a4309c57b82cc844e2081668bb4 Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Wed, 8 Oct 2025 18:21:28 +0200 Subject: [PATCH 6/9] legacy-data: add missing _count --- plugwise/legacy/data.py | 1 + 1 file changed, 1 insertion(+) diff --git a/plugwise/legacy/data.py b/plugwise/legacy/data.py index 823bc8991..c5cde29a7 100644 --- a/plugwise/legacy/data.py +++ b/plugwise/legacy/data.py @@ -84,6 +84,7 @@ def _climate_data(self, entity: GwEntityData, data: GwEntityData) -> None: def _get_anna_control_state(self, data: GwEntityData) -> None: """Set the thermostat control_state based on the opentherm/onoff device state.""" data["control_state"] = "idle" + self._count += 1 for entity in self.gw_entities.values(): if entity["dev_class"] != "heater_central": continue From 60e901d722783edef91f7a5557cb3a78c07418e7 Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Wed, 8 Oct 2025 18:55:33 +0200 Subject: [PATCH 7/9] Update legacy_anna entity_count asserts --- tests/test_legacy_anna.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test_legacy_anna.py b/tests/test_legacy_anna.py index dbe461d91..bf12e143c 100644 --- a/tests/test_legacy_anna.py +++ b/tests/test_legacy_anna.py @@ -30,7 +30,7 @@ async def test_connect_legacy_anna(self): await self.device_test(api, "2020-03-22 00:00:01", testdata) assert api.gateway_id == "0000aaaa0000aaaa0000aaaa0000aa00" - assert self.entity_items == 43 + assert self.entity_items == 44 assert not api.reboot result = await self.tinker_legacy_thermostat(api, schedule_on=False) @@ -65,7 +65,7 @@ async def test_connect_legacy_anna_2(self): await self.device_test(api, "2020-05-03 00:00:01", testdata) assert api.gateway_id == "be81e3f8275b4129852c4d8d550ae2eb" - assert self.entity_items == 43 + assert self.entity_items == 44 result = await self.tinker_legacy_thermostat(api) assert result From 58ea5ecf5ae011422f677d869e8b3711cd45bc6e Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Wed, 8 Oct 2025 18:56:46 +0200 Subject: [PATCH 8/9] Update stretch entity_count asserts --- tests/test_legacy_stretch.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test_legacy_stretch.py b/tests/test_legacy_stretch.py index 95d442e0c..764453162 100644 --- a/tests/test_legacy_stretch.py +++ b/tests/test_legacy_stretch.py @@ -29,7 +29,7 @@ async def test_connect_stretch_v31(self): await self.device_test(api, "2022-05-16 00:00:01", testdata) assert api.gateway_id == "0000aaaa0000aaaa0000aaaa0000aa00" - assert self.entity_items == 83 + assert self.entity_items == 85 switch_change = await self.tinker_switch( api, @@ -68,7 +68,7 @@ async def test_connect_stretch_v23(self): ) await self.device_test(api, "2022-05-16 00:00:01", testdata) - assert self.entity_items == 243 + assert self.entity_items == 244 switch_change = await self.tinker_switch( api, "2587a7fcdd7e482dab03fda256076b4b" From d8e45bd0a5be11af85bc213bc9971b0f613f0513 Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Wed, 8 Oct 2025 19:14:43 +0200 Subject: [PATCH 9/9] Update CHANGELOG --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9501fb947..46cb72d9a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## Ongoing - Test/validate for Python 3.14 +- Fix entity_item counting, refresh/complete test-data-json files via [#794](https://github.com/plugwise/python-plugwise/pull/794) ## v1.7.8