From b1ac1a5e2f852b68575d8502ea367b32926f0175 Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Mon, 15 Dec 2025 09:44:37 +0100 Subject: [PATCH 01/99] _all_appliances(): reorder code, all checks first --- plugwise/helper.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/plugwise/helper.py b/plugwise/helper.py index 88d80e8b6..6fcc28c54 100644 --- a/plugwise/helper.py +++ b/plugwise/helper.py @@ -151,7 +151,14 @@ def _get_appliances(self) -> None: extend_plug_device_class(appl, appliance) + # Extend device_class name of Plugs (Plugwise and Aqara) - Pw-Beta Issue #739 + description = appliance.find("description").text + if description is not None and ( + "ZigBee protocol" in description or "smart plug" in description + ): + appl.pwclass = f"{appl.pwclass}_plug" # Collect appliance info, skip orphaned/removed devices + if not (appl := self._appliance_info_finder(appl, appliance)): continue From 8520203ffc0a00bcdd2052679a95e229555ad0f4 Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Mon, 15 Dec 2025 13:57:34 +0100 Subject: [PATCH 02/99] More reordering, improvements --- plugwise/helper.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/plugwise/helper.py b/plugwise/helper.py index 6fcc28c54..05fd6285a 100644 --- a/plugwise/helper.py +++ b/plugwise/helper.py @@ -145,7 +145,7 @@ def _get_appliances(self) -> None: elif appl.pwclass not in THERMOSTAT_CLASSES: appl.location = self._home_loc_id - # Don't show orphaned thermostat-types + # Don't show orphaned (no location) thermostat-types if appl.pwclass in THERMOSTAT_CLASSES and appl.location is None: continue @@ -157,8 +157,8 @@ def _get_appliances(self) -> None: "ZigBee protocol" in description or "smart plug" in description ): appl.pwclass = f"{appl.pwclass}_plug" - # Collect appliance info, skip orphaned/removed devices + # Collect appliance info, skip orphaned/removed devices if not (appl := self._appliance_info_finder(appl, appliance)): continue @@ -166,13 +166,13 @@ def _get_appliances(self) -> None: # A smartmeter is not present as an appliance, add it specifically if self.smile.type == "power" or self.smile.anna_p1: - self._get_p1_smartmeter_info() + self._add_p1_smartmeter_info() # Sort the gw_entities self._reorder_devices() - def _get_p1_smartmeter_info(self) -> None: - """For P1 collect the connected SmartMeter info from the Home/building location. + def _add_p1_smartmeter_info(self) -> None: + """For P1 collect the smartmeter info from the Home/building location and add it as an entity. Note: For P1, the entity_id for the gateway and smartmeter are switched to maintain backward compatibility. For Anna P1, the smartmeter uses the home location_id directly. From 9ada3a731d44b079154396e387f08701eb203704 Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Mon, 15 Dec 2025 17:30:46 +0100 Subject: [PATCH 03/99] Try --- plugwise/helper.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/plugwise/helper.py b/plugwise/helper.py index 05fd6285a..b4fbef161 100644 --- a/plugwise/helper.py +++ b/plugwise/helper.py @@ -85,6 +85,8 @@ class SmileHelper(SmileCommon): def __init__(self) -> None: """Set the constructor for this class.""" super().__init__() + self._existing_appliances: list[str] = [] + self._new_appliances: list[str] = [] self._endpoint: str self._elga: bool self._is_thermostat: bool @@ -162,14 +164,23 @@ def _get_appliances(self) -> None: if not (appl := self._appliance_info_finder(appl, appliance)): continue + if appl.entity_id in self._existing_appliances: + continue + else: + self._new_appliances.append(appl.entity_id) + self._create_gw_entities(appl) + if not self._new_appliances: + return False + # A smartmeter is not present as an appliance, add it specifically if self.smile.type == "power" or self.smile.anna_p1: self._add_p1_smartmeter_info() # Sort the gw_entities self._reorder_devices() + return True def _add_p1_smartmeter_info(self) -> None: """For P1 collect the smartmeter info from the Home/building location and add it as an entity. From c49f00ac0d035fc99424850211ac5b5121e24c24 Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Mon, 15 Dec 2025 17:36:04 +0100 Subject: [PATCH 04/99] Try 2 --- plugwise/helper.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plugwise/helper.py b/plugwise/helper.py index b4fbef161..12a313556 100644 --- a/plugwise/helper.py +++ b/plugwise/helper.py @@ -165,6 +165,7 @@ def _get_appliances(self) -> None: continue if appl.entity_id in self._existing_appliances: + self._new_appliances.append((appl.entity_id)) continue else: self._new_appliances.append(appl.entity_id) @@ -180,6 +181,9 @@ def _get_appliances(self) -> None: # Sort the gw_entities self._reorder_devices() + + self._existing_appliances = self._new_appliances + self._new_appliances = [] return True def _add_p1_smartmeter_info(self) -> None: From d3ede2dc0942d36de14ef7a382fab86a6158c517 Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Mon, 15 Dec 2025 17:37:29 +0100 Subject: [PATCH 05/99] Try 3 --- plugwise/smile.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/plugwise/smile.py b/plugwise/smile.py index d6c10f826..a9d677e4b 100644 --- a/plugwise/smile.py +++ b/plugwise/smile.py @@ -88,6 +88,9 @@ def __init__( self.smile = smile self.therms_with_offset_func: list[str] = [] + self._zones = {} + self.gw_entities = {} + @property def cooling_present(self) -> bool: """Return the cooling capability.""" @@ -121,8 +124,6 @@ async def async_update(self) -> dict[str, GwEntityData]: Any change in the connected entities will be detected immediately. """ - self._zones = {} - self.gw_entities = {} try: await self.full_xml_update() self.get_all_gateway_entities() From 1c13c3b437151c1f7c720910de030625d0e67896 Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Mon, 15 Dec 2025 17:42:04 +0100 Subject: [PATCH 06/99] Try 4 --- plugwise/smile.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/plugwise/smile.py b/plugwise/smile.py index a9d677e4b..196ef5308 100644 --- a/plugwise/smile.py +++ b/plugwise/smile.py @@ -109,11 +109,11 @@ def get_all_gateway_entities(self) -> None: Collect and add switching- and/or pump-group entities. Finally, collect the data and states for each entity. """ - self._get_appliances() - if self._is_thermostat: - self.therms_with_offset_func = ( - self._get_appliances_with_offset_functionality() - ) + if self._all_appliances(): + if self._is_thermostat: + self.therms_with_offset_func = ( + self._get_appliances_with_offset_functionality() + ) self._scan_thermostats() self._get_groups() From fd1aeddf5d41982a3250f958fdad7a9f10dd0750 Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Mon, 15 Dec 2025 17:50:32 +0100 Subject: [PATCH 07/99] Debug --- plugwise/helper.py | 1 + 1 file changed, 1 insertion(+) diff --git a/plugwise/helper.py b/plugwise/helper.py index 12a313556..d50b48a97 100644 --- a/plugwise/helper.py +++ b/plugwise/helper.py @@ -182,6 +182,7 @@ def _get_appliances(self) -> None: # Sort the gw_entities self._reorder_devices() + LOGGER.debug("HOI new: %s", self._new_appliances) self._existing_appliances = self._new_appliances self._new_appliances = [] return True From 54d768d8524be711c5af7d9c77d1b59c182ae602 Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Mon, 15 Dec 2025 17:52:53 +0100 Subject: [PATCH 08/99] Try 5 --- plugwise/helper.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/plugwise/helper.py b/plugwise/helper.py index d50b48a97..e8509001f 100644 --- a/plugwise/helper.py +++ b/plugwise/helper.py @@ -172,7 +172,7 @@ def _get_appliances(self) -> None: self._create_gw_entities(appl) - if not self._new_appliances: + if self._existing_appliances == self._new_appliances: return False # A smartmeter is not present as an appliance, add it specifically @@ -182,7 +182,6 @@ def _get_appliances(self) -> None: # Sort the gw_entities self._reorder_devices() - LOGGER.debug("HOI new: %s", self._new_appliances) self._existing_appliances = self._new_appliances self._new_appliances = [] return True From 041cb50e749cd9849f6f0609ebd27b5d568a109c Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Mon, 15 Dec 2025 17:55:40 +0100 Subject: [PATCH 09/99] Try 6 --- plugwise/helper.py | 2 ++ plugwise/smile.py | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/plugwise/helper.py b/plugwise/helper.py index e8509001f..ba60ece05 100644 --- a/plugwise/helper.py +++ b/plugwise/helper.py @@ -172,6 +172,8 @@ def _get_appliances(self) -> None: self._create_gw_entities(appl) + LOGGER.debug("HOI existing: %s", self._existing_appliances) + LOGGER.debug("HOI new: %s", self._new_appliances) if self._existing_appliances == self._new_appliances: return False diff --git a/plugwise/smile.py b/plugwise/smile.py index 196ef5308..5659fb2ee 100644 --- a/plugwise/smile.py +++ b/plugwise/smile.py @@ -109,7 +109,9 @@ def get_all_gateway_entities(self) -> None: Collect and add switching- and/or pump-group entities. Finally, collect the data and states for each entity. """ - if self._all_appliances(): + if not self._all_appliances(): + LOGGER.debug("HOI no new appliances found, skipping") + else: if self._is_thermostat: self.therms_with_offset_func = ( self._get_appliances_with_offset_functionality() From 648a8ac3883021d4f2e64ff96f7c7b49814a4ab8 Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Mon, 15 Dec 2025 18:34:46 +0100 Subject: [PATCH 10/99] Try 7 --- plugwise/helper.py | 5 ++++- plugwise/smile.py | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/plugwise/helper.py b/plugwise/helper.py index ba60ece05..cf724f315 100644 --- a/plugwise/helper.py +++ b/plugwise/helper.py @@ -174,7 +174,10 @@ def _get_appliances(self) -> None: LOGGER.debug("HOI existing: %s", self._existing_appliances) LOGGER.debug("HOI new: %s", self._new_appliances) - if self._existing_appliances == self._new_appliances: + if self._existing_appliances and not ( + set(self._new_appliances) <= set(self._existing_appliances) + ): + LOGGER.debug("HOI unknown appliance(s) found.") return False # A smartmeter is not present as an appliance, add it specifically diff --git a/plugwise/smile.py b/plugwise/smile.py index 5659fb2ee..abbd060b7 100644 --- a/plugwise/smile.py +++ b/plugwise/smile.py @@ -16,6 +16,7 @@ DOMAIN_OBJECTS, GATEWAY_REBOOT, LOCATIONS, + LOGGER, MAX_SETPOINT, MIN_SETPOINT, NONE, From d31421adb85657e8dc2a3c7751acb60b6eb6a351 Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Mon, 15 Dec 2025 18:58:58 +0100 Subject: [PATCH 11/99] Update updates/adam_plus_anna_new-xml --- plugwise/helper.py | 8 ++++---- plugwise/smile.py | 4 +++- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/plugwise/helper.py b/plugwise/helper.py index cf724f315..11cebf35c 100644 --- a/plugwise/helper.py +++ b/plugwise/helper.py @@ -174,10 +174,10 @@ def _get_appliances(self) -> None: LOGGER.debug("HOI existing: %s", self._existing_appliances) LOGGER.debug("HOI new: %s", self._new_appliances) - if self._existing_appliances and not ( - set(self._new_appliances) <= set(self._existing_appliances) - ): - LOGGER.debug("HOI unknown appliance(s) found.") + is_subset = set(self._new_appliances) <= set(self._existing_appliances) + LOGGER.debug("HOI is_subset: %s", is_subset) + if self._existing_appliances and is_subset: + LOGGER.debug("HOI no unknown appliance(s) found.") return False # A smartmeter is not present as an appliance, add it specifically diff --git a/plugwise/smile.py b/plugwise/smile.py index abbd060b7..a7805ef7d 100644 --- a/plugwise/smile.py +++ b/plugwise/smile.py @@ -110,7 +110,9 @@ def get_all_gateway_entities(self) -> None: Collect and add switching- and/or pump-group entities. Finally, collect the data and states for each entity. """ - if not self._all_appliances(): + execute = self._all_appliances() + LOGGER.debug("HOI self._all_appliances() = %s", execute) + if not execute: LOGGER.debug("HOI no new appliances found, skipping") else: if self._is_thermostat: From 4bd4a5dfeac251482c4cae21988a2bc8bddc3b74 Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Tue, 16 Dec 2025 08:38:41 +0100 Subject: [PATCH 12/99] Store module_id for future use --- plugwise/common.py | 5 +++++ plugwise/constants.py | 3 +++ plugwise/helper.py | 2 ++ 3 files changed, 10 insertions(+) diff --git a/plugwise/common.py b/plugwise/common.py index 1024c8218..95291f08f 100644 --- a/plugwise/common.py +++ b/plugwise/common.py @@ -116,6 +116,7 @@ def _appl_heater_central_info( appl.model = ( "Generic heater/cooler" if self._cooling_present else "Generic heater" ) + appl.module_id = module_data["module_id"] return appl @@ -140,6 +141,7 @@ def _appl_thermostat_info( appl.available = module_data["reachable"] appl.hardware = module_data["hardware_version"] appl.firmware = module_data["firmware_version"] + appl.module_id = module_data["module_id"] appl.zigbee_mac = module_data["zigbee_mac_address"] return appl @@ -156,6 +158,7 @@ def _create_gw_entities(self, appl: Munch) -> None: "mac_address": appl.mac, "model": appl.model, "model_id": appl.model_id, + "module_id": appl.module_id, "name": appl.name, "vendor": appl.vendor_name, "zigbee_mac_address": appl.zigbee_mac, @@ -252,6 +255,7 @@ def _get_module_data( "contents": False, "firmware_version": None, "hardware_version": None, + "module_id": None, "reachable": None, "vendor_name": None, "vendor_model": None, @@ -275,6 +279,7 @@ def _get_module_data( module_data["vendor_model"] = module.find("vendor_model").text module_data["hardware_version"] = module.find("hardware_version").text module_data["firmware_version"] = module.find("firmware_version").text + module_data["module_id"] = module.attrib["id"] get_zigbee_data(module, module_data, legacy) break diff --git a/plugwise/constants.py b/plugwise/constants.py index 267f2cbdb..bd1531214 100644 --- a/plugwise/constants.py +++ b/plugwise/constants.py @@ -294,6 +294,7 @@ "members", "model", "model_id", + "module_id", "name", "vendor", "zigbee_mac_address", @@ -425,6 +426,7 @@ class ModuleData(TypedDict): contents: bool firmware_version: str | None hardware_version: str | None + module_id: str | None reachable: bool | None vendor_model: str | None vendor_name: str | None @@ -547,6 +549,7 @@ class GwEntityData(TypedDict, total=False): members: list[str] model: str model_id: str | None + module_id: str | None name: str vendor: str zigbee_mac_address: str diff --git a/plugwise/helper.py b/plugwise/helper.py index 11cebf35c..f8d20bf92 100644 --- a/plugwise/helper.py +++ b/plugwise/helper.py @@ -215,6 +215,7 @@ def _add_p1_smartmeter_info(self) -> None: appl.mac = None appl.model = module_data["vendor_model"] appl.model_id = None # don't use model_id for SmartMeter + appl.module_id = module_data["module_id"] appl.name = "P1" appl.pwclass = "smartmeter" appl.vendor_name = module_data["vendor_name"] @@ -290,6 +291,7 @@ def _appliance_info_finder(self, appl: Munch, appliance: etree.Element) -> Munch appl.firmware = module_data["firmware_version"] appl.hardware = module_data["hardware_version"] appl.model_id = module_data["vendor_model"] + appl.module_id = module_data["module_id"] appl.vendor_name = module_data["vendor_name"] appl.model = check_model(appl.model_id, appl.vendor_name) appl.zigbee_mac = module_data["zigbee_mac_address"] From a243a2eefc89a109c8b937d677f5c6fe47806899 Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Tue, 16 Dec 2025 08:44:39 +0100 Subject: [PATCH 13/99] Increase entity_items assert --- 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 8484d56d7..e47b3db18 100644 --- a/tests/test_adam.py +++ b/tests/test_adam.py @@ -34,7 +34,7 @@ async def test_connect_adam_plus_anna_new(self): test_items = await self.device_test(api, "2025-10-12 00:00:01", testdata) assert api.gateway_id == "da224107914542988a88561b4452b0f6" - assert self.entity_items == 230 + assert self.entity_items == 241 assert test_items == self.entity_items assert self.entity_list == [ "da224107914542988a88561b4452b0f6", From 3aaa8a16fc0514ad7d76f62ee8f4bdbcf65edb61 Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Tue, 16 Dec 2025 08:47:45 +0100 Subject: [PATCH 14/99] Update test-json --- tests/data/adam/adam_plus_anna_new.json | 60 +++++++++++++++++++++---- 1 file changed, 52 insertions(+), 8 deletions(-) diff --git a/tests/data/adam/adam_plus_anna_new.json b/tests/data/adam/adam_plus_anna_new.json index cf8e4ab56..37d51b261 100644 --- a/tests/data/adam/adam_plus_anna_new.json +++ b/tests/data/adam/adam_plus_anna_new.json @@ -15,6 +15,7 @@ "upper_bound": 95.0 }, "model": "Generic heater", + "module_id": "c043b48fa65b4292b5579d5550f19dd2", "name": "OpenTherm", "sensors": { "intended_boiler_temperature": 22.5, @@ -29,6 +30,7 @@ "dev_class": "valve_actuator_plug", "location": "d9786723dbcf4f19b5c629a54629f9c7", "model_id": "TS0011", + "module_id": "c1f98356f09346b28e26a6ebc0f69275", "name": "Aanvoer water afsluiter (nous lz3)", "switches": { "relay": false @@ -46,6 +48,7 @@ "location": "f2bf9048bef64cc5b6d5110154e33c81", "model": "Emma Pro", "model_id": "170-01", + "module_id": "85e363f2d0234f13885d41acd77ce6b8", "name": "Emma", "sensors": { "battery": 100, @@ -73,6 +76,7 @@ "location": "f871b8c4d63549319221e294e4f88074", "model": "Tom", "model_id": "106-03", + "module_id": "86937b43514d44e090903d72e53d01b3", "name": "Tom Badkamer", "sensors": { "battery": 60, @@ -97,6 +101,7 @@ "location": "f2bf9048bef64cc5b6d5110154e33c81", "model": "Plug", "model_id": "160-01", + "module_id": "fe0bb67baa774960a41ca3148137d646", "name": "Plug MediaTV", "sensors": { "electricity_consumed": 15.8, @@ -118,6 +123,7 @@ "location": "8201a2ac4d1b4303bf994e18d67311eb", "model": "Plug", "model_id": "160-01", + "module_id": "118ccd70e8fa4b1fa746c504a47d95e0", "name": "Plug Thermex Boiler", "sensors": { "electricity_consumed": 0.69, @@ -138,6 +144,7 @@ "location": "b4f211175e124df59603412bafa77a34", "model": "Aqara Smart Plug", "model_id": "lumi.plug.maeu01", + "module_id": "6fe74ec044bd44d88ac0412df67f188f", "name": "SmartPlug Floor 0", "sensors": { "electricity_consumed_interval": 0.0 @@ -156,6 +163,7 @@ "location": "f2bf9048bef64cc5b6d5110154e33c81", "model": "Plug", "model_id": "160-01", + "module_id": "0251fb339b564a378009fcc3049f023c", "name": "Plug Vloerverwarming", "sensors": { "electricity_consumed": 45.0, @@ -174,6 +182,7 @@ "location": "f2bf9048bef64cc5b6d5110154e33c81", "model": "ThermoTouch", "model_id": "143.1", + "module_id": "f7727a516f974a7e8bf8ae95b4531a7a", "name": "Anna", "sensors": { "setpoint": 20.5, @@ -202,7 +211,11 @@ }, "dev_class": "gateway", "firmware": "3.9.0", - "gateway_modes": ["away", "full", "vacation"], + "gateway_modes": [ + "away", + "full", + "vacation" + ], "hardware": "AME Smile 2.0 board", "location": "bc93488efab249e5bc54fd7e175a6f91", "mac_address": "D40FB201CBA0", @@ -210,7 +223,12 @@ "model_id": "smile_open_therm", "name": "Adam", "notifications": {}, - "regulation_modes": ["bleeding_cold", "heating", "off", "bleeding_hot"], + "regulation_modes": [ + "bleeding_cold", + "heating", + "off", + "bleeding_hot" + ], "select_gateway_mode": "full", "select_regulation_mode": "heating", "sensors": { @@ -230,6 +248,7 @@ "location": "f2bf9048bef64cc5b6d5110154e33c81", "model": "Jip", "model_id": "168-01", + "module_id": "702e95f0db7246bf831bad9fec7a68ff", "name": "Jip", "sensors": { "battery": 100, @@ -251,6 +270,7 @@ "location": "f871b8c4d63549319221e294e4f88074", "model": "Lisa", "model_id": "158-01", + "module_id": "a9df3f54db5d4c0c84b6bf6804d41632", "name": "Lisa Badkamer", "sensors": { "battery": 71, @@ -297,7 +317,13 @@ "dev_class": "climate", "model": "ThermoZone", "name": "Living room", - "preset_modes": ["vacation", "no_frost", "asleep", "home", "away"], + "preset_modes": [ + "vacation", + "no_frost", + "asleep", + "home", + "away" + ], "select_schedule": "Weekschema", "select_zone_profile": "active", "sensors": { @@ -320,7 +346,11 @@ "secondary": [] }, "vendor": "Plugwise", - "zone_profiles": ["active", "off", "passive"] + "zone_profiles": [ + "active", + "off", + "passive" + ] }, "f871b8c4d63549319221e294e4f88074": { "active_preset": "vacation", @@ -336,7 +366,13 @@ "dev_class": "climate", "model": "ThermoZone", "name": "Bathroom", - "preset_modes": ["vacation", "no_frost", "asleep", "home", "away"], + "preset_modes": [ + "vacation", + "no_frost", + "asleep", + "home", + "away" + ], "select_schedule": "off", "select_zone_profile": "passive", "sensors": { @@ -351,10 +387,18 @@ "upper_bound": 99.9 }, "thermostats": { - "primary": ["e2f4322d57924fa090fbbc48b3a140dc"], - "secondary": ["1772a4ea304041adb83f357b751341ff"] + "primary": [ + "e2f4322d57924fa090fbbc48b3a140dc" + ], + "secondary": [ + "1772a4ea304041adb83f357b751341ff" + ] }, "vendor": "Plugwise", - "zone_profiles": ["active", "off", "passive"] + "zone_profiles": [ + "active", + "off", + "passive" + ] } } From 8ae8dc6b38b8ae707e84da74c777ad0b74350e09 Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Tue, 16 Dec 2025 08:54:14 +0100 Subject: [PATCH 15/99] Starting... --- plugwise/data.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plugwise/data.py b/plugwise/data.py index fc45138fb..cca132f47 100644 --- a/plugwise/data.py +++ b/plugwise/data.py @@ -196,6 +196,10 @@ def _get_entity_data(self, entity_id: str, entity: GwEntityData) -> None: entity, "heater_central", "no OpenTherm communication" ) + if "module_id" ind entity: + locator = "module/protocolszig_bee_node" + + # Switching groups data self._entity_switching_group(entity) # Adam data From 01cee358ad95321569e8d471506654ac90bca82e Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Tue, 16 Dec 2025 10:54:27 +0100 Subject: [PATCH 16/99] Update zigbee reachable status --- plugwise/data.py | 6 ++---- plugwise/helper.py | 8 ++++++++ 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/plugwise/data.py b/plugwise/data.py index cca132f47..12f10a510 100644 --- a/plugwise/data.py +++ b/plugwise/data.py @@ -195,10 +195,8 @@ def _get_entity_data(self, entity_id: str, entity: GwEntityData) -> None: self._check_availability( entity, "heater_central", "no OpenTherm communication" ) - - if "module_id" ind entity: - locator = "module/protocolszig_bee_node" - + # Zigbee node availability + self._get_zigbee_availability(data, entity) # Switching groups data self._entity_switching_group(entity) diff --git a/plugwise/helper.py b/plugwise/helper.py index f8d20bf92..bbd3109bb 100644 --- a/plugwise/helper.py +++ b/plugwise/helper.py @@ -423,6 +423,14 @@ def _get_measurement_data(self, entity_id: str, entity: GwEntityData) -> None: entity.update(data) + def _get_zigbee_availability(self, data: GwEntityData, entity: GwEntityData) -> GwEntityData: + # Check zigbee device availabilty + if "module_id" in entity: + module_id = entity["module_id"] + locator = f'./module[@id="{module_id}"]/protocols/zig_bee_node' + if (module := self._domain_objects.find(locator)) is not None: + data["available"] = module.find("reachable").text == "true" + def _collect_group_sensors( self, data: GwEntityData, From bb0cd25b5ee5a421241b5f2fc8410bee51524f20 Mon Sep 17 00:00:00 2001 From: autoruff Date: Tue, 16 Dec 2025 09:55:59 +0000 Subject: [PATCH 17/99] fixup: different-update Python code fixed using ruff --- plugwise/helper.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plugwise/helper.py b/plugwise/helper.py index bbd3109bb..3e8e7a2b4 100644 --- a/plugwise/helper.py +++ b/plugwise/helper.py @@ -423,13 +423,15 @@ def _get_measurement_data(self, entity_id: str, entity: GwEntityData) -> None: entity.update(data) - def _get_zigbee_availability(self, data: GwEntityData, entity: GwEntityData) -> GwEntityData: + def _get_zigbee_availability( + self, data: GwEntityData, entity: GwEntityData + ) -> GwEntityData: # Check zigbee device availabilty if "module_id" in entity: module_id = entity["module_id"] locator = f'./module[@id="{module_id}"]/protocols/zig_bee_node' if (module := self._domain_objects.find(locator)) is not None: - data["available"] = module.find("reachable").text == "true" + data["available"] = module.find("reachable").text == "true" def _collect_group_sensors( self, From d3d9b49426c21f101581c035d651ca693caa0e93 Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Wed, 17 Dec 2025 08:25:39 +0100 Subject: [PATCH 18/99] Detect removed appliances and pop them --- plugwise/helper.py | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/plugwise/helper.py b/plugwise/helper.py index 3e8e7a2b4..5f781b61e 100644 --- a/plugwise/helper.py +++ b/plugwise/helper.py @@ -167,18 +167,23 @@ def _get_appliances(self) -> None: if appl.entity_id in self._existing_appliances: self._new_appliances.append((appl.entity_id)) continue - else: + else: # add nnew appliance self._new_appliances.append(appl.entity_id) self._create_gw_entities(appl) LOGGER.debug("HOI existing: %s", self._existing_appliances) LOGGER.debug("HOI new: %s", self._new_appliances) - is_subset = set(self._new_appliances) <= set(self._existing_appliances) - LOGGER.debug("HOI is_subset: %s", is_subset) - if self._existing_appliances and is_subset: - LOGGER.debug("HOI no unknown appliance(s) found.") - return False + removed = list(set(self._existing_appliances) - set(self._new_appliances)) + if self._existing_appliances: + if not removed: + LOGGER.debug("HOI no removed appliance(s).") + return False + else: + LOGGER.debug("HOI removed appliance(s): %s", removed) + for appliance in removed: + self.gw_entities.pop(appliance) + return False # A smartmeter is not present as an appliance, add it specifically if self.smile.type == "power" or self.smile.anna_p1: From e27c8c0920ec77869b174c01e25a1b65a3c38e59 Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Wed, 17 Dec 2025 13:17:08 +0100 Subject: [PATCH 19/99] Remove debug-logging, guard _add_p1_smartmeter_info() --- plugwise/helper.py | 8 ++++---- plugwise/smile.py | 6 +----- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/plugwise/helper.py b/plugwise/helper.py index 5f781b61e..beac8f589 100644 --- a/plugwise/helper.py +++ b/plugwise/helper.py @@ -172,12 +172,10 @@ def _get_appliances(self) -> None: self._create_gw_entities(appl) - LOGGER.debug("HOI existing: %s", self._existing_appliances) - LOGGER.debug("HOI new: %s", self._new_appliances) removed = list(set(self._existing_appliances) - set(self._new_appliances)) if self._existing_appliances: if not removed: - LOGGER.debug("HOI no removed appliance(s).") + LOGGER.debug("HOI no new or removed appliance(s).") return False else: LOGGER.debug("HOI removed appliance(s): %s", removed) @@ -186,7 +184,9 @@ def _get_appliances(self) -> None: return False # A smartmeter is not present as an appliance, add it specifically - if self.smile.type == "power" or self.smile.anna_p1: + if not self._existing_appliances and ( + self.smile.type == "power" or self.smile.anna_p1 + ): self._add_p1_smartmeter_info() # Sort the gw_entities diff --git a/plugwise/smile.py b/plugwise/smile.py index a7805ef7d..bb7b44270 100644 --- a/plugwise/smile.py +++ b/plugwise/smile.py @@ -110,11 +110,7 @@ def get_all_gateway_entities(self) -> None: Collect and add switching- and/or pump-group entities. Finally, collect the data and states for each entity. """ - execute = self._all_appliances() - LOGGER.debug("HOI self._all_appliances() = %s", execute) - if not execute: - LOGGER.debug("HOI no new appliances found, skipping") - else: + if self._all_appliances(): if self._is_thermostat: self.therms_with_offset_func = ( self._get_appliances_with_offset_functionality() From 780b117fc80f6bd7d85910590398fc40fcab4061 Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Wed, 17 Dec 2025 13:18:21 +0100 Subject: [PATCH 20/99] Improve/rework _get_groups() --- plugwise/common.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/plugwise/common.py b/plugwise/common.py index 95291f08f..4bb791374 100644 --- a/plugwise/common.py +++ b/plugwise/common.py @@ -54,7 +54,9 @@ def __init__(self) -> None: self._cooling_present: bool self._count: int self._domain_objects: etree.Element + self._existing_groups: list[str] = [] self._heater_id: str = NONE + self._new_groups: list[st] = [] self._on_off_device: bool self.gw_entities: dict[str, GwEntityData] = {} self.smile: Munch @@ -221,6 +223,14 @@ def _get_groups(self) -> None: } self._count += 5 + removed = list(set(self._existing_groups) - set(self._new_groups)) + if self._existing_groups and removed: + for group in removed: + self.gw_entities.pop(group) + + self._existing_groups = self._new_groups + self._new_groups = [] + def _get_lock_state( self, xml: etree.Element, data: GwEntityData, stretch_v2: bool = False ) -> None: From a110148bb2220cd7ba13a54577064831907b2199 Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Wed, 17 Dec 2025 13:21:16 +0100 Subject: [PATCH 21/99] _all_appliances(), _all_locations() -> _get_appliances(), _get_locations() --- plugwise/helper.py | 2 +- plugwise/smile.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/plugwise/helper.py b/plugwise/helper.py index beac8f589..86f533a5d 100644 --- a/plugwise/helper.py +++ b/plugwise/helper.py @@ -107,7 +107,7 @@ def item_count(self) -> int: """Return the item-count.""" return self._count - def _get_appliances(self) -> None: + def _get_appliances(self) -> bool: """Collect all appliances with relevant info. Also, collect the P1 smartmeter info from a location diff --git a/plugwise/smile.py b/plugwise/smile.py index bb7b44270..c6b28e237 100644 --- a/plugwise/smile.py +++ b/plugwise/smile.py @@ -110,7 +110,7 @@ def get_all_gateway_entities(self) -> None: Collect and add switching- and/or pump-group entities. Finally, collect the data and states for each entity. """ - if self._all_appliances(): + if self._get_appliances(): if self._is_thermostat: self.therms_with_offset_func = ( self._get_appliances_with_offset_functionality() From cb17cf46c0a97810678041a6e820cdd747f74d52 Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Wed, 17 Dec 2025 16:09:40 +0100 Subject: [PATCH 22/99] Optimize --- plugwise/helper.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/plugwise/helper.py b/plugwise/helper.py index 86f533a5d..f2ed77c99 100644 --- a/plugwise/helper.py +++ b/plugwise/helper.py @@ -164,11 +164,9 @@ def _get_appliances(self) -> bool: if not (appl := self._appliance_info_finder(appl, appliance)): continue + self._new_appliances.append(appl.entity_id) if appl.entity_id in self._existing_appliances: - self._new_appliances.append((appl.entity_id)) continue - else: # add nnew appliance - self._new_appliances.append(appl.entity_id) self._create_gw_entities(appl) From 63b59425cef354e4eed046cb769a6ba02341889c Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Thu, 18 Dec 2025 09:55:10 +0100 Subject: [PATCH 23/99] Fixes --- plugwise/common.py | 2 +- plugwise/smile.py | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/plugwise/common.py b/plugwise/common.py index 4bb791374..0df446874 100644 --- a/plugwise/common.py +++ b/plugwise/common.py @@ -56,7 +56,7 @@ def __init__(self) -> None: self._domain_objects: etree.Element self._existing_groups: list[str] = [] self._heater_id: str = NONE - self._new_groups: list[st] = [] + self._new_groups: list[str] = [] self._on_off_device: bool self.gw_entities: dict[str, GwEntityData] = {} self.smile: Munch diff --git a/plugwise/smile.py b/plugwise/smile.py index c6b28e237..21a20d020 100644 --- a/plugwise/smile.py +++ b/plugwise/smile.py @@ -16,7 +16,6 @@ DOMAIN_OBJECTS, GATEWAY_REBOOT, LOCATIONS, - LOGGER, MAX_SETPOINT, MIN_SETPOINT, NONE, From fdf6e8f0b6d5eac083a9dfc8298f67ca130357ce Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Thu, 18 Dec 2025 10:31:06 +0100 Subject: [PATCH 24/99] Add existing/new detection in _get_locations() and related --- plugwise/helper.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/plugwise/helper.py b/plugwise/helper.py index f2ed77c99..36b03e671 100644 --- a/plugwise/helper.py +++ b/plugwise/helper.py @@ -86,7 +86,9 @@ def __init__(self) -> None: """Set the constructor for this class.""" super().__init__() self._existing_appliances: list[str] = [] + self._existing_locations: list[str] = [] self._new_appliances: list[str] = [] + self._new_locations: list[str] = [] self._endpoint: str self._elga: bool self._is_thermostat: bool @@ -262,6 +264,15 @@ def _get_locations(self) -> None: "Error, location Home (building) not found!" ) # pragma: no cover + removed = list(set(self._existing_locations) - set(self._new_locations)) + if self._existing_locations and removed: + for location_id in removed: + self._loc_data.pop(location_id) + self._zones.pop(location_id) + + self._existing_locations = self._new_locations + self._new_locations = [] + def _appliance_info_finder(self, appl: Munch, appliance: etree.Element) -> Munch: """Collect info for all appliances found.""" match appl.pwclass: @@ -810,7 +821,8 @@ def _scan_thermostats(self) -> None: return self._match_and_rank_thermostats() - for location_id, location in self._loc_data.items(): + for location_id in self._new_locations: + location = self._loc_data[location_id] if location["primary_prio"] != 0: self._zones[location_id] = { "dev_class": "climate", From 8b0c90815e418ca30d4a976e2c73762dc907599a Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Thu, 18 Dec 2025 11:13:42 +0100 Subject: [PATCH 25/99] Add existing/new detection for zones --- plugwise/helper.py | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/plugwise/helper.py b/plugwise/helper.py index 36b03e671..646b97af4 100644 --- a/plugwise/helper.py +++ b/plugwise/helper.py @@ -87,8 +87,10 @@ def __init__(self) -> None: super().__init__() self._existing_appliances: list[str] = [] self._existing_locations: list[str] = [] + self._existing_zones: list[str] = [] self._new_appliances: list[str] = [] self._new_locations: list[str] = [] + self._new_zones: list[str] = [] self._endpoint: str self._elga: bool self._is_thermostat: bool @@ -821,9 +823,14 @@ def _scan_thermostats(self) -> None: return self._match_and_rank_thermostats() - for location_id in self._new_locations: - location = self._loc_data[location_id] + # for location_id in self._new_locations: + # location = self._loc_data[location_id] + for location_id, location in self._loc_data.items(): if location["primary_prio"] != 0: + self._new_zones.append(location_id) + if location_id in self._existing_zones: + continue + self._zones[location_id] = { "dev_class": "climate", "model": "ThermoZone", @@ -836,7 +843,15 @@ def _scan_thermostats(self) -> None: } self._count += 5 - def _match_and_rank_thermostats(self) -> None: + removed = list(set(self._existing_zones) - set(self._new_zones)) + if self._existing_zones and removed: + for location_id in removed: + self._zones.pop(location_id) + + self._existing_zones = self._new_zones + self._new_zones = [] + + def _match_and_rank_thermostats(self) -> dict[str, ThermoLoc]: """Helper-function for _scan_thermostats(). Match thermostat-appliances with locations, rank them for locations with multiple thermostats. From 583ce150ceda7020efcdc2eff0113e32dd8fdcdd Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Thu, 18 Dec 2025 13:53:51 +0100 Subject: [PATCH 26/99] Optimize, clean up --- plugwise/helper.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/plugwise/helper.py b/plugwise/helper.py index 646b97af4..0bab7af08 100644 --- a/plugwise/helper.py +++ b/plugwise/helper.py @@ -823,8 +823,6 @@ def _scan_thermostats(self) -> None: return self._match_and_rank_thermostats() - # for location_id in self._new_locations: - # location = self._loc_data[location_id] for location_id, location in self._loc_data.items(): if location["primary_prio"] != 0: self._new_zones.append(location_id) From af2cb791037abc898fe0d2eb84eec398d8b2501d Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Thu, 18 Dec 2025 13:54:56 +0100 Subject: [PATCH 27/99] Make sure to update all (thermo)zones as there can be changes in a zone too --- plugwise/helper.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/plugwise/helper.py b/plugwise/helper.py index 0bab7af08..a4fc82e94 100644 --- a/plugwise/helper.py +++ b/plugwise/helper.py @@ -826,9 +826,6 @@ def _scan_thermostats(self) -> None: for location_id, location in self._loc_data.items(): if location["primary_prio"] != 0: self._new_zones.append(location_id) - if location_id in self._existing_zones: - continue - self._zones[location_id] = { "dev_class": "climate", "model": "ThermoZone", From 7b5a4d213f7a4a272737c512f4532f54aef002f3 Mon Sep 17 00:00:00 2001 From: autoruff Date: Thu, 18 Dec 2025 13:14:36 +0000 Subject: [PATCH 28/99] fixup: different-update Python code fixed using ruff --- plugwise/smile.py | 1 - 1 file changed, 1 deletion(-) diff --git a/plugwise/smile.py b/plugwise/smile.py index 21a20d020..2977bca5f 100644 --- a/plugwise/smile.py +++ b/plugwise/smile.py @@ -114,7 +114,6 @@ def get_all_gateway_entities(self) -> None: self.therms_with_offset_func = ( self._get_appliances_with_offset_functionality() ) - self._scan_thermostats() self._get_groups() self._all_entity_data() From d17c8da457e58451c8bdafa7a1c7e01888417798 Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Thu, 18 Dec 2025 14:55:48 +0100 Subject: [PATCH 29/99] Fix typo, clean up debugging --- plugwise/common.py | 3 +++ plugwise/helper.py | 2 -- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/plugwise/common.py b/plugwise/common.py index 0df446874..a7bdd1598 100644 --- a/plugwise/common.py +++ b/plugwise/common.py @@ -205,6 +205,9 @@ def _get_groups(self) -> None: for group in self._domain_objects.findall("./group"): members: list[str] = [] group_id = group.get("id") + self._new_groups.append(group_id) + if group_id in self._existing_groups: + continue group_name = group.find("name").text group_type = group.find("type").text group_appliances = group.findall("appliances/appliance") diff --git a/plugwise/helper.py b/plugwise/helper.py index a4fc82e94..46f99d76c 100644 --- a/plugwise/helper.py +++ b/plugwise/helper.py @@ -177,10 +177,8 @@ def _get_appliances(self) -> bool: removed = list(set(self._existing_appliances) - set(self._new_appliances)) if self._existing_appliances: if not removed: - LOGGER.debug("HOI no new or removed appliance(s).") return False else: - LOGGER.debug("HOI removed appliance(s): %s", removed) for appliance in removed: self.gw_entities.pop(appliance) return False From 8af09d6744ee623594054af0e36be9f986e20374 Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Thu, 18 Dec 2025 14:57:44 +0100 Subject: [PATCH 30/99] More fixes --- plugwise/helper.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugwise/helper.py b/plugwise/helper.py index 46f99d76c..8b2f769e0 100644 --- a/plugwise/helper.py +++ b/plugwise/helper.py @@ -439,8 +439,8 @@ def _get_measurement_data(self, entity_id: str, entity: GwEntityData) -> None: def _get_zigbee_availability( self, data: GwEntityData, entity: GwEntityData - ) -> GwEntityData: - # Check zigbee device availabilty + ) -> None: + # Check zigbee device availability if "module_id" in entity: module_id = entity["module_id"] locator = f'./module[@id="{module_id}"]/protocols/zig_bee_node' From b9edfd9ca42a9221e9ba5c4fa607a991d9ebecda Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Thu, 18 Dec 2025 15:31:34 +0100 Subject: [PATCH 31/99] Fix SonarCloud reports --- plugwise/common.py | 13 ++++++++----- plugwise/smile.py | 9 ++++----- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/plugwise/common.py b/plugwise/common.py index a7bdd1598..48815b773 100644 --- a/plugwise/common.py +++ b/plugwise/common.py @@ -212,9 +212,7 @@ def _get_groups(self) -> None: group_type = group.find("type").text group_appliances = group.findall("appliances/appliance") for item in group_appliances: - # Check if members are not orphaned - stretch - if item.get("id") in self.gw_entities: - members.append(item.get("id")) + self._add_member(item) if group_type in GROUP_TYPES and members and group_id: self.gw_entities[group_id] = { @@ -228,12 +226,17 @@ def _get_groups(self) -> None: removed = list(set(self._existing_groups) - set(self._new_groups)) if self._existing_groups and removed: - for group in removed: - self.gw_entities.pop(group) + for group_id in removed: + self.gw_entities.pop(group_id) self._existing_groups = self._new_groups self._new_groups = [] + def _add_member(element: etree.Element, members: list[str]) -> None: + """Check and add member to list.""" + if element.attrib["id"] in self.gw_entities: + members.append(item.attrib["id"]) + def _get_lock_state( self, xml: etree.Element, data: GwEntityData, stretch_v2: bool = False ) -> None: diff --git a/plugwise/smile.py b/plugwise/smile.py index 2977bca5f..9704643f5 100644 --- a/plugwise/smile.py +++ b/plugwise/smile.py @@ -109,11 +109,10 @@ def get_all_gateway_entities(self) -> None: Collect and add switching- and/or pump-group entities. Finally, collect the data and states for each entity. """ - if self._get_appliances(): - if self._is_thermostat: - self.therms_with_offset_func = ( - self._get_appliances_with_offset_functionality() - ) + if self._get_appliances() and self._is_thermostat: + self.therms_with_offset_func = ( + self._get_appliances_with_offset_functionality() + ) self._get_groups() self._all_entity_data() From 29b45ebd97c571ac6cc4b40f48286f1a55e59777 Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Thu, 18 Dec 2025 15:34:29 +0100 Subject: [PATCH 32/99] Fix double zone-pop --- plugwise/helper.py | 1 - 1 file changed, 1 deletion(-) diff --git a/plugwise/helper.py b/plugwise/helper.py index 8b2f769e0..07e73be34 100644 --- a/plugwise/helper.py +++ b/plugwise/helper.py @@ -268,7 +268,6 @@ def _get_locations(self) -> None: if self._existing_locations and removed: for location_id in removed: self._loc_data.pop(location_id) - self._zones.pop(location_id) self._existing_locations = self._new_locations self._new_locations = [] From 90b932e257f2b1c02f02899e2935761e18fb6b00 Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Thu, 18 Dec 2025 15:35:53 +0100 Subject: [PATCH 33/99] Add missing self --- plugwise/common.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugwise/common.py b/plugwise/common.py index 48815b773..46f3cd6a7 100644 --- a/plugwise/common.py +++ b/plugwise/common.py @@ -232,7 +232,7 @@ def _get_groups(self) -> None: self._existing_groups = self._new_groups self._new_groups = [] - def _add_member(element: etree.Element, members: list[str]) -> None: + def _add_member(self, element: etree.Element, members: list[str]) -> None: """Check and add member to list.""" if element.attrib["id"] in self.gw_entities: members.append(item.attrib["id"]) From af20d117d8d277a789914b30728243e18bddd95b Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Thu, 18 Dec 2025 15:42:52 +0100 Subject: [PATCH 34/99] Make sure to detect location-name change --- plugwise/helper.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/plugwise/helper.py b/plugwise/helper.py index 07e73be34..c9f6da4eb 100644 --- a/plugwise/helper.py +++ b/plugwise/helper.py @@ -245,6 +245,13 @@ def _get_locations(self) -> None: loc.loc_id = location.get("id") loc.name = location.find("name").text loc._type = location.find("type").text + self._new_locations.append(loc.loc_id) + if ( + loc.loc_id in self._existing_locations + and self._loc_data[loc.loc_id]["name"] == loc.name + ): + continue + self._loc_data[loc.loc_id] = { "name": loc.name, "primary": [], From b140857116325f1cbb40e8896c5b48a8e81eda1d Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Thu, 18 Dec 2025 15:49:51 +0100 Subject: [PATCH 35/99] Change the THERMO_MATCHING constant --- plugwise/helper.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/plugwise/helper.py b/plugwise/helper.py index c9f6da4eb..eb5bab6e9 100644 --- a/plugwise/helper.py +++ b/plugwise/helper.py @@ -176,12 +176,9 @@ def _get_appliances(self) -> bool: removed = list(set(self._existing_appliances) - set(self._new_appliances)) if self._existing_appliances: - if not removed: - return False - else: - for appliance in removed: - self.gw_entities.pop(appliance) - return False + for appliance in removed: + self.gw_entities.pop(appliance) + return False # A smartmeter is not present as an appliance, add it specifically if not self._existing_appliances and ( From 18695a607ce3d089944c480da2874cb09c30335a Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Thu, 18 Dec 2025 15:52:26 +0100 Subject: [PATCH 36/99] Improve _add_member() --- plugwise/common.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugwise/common.py b/plugwise/common.py index 46f3cd6a7..80027d560 100644 --- a/plugwise/common.py +++ b/plugwise/common.py @@ -212,7 +212,7 @@ def _get_groups(self) -> None: group_type = group.find("type").text group_appliances = group.findall("appliances/appliance") for item in group_appliances: - self._add_member(item) + self._add_member(item, members) if group_type in GROUP_TYPES and members and group_id: self.gw_entities[group_id] = { @@ -234,8 +234,8 @@ def _get_groups(self) -> None: def _add_member(self, element: etree.Element, members: list[str]) -> None: """Check and add member to list.""" - if element.attrib["id"] in self.gw_entities: - members.append(item.attrib["id"]) + if (member_id := element.attrib["id"]) in self.gw_entities: + members.append(member_id) def _get_lock_state( self, xml: etree.Element, data: GwEntityData, stretch_v2: bool = False From 05f247e10b8c3b0b866a19e028bb249e1b29b286 Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Thu, 18 Dec 2025 16:16:54 +0100 Subject: [PATCH 37/99] Detect smartmeter change --- plugwise/helper.py | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/plugwise/helper.py b/plugwise/helper.py index eb5bab6e9..2f4ea9f65 100644 --- a/plugwise/helper.py +++ b/plugwise/helper.py @@ -174,21 +174,19 @@ def _get_appliances(self) -> bool: self._create_gw_entities(appl) - removed = list(set(self._existing_appliances) - set(self._new_appliances)) - if self._existing_appliances: - for appliance in removed: - self.gw_entities.pop(appliance) - return False - # A smartmeter is not present as an appliance, add it specifically - if not self._existing_appliances and ( - self.smile.type == "power" or self.smile.anna_p1 - ): + if self.smile.type == "power" or self.smile.anna_p1: self._add_p1_smartmeter_info() # Sort the gw_entities self._reorder_devices() + removed = list(set(self._existing_appliances) - set(self._new_appliances)) + if self._existing_appliances: + for appliance in removed: + self.gw_entities.pop(appliance) + return False + self._existing_appliances = self._new_appliances self._new_appliances = [] return True @@ -207,6 +205,13 @@ def _add_p1_smartmeter_info(self) -> None: if not module_data["contents"]: # pragma: no cover return + module_id = module_data["module_id"] + if ( + self.gw_entities[self._home_loc_id]["module_id"] == module_id + or self.gw_entities[self._gateway_id]["module_id"] == module_id + ): + return + appl.available = None appl.entity_id = self._home_loc_id if not self.smile.anna_p1: @@ -217,7 +222,7 @@ def _add_p1_smartmeter_info(self) -> None: appl.mac = None appl.model = module_data["vendor_model"] appl.model_id = None # don't use model_id for SmartMeter - appl.module_id = module_data["module_id"] + appl.module_id = module_id appl.name = "P1" appl.pwclass = "smartmeter" appl.vendor_name = module_data["vendor_name"] From 3a3de0e324a4c1113a8fa07ab8331fa027107ad8 Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Thu, 18 Dec 2025 16:21:48 +0100 Subject: [PATCH 38/99] Use in-construct as suggested --- plugwise/helper.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugwise/helper.py b/plugwise/helper.py index 2f4ea9f65..25f2eee62 100644 --- a/plugwise/helper.py +++ b/plugwise/helper.py @@ -206,9 +206,9 @@ def _add_p1_smartmeter_info(self) -> None: return module_id = module_data["module_id"] - if ( - self.gw_entities[self._home_loc_id]["module_id"] == module_id - or self.gw_entities[self._gateway_id]["module_id"] == module_id + if module_id in ( + self.gw_entities[self._home_loc_id]["module_id"], + self.gw_entities[self._gateway_id]["module_id"], ): return From 44d92e44990950655245ba932f33157f3ddeac4b Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Thu, 18 Dec 2025 16:31:14 +0100 Subject: [PATCH 39/99] Use .get() constructs as suggested --- plugwise/helper.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugwise/helper.py b/plugwise/helper.py index 25f2eee62..519be067b 100644 --- a/plugwise/helper.py +++ b/plugwise/helper.py @@ -207,8 +207,8 @@ def _add_p1_smartmeter_info(self) -> None: module_id = module_data["module_id"] if module_id in ( - self.gw_entities[self._home_loc_id]["module_id"], - self.gw_entities[self._gateway_id]["module_id"], + self.gw_entities[self._gateway_id].get("module_id"), + self.gw_entities.get(self._home_loc_id, {}).get("module_id"), ): return From 8bfab683dd0fec177e7f553fcbd96cdc1c783b52 Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Thu, 18 Dec 2025 17:16:41 +0100 Subject: [PATCH 40/99] Update test entity_items asserts and test-jsons --- tests/data/adam/adam_heatpump_cooling.json | 207 +++++++++++++++--- tests/data/adam/adam_jip.json | 111 ++++++++-- .../adam/adam_multiple_devices_per_zone.json | 84 ++++++- .../adam_onoff_cooling_fake_firmware.json | 25 ++- tests/data/adam/adam_plus_anna.json | 21 +- tests/data/adam/adam_zone_per_device.json | 92 ++++++-- tests/data/anna/anna_v4.json | 16 +- tests/test_adam.py | 12 +- tests/test_anna.py | 34 +-- 9 files changed, 495 insertions(+), 107 deletions(-) diff --git a/tests/data/adam/adam_heatpump_cooling.json b/tests/data/adam/adam_heatpump_cooling.json index 71bfad7e2..60d15563c 100644 --- a/tests/data/adam/adam_heatpump_cooling.json +++ b/tests/data/adam/adam_heatpump_cooling.json @@ -12,7 +12,13 @@ "dev_class": "climate", "model": "ThermoZone", "name": "Slaapkamer SJ", - "preset_modes": ["no_frost", "vacation", "away", "home", "asleep"], + "preset_modes": [ + "no_frost", + "vacation", + "away", + "home", + "asleep" + ], "select_schedule": "off", "select_zone_profile": "passive", "sensors": { @@ -27,11 +33,17 @@ "upper_bound": 99.9 }, "thermostats": { - "primary": ["d3a276aeb3114a509bab1e4bf8c40348"], + "primary": [ + "d3a276aeb3114a509bab1e4bf8c40348" + ], "secondary": [] }, "vendor": "Plugwise", - "zone_profiles": ["active", "off", "passive"] + "zone_profiles": [ + "active", + "off", + "passive" + ] }, "0ca13e8176204ca7bf6f09de59f81c83": { "available": true, @@ -58,6 +70,7 @@ }, "model": "Generic heater/cooler", "model_id": "17.1", + "module_id": "1ad05e10747b4e40ba2ba82f2872d1c1", "name": "OpenTherm", "sensors": { "dhw_temperature": 63.5, @@ -84,6 +97,7 @@ "location": "b52908550469425b812c87f766fe5303", "model": "Lisa", "model_id": "158-01", + "module_id": "1f0d0e98291145afa4da4432f76a7bd2", "name": "Thermostaat BK", "sensors": { "battery": 55, @@ -106,6 +120,7 @@ "location": "20e735858f8146cead98b873177a4f99", "model": "Plug", "model_id": "160-01", + "module_id": "0a00ddca4e9543c69c6648e5488590dd", "name": "Smart Plug DB", "sensors": { "electricity_consumed": 0.0, @@ -132,7 +147,13 @@ "dev_class": "climate", "model": "ThermoZone", "name": "Slaapkamer DB", - "preset_modes": ["no_frost", "vacation", "away", "home", "asleep"], + "preset_modes": [ + "no_frost", + "vacation", + "away", + "home", + "asleep" + ], "select_schedule": "off", "select_zone_profile": "passive", "sensors": { @@ -147,11 +168,17 @@ "upper_bound": 99.9 }, "thermostats": { - "primary": ["47e2c550a33846b680725aa3fb229473"], + "primary": [ + "47e2c550a33846b680725aa3fb229473" + ], "secondary": [] }, "vendor": "Plugwise", - "zone_profiles": ["active", "off", "passive"] + "zone_profiles": [ + "active", + "off", + "passive" + ] }, "2e0fc4db2a6d4cbeb7cf786143543961": { "available": true, @@ -160,6 +187,7 @@ "location": "a562019b0b1f47a4bde8ebe3dbe3e8a9", "model": "Plug", "model_id": "160-01", + "module_id": "3fa224c4c39f458583b2dab4515210bf", "name": "Smart Plug KK", "sensors": { "electricity_consumed": 2.13, @@ -180,6 +208,7 @@ "location": "04b15f6e884448288f811d29fb7b1b30", "model": "Plug", "model_id": "160-01", + "module_id": "483836101eb141e2b04045eedc3716ff", "name": "Smart Plug SJ", "sensors": { "electricity_consumed": 0.0, @@ -200,6 +229,7 @@ "location": "fa5fa6b34f6b40a0972988b20e888ed4", "model": "Plug", "model_id": "160-01", + "module_id": "e20da25d0cbf456097aa1a954efed11b", "name": "Smart Plug WK", "sensors": { "electricity_consumed": 0.0, @@ -221,6 +251,7 @@ "location": "20e735858f8146cead98b873177a4f99", "model": "Lisa", "model_id": "158-01", + "module_id": "ddd4ed4873864199b6121459ae9fa4ae", "name": "Thermostaat DB", "sensors": { "setpoint": 18.0, @@ -248,7 +279,13 @@ "dev_class": "climate", "model": "ThermoZone", "name": "Badkamer 2", - "preset_modes": ["no_frost", "vacation", "away", "home", "asleep"], + "preset_modes": [ + "no_frost", + "vacation", + "away", + "home", + "asleep" + ], "select_schedule": "Werkdag schema", "select_zone_profile": "passive", "sensors": { @@ -262,11 +299,17 @@ "upper_bound": 99.9 }, "thermostats": { - "primary": ["f04c985c11ad4848b8fcd710343f9dcf"], + "primary": [ + "f04c985c11ad4848b8fcd710343f9dcf" + ], "secondary": [] }, "vendor": "Plugwise", - "zone_profiles": ["active", "off", "passive"] + "zone_profiles": [ + "active", + "off", + "passive" + ] }, "5ead63c65e5f44e7870ba2bd680ceb9e": { "available": true, @@ -275,6 +318,7 @@ "location": "9a27714b970547ee9a6bdadc2b815ad5", "model": "Plug", "model_id": "160-01", + "module_id": "2028add51f214a3dbddfa1706e63cfed", "name": "Smart Plug SQ", "sensors": { "electricity_consumed": 0.0, @@ -294,7 +338,11 @@ }, "dev_class": "gateway", "firmware": "3.2.8", - "gateway_modes": ["away", "full", "vacation"], + "gateway_modes": [ + "away", + "full", + "vacation" + ], "hardware": "AME Smile 2.0 board", "location": "eedadcb297564f1483faa509179aebed", "mac_address": "012345670001", @@ -325,6 +373,7 @@ "location": "e39529c79ab54fda9bed26cfc0447546", "model": "Lisa", "model_id": "158-01", + "module_id": "d2f732f328ba447abd5be12f2e196205", "name": "Thermostaat JM", "sensors": { "setpoint": 18.0, @@ -346,6 +395,7 @@ "location": "b52908550469425b812c87f766fe5303", "model": "Plug", "model_id": "160-01", + "module_id": "44fe408e4afd47c19928941ef5499298", "name": "Smart Plug BK", "sensors": { "electricity_consumed": 0.0, @@ -366,6 +416,7 @@ "location": "5cc21042f87f4b4c94ccb5537c47a53f", "model": "Plug", "model_id": "160-01", + "module_id": "1695cccaacc94580860544338b272ce0", "name": "Smart Plug BK2", "sensors": { "electricity_consumed": 0.0, @@ -392,7 +443,13 @@ "dev_class": "climate", "model": "ThermoZone", "name": "Badkamer 1", - "preset_modes": ["no_frost", "vacation", "away", "home", "asleep"], + "preset_modes": [ + "no_frost", + "vacation", + "away", + "home", + "asleep" + ], "select_schedule": "Werkdag schema", "select_zone_profile": "passive", "sensors": { @@ -407,11 +464,17 @@ "upper_bound": 99.9 }, "thermostats": { - "primary": ["eac5db95d97241f6b17790897847ccf5"], + "primary": [ + "eac5db95d97241f6b17790897847ccf5" + ], "secondary": [] }, "vendor": "Plugwise", - "zone_profiles": ["active", "off", "passive"] + "zone_profiles": [ + "active", + "off", + "passive" + ] }, "93ac3f7bf25342f58cbb77c4a99ac0b3": { "active_preset": "away", @@ -426,7 +489,13 @@ "dev_class": "climate", "model": "ThermoZone", "name": "Slaapkamer RB", - "preset_modes": ["no_frost", "vacation", "away", "home", "asleep"], + "preset_modes": [ + "no_frost", + "vacation", + "away", + "home", + "asleep" + ], "select_schedule": "off", "select_zone_profile": "passive", "sensors": { @@ -440,11 +509,17 @@ "upper_bound": 99.9 }, "thermostats": { - "primary": ["c4ed311d54e341f58b4cdd201d1fde7e"], + "primary": [ + "c4ed311d54e341f58b4cdd201d1fde7e" + ], "secondary": [] }, "vendor": "Plugwise", - "zone_profiles": ["active", "off", "passive"] + "zone_profiles": [ + "active", + "off", + "passive" + ] }, "96714ad90fc948bcbcb5021c4b9f5ae9": { "available": true, @@ -453,6 +528,7 @@ "location": "e39529c79ab54fda9bed26cfc0447546", "model": "Plug", "model_id": "160-01", + "module_id": "9a3848f23b814b708f7f5bf15702c60d", "name": "Smart Plug JM", "sensors": { "electricity_consumed": 0.0, @@ -479,7 +555,13 @@ "dev_class": "climate", "model": "ThermoZone", "name": "Slaapkamer SQ", - "preset_modes": ["no_frost", "vacation", "away", "home", "asleep"], + "preset_modes": [ + "no_frost", + "vacation", + "away", + "home", + "asleep" + ], "select_schedule": "off", "select_zone_profile": "passive", "sensors": { @@ -494,11 +576,17 @@ "upper_bound": 99.9 }, "thermostats": { - "primary": ["beb32da072274e698146db8b022f3c36"], + "primary": [ + "beb32da072274e698146db8b022f3c36" + ], "secondary": [] }, "vendor": "Plugwise", - "zone_profiles": ["active", "off", "passive"] + "zone_profiles": [ + "active", + "off", + "passive" + ] }, "a03b6e8e76dd4646af1a77c31dd9370c": { "available": true, @@ -507,6 +595,7 @@ "location": "93ac3f7bf25342f58cbb77c4a99ac0b3", "model": "Plug", "model_id": "160-01", + "module_id": "3e205ba6cede43e5b461e7c76340a64d", "name": "Smart Plug RB", "sensors": { "electricity_consumed": 3.13, @@ -533,7 +622,13 @@ "dev_class": "climate", "model": "ThermoZone", "name": "Keuken", - "preset_modes": ["no_frost", "vacation", "away", "home", "asleep"], + "preset_modes": [ + "no_frost", + "vacation", + "away", + "home", + "asleep" + ], "select_schedule": "Werkdag schema", "select_zone_profile": "active", "sensors": { @@ -548,11 +643,17 @@ "upper_bound": 99.9 }, "thermostats": { - "primary": ["ea8372c0e3ad4622ad45a041d02425f5"], + "primary": [ + "ea8372c0e3ad4622ad45a041d02425f5" + ], "secondary": [] }, "vendor": "Plugwise", - "zone_profiles": ["active", "off", "passive"] + "zone_profiles": [ + "active", + "off", + "passive" + ] }, "b52908550469425b812c87f766fe5303": { "active_preset": "away", @@ -567,7 +668,13 @@ "dev_class": "climate", "model": "ThermoZone", "name": "Bijkeuken", - "preset_modes": ["no_frost", "vacation", "away", "home", "asleep"], + "preset_modes": [ + "no_frost", + "vacation", + "away", + "home", + "asleep" + ], "select_schedule": "off", "select_zone_profile": "active", "sensors": { @@ -582,11 +689,17 @@ "upper_bound": 99.9 }, "thermostats": { - "primary": ["1053c8bbf8be43c6921742b146a625f1"], + "primary": [ + "1053c8bbf8be43c6921742b146a625f1" + ], "secondary": [] }, "vendor": "Plugwise", - "zone_profiles": ["active", "off", "passive"] + "zone_profiles": [ + "active", + "off", + "passive" + ] }, "bbcffa48019f4b09b8368bbaf9559e68": { "available": true, @@ -595,6 +708,7 @@ "location": "8cf650a4c10c44819e426bed406aec34", "model": "Plug", "model_id": "160-01", + "module_id": "7435452fbc684a30a4978913f342c68b", "name": "Smart Plug BK1", "sensors": { "electricity_consumed": 0.0, @@ -616,6 +730,7 @@ "location": "9a27714b970547ee9a6bdadc2b815ad5", "model": "Lisa", "model_id": "158-01", + "module_id": "6991158ce7774dca864ec8fcf7a039ab", "name": "Thermostaat SQ", "sensors": { "setpoint": 18.5, @@ -638,6 +753,7 @@ "location": "93ac3f7bf25342f58cbb77c4a99ac0b3", "model": "Lisa", "model_id": "158-01", + "module_id": "11e4f552602c4b03980e0955e0f114f0", "name": "Thermostaat RB", "sensors": { "setpoint": 17.0, @@ -657,6 +773,7 @@ "location": "fa5fa6b34f6b40a0972988b20e888ed4", "model": "ThermoTouch", "model_id": "143.1", + "module_id": "e2d52aece0524fde9c346953e5e1acb2", "name": "Thermostaat WK", "sensors": { "setpoint": 21.5, @@ -672,6 +789,7 @@ "location": "04b15f6e884448288f811d29fb7b1b30", "model": "Lisa", "model_id": "158-01", + "module_id": "21d57d51898b41c69ad87fffb59f2581", "name": "Thermostaat SJ", "sensors": { "setpoint": 20.5, @@ -699,7 +817,13 @@ "dev_class": "climate", "model": "ThermoZone", "name": "Slaapkamer JM", - "preset_modes": ["no_frost", "vacation", "away", "home", "asleep"], + "preset_modes": [ + "no_frost", + "vacation", + "away", + "home", + "asleep" + ], "select_schedule": "off", "select_zone_profile": "passive", "sensors": { @@ -714,11 +838,17 @@ "upper_bound": 99.9 }, "thermostats": { - "primary": ["7fda9f84f01342f8afe9ebbbbff30c0f"], + "primary": [ + "7fda9f84f01342f8afe9ebbbbff30c0f" + ], "secondary": [] }, "vendor": "Plugwise", - "zone_profiles": ["active", "off", "passive"] + "zone_profiles": [ + "active", + "off", + "passive" + ] }, "ea8372c0e3ad4622ad45a041d02425f5": { "available": true, @@ -731,6 +861,7 @@ "location": "a562019b0b1f47a4bde8ebe3dbe3e8a9", "model": "Lisa", "model_id": "158-01", + "module_id": "0f19738aed2e4bc09e0ca832f2e0c5a4", "name": "Thermostaat KK", "sensors": { "battery": 53, @@ -754,6 +885,7 @@ "location": "8cf650a4c10c44819e426bed406aec34", "model": "Lisa", "model_id": "158-01", + "module_id": "efe84c28928a4ce08603024b5edc2fc7", "name": "Thermostaat BK1", "sensors": { "setpoint": 20.5, @@ -776,6 +908,7 @@ "location": "5cc21042f87f4b4c94ccb5537c47a53f", "model": "Lisa", "model_id": "158-01", + "module_id": "867bdfa029f042e2a50ab9974cff6fac", "name": "Thermostaat BK2", "sensors": { "setpoint": 20.5, @@ -803,7 +936,13 @@ "dev_class": "climate", "model": "ThermoZone", "name": "Woonkamer", - "preset_modes": ["no_frost", "vacation", "away", "home", "asleep"], + "preset_modes": [ + "no_frost", + "vacation", + "away", + "home", + "asleep" + ], "select_schedule": "Werkdag schema", "select_zone_profile": "active", "sensors": { @@ -818,10 +957,16 @@ "upper_bound": 35.0 }, "thermostats": { - "primary": ["ca79d23ae0094120b877558734cff85c"], + "primary": [ + "ca79d23ae0094120b877558734cff85c" + ], "secondary": [] }, "vendor": "Plugwise", - "zone_profiles": ["active", "off", "passive"] + "zone_profiles": [ + "active", + "off", + "passive" + ] } } diff --git a/tests/data/adam/adam_jip.json b/tests/data/adam/adam_jip.json index a1136e3c9..c13bd34c3 100644 --- a/tests/data/adam/adam_jip.json +++ b/tests/data/adam/adam_jip.json @@ -7,7 +7,13 @@ "dev_class": "climate", "model": "ThermoZone", "name": "Slaapkamer", - "preset_modes": ["home", "asleep", "away", "vacation", "no_frost"], + "preset_modes": [ + "home", + "asleep", + "away", + "vacation", + "no_frost" + ], "select_schedule": null, "select_zone_profile": "active", "sensors": { @@ -20,11 +26,19 @@ "upper_bound": 99.9 }, "thermostats": { - "primary": ["1346fbd8498d4dbcab7e18d51b771f3d"], - "secondary": ["356b65335e274d769c338223e7af9c33"] + "primary": [ + "1346fbd8498d4dbcab7e18d51b771f3d" + ], + "secondary": [ + "356b65335e274d769c338223e7af9c33" + ] }, "vendor": "Plugwise", - "zone_profiles": ["active", "off", "passive"] + "zone_profiles": [ + "active", + "off", + "passive" + ] }, "13228dab8ce04617af318a2888b3c548": { "active_preset": "home", @@ -34,7 +48,13 @@ "dev_class": "climate", "model": "ThermoZone", "name": "Woonkamer", - "preset_modes": ["home", "asleep", "away", "vacation", "no_frost"], + "preset_modes": [ + "home", + "asleep", + "away", + "vacation", + "no_frost" + ], "select_schedule": null, "select_zone_profile": "active", "sensors": { @@ -47,11 +67,19 @@ "upper_bound": 30.0 }, "thermostats": { - "primary": ["f61f1a2535f54f52ad006a3d18e459ca"], - "secondary": ["833de10f269c4deab58fb9df69901b4e"] + "primary": [ + "f61f1a2535f54f52ad006a3d18e459ca" + ], + "secondary": [ + "833de10f269c4deab58fb9df69901b4e" + ] }, "vendor": "Plugwise", - "zone_profiles": ["active", "off", "passive"] + "zone_profiles": [ + "active", + "off", + "passive" + ] }, "1346fbd8498d4dbcab7e18d51b771f3d": { "available": true, @@ -64,6 +92,7 @@ "location": "06aecb3d00354375924f50c47af36bd2", "model": "Lisa", "model_id": "158-01", + "module_id": "9a08c0d05ffd4f02be9a9bdeb3d01175", "name": "Slaapkamer", "sensors": { "battery": 92, @@ -87,6 +116,7 @@ "location": "d58fec52899f4f1c92e4f8fad6d8c48c", "model": "Tom", "model_id": "106-03", + "module_id": "e71d43382a894c9e888d379368aafba9", "name": "Tom Logeerkamer", "sensors": { "setpoint": 13.0, @@ -111,6 +141,7 @@ "location": "06aecb3d00354375924f50c47af36bd2", "model": "Tom", "model_id": "106-03", + "module_id": "ccc140dafdc5416dab052bffc465a770", "name": "Tom Slaapkamer", "sensors": { "setpoint": 13.0, @@ -133,6 +164,7 @@ "location": "9e4433a9d69f40b3aefd15e74395eaec", "model": "Aqara Smart Plug", "model_id": "lumi.plug.maeu01", + "module_id": "2ddb4057a8fd46aba92e23c770f3297d", "name": "Plug", "sensors": { "electricity_consumed_interval": 0.0 @@ -155,6 +187,7 @@ "location": "d27aede973b54be484f6842d1b2802ad", "model": "Lisa", "model_id": "158-01", + "module_id": "3f91eab3749349799b17f04873bde07e", "name": "Kinderkamer", "sensors": { "battery": 79, @@ -178,6 +211,7 @@ "location": "13228dab8ce04617af318a2888b3c548", "model": "Tom", "model_id": "106-03", + "module_id": "fc657e19ee7442ab8bfe66df62cb40b3", "name": "Tom Woonkamer", "sensors": { "setpoint": 9.0, @@ -205,6 +239,7 @@ "location": "d58fec52899f4f1c92e4f8fad6d8c48c", "model": "Lisa", "model_id": "158-01", + "module_id": "1814d63fb9824aa8aae4d4329d84dfa3", "name": "Logeerkamer", "sensors": { "battery": 80, @@ -226,7 +261,11 @@ }, "dev_class": "gateway", "firmware": "3.2.8", - "gateway_modes": ["away", "full", "vacation"], + "gateway_modes": [ + "away", + "full", + "vacation" + ], "hardware": "AME Smile 2.0 board", "location": "9e4433a9d69f40b3aefd15e74395eaec", "mac_address": "012345670001", @@ -234,7 +273,12 @@ "model_id": "smile_open_therm", "name": "Adam", "notifications": {}, - "regulation_modes": ["heating", "off", "bleeding_cold", "bleeding_hot"], + "regulation_modes": [ + "heating", + "off", + "bleeding_cold", + "bleeding_hot" + ], "select_gateway_mode": "full", "select_regulation_mode": "heating", "sensors": { @@ -251,7 +295,13 @@ "dev_class": "climate", "model": "ThermoZone", "name": "Kinderkamer", - "preset_modes": ["home", "asleep", "away", "vacation", "no_frost"], + "preset_modes": [ + "home", + "asleep", + "away", + "vacation", + "no_frost" + ], "select_schedule": null, "select_zone_profile": "active", "sensors": { @@ -264,11 +314,19 @@ "upper_bound": 99.9 }, "thermostats": { - "primary": ["6f3e9d7084214c21b9dfa46f6eeb8700"], - "secondary": ["d4496250d0e942cfa7aea3476e9070d5"] + "primary": [ + "6f3e9d7084214c21b9dfa46f6eeb8700" + ], + "secondary": [ + "d4496250d0e942cfa7aea3476e9070d5" + ] }, "vendor": "Plugwise", - "zone_profiles": ["active", "off", "passive"] + "zone_profiles": [ + "active", + "off", + "passive" + ] }, "d4496250d0e942cfa7aea3476e9070d5": { "available": true, @@ -278,6 +336,7 @@ "location": "d27aede973b54be484f6842d1b2802ad", "model": "Tom", "model_id": "106-03", + "module_id": "5785d8678bed443ea72b52a1c8a7108d", "name": "Tom Kinderkamer", "sensors": { "setpoint": 13.0, @@ -302,7 +361,13 @@ "dev_class": "climate", "model": "ThermoZone", "name": "Logeerkamer", - "preset_modes": ["home", "asleep", "away", "vacation", "no_frost"], + "preset_modes": [ + "home", + "asleep", + "away", + "vacation", + "no_frost" + ], "select_schedule": null, "select_zone_profile": "active", "sensors": { @@ -315,11 +380,19 @@ "upper_bound": 99.9 }, "thermostats": { - "primary": ["a6abc6a129ee499c88a4d420cc413b47"], - "secondary": ["1da4d325838e4ad8aac12177214505c9"] + "primary": [ + "a6abc6a129ee499c88a4d420cc413b47" + ], + "secondary": [ + "1da4d325838e4ad8aac12177214505c9" + ] }, "vendor": "Plugwise", - "zone_profiles": ["active", "off", "passive"] + "zone_profiles": [ + "active", + "off", + "passive" + ] }, "e4684553153b44afbef2200885f379dc": { "available": true, @@ -344,6 +417,7 @@ }, "model": "Generic heater", "model_id": "10.20", + "module_id": "2bd6e83f0ae340058606c33503202c72", "name": "OpenTherm", "sensors": { "intended_boiler_temperature": 0.0, @@ -368,6 +442,7 @@ "location": "13228dab8ce04617af318a2888b3c548", "model": "Jip", "model_id": "168-01", + "module_id": "73a5e7c19d3744ad96dfad74142d2db4", "name": "Woonkamer", "sensors": { "battery": 100, diff --git a/tests/data/adam/adam_multiple_devices_per_zone.json b/tests/data/adam/adam_multiple_devices_per_zone.json index a64835649..23c37dc63 100644 --- a/tests/data/adam/adam_multiple_devices_per_zone.json +++ b/tests/data/adam/adam_multiple_devices_per_zone.json @@ -6,6 +6,7 @@ "location": "cd143c07248f491493cea0533bc3d669", "model": "Plug", "model_id": "160-01", + "module_id": "4e1da90f22384bc691fe0282e02d272f", "name": "NVR", "sensors": { "electricity_consumed": 34.0, @@ -35,7 +36,13 @@ "dev_class": "climate", "model": "ThermoZone", "name": "Badkamer", - "preset_modes": ["home", "asleep", "away", "vacation", "no_frost"], + "preset_modes": [ + "home", + "asleep", + "away", + "vacation", + "no_frost" + ], "select_schedule": "Badkamer Schema", "sensors": { "temperature": 18.9 @@ -70,7 +77,13 @@ "dev_class": "climate", "model": "ThermoZone", "name": "Bios", - "preset_modes": ["home", "asleep", "away", "vacation", "no_frost"], + "preset_modes": [ + "home", + "asleep", + "away", + "vacation", + "no_frost" + ], "select_schedule": "off", "sensors": { "electricity_consumed": 0.0, @@ -84,8 +97,12 @@ "upper_bound": 100.0 }, "thermostats": { - "primary": ["df4a4a8169904cdb9c03d61a21f42140"], - "secondary": ["a2c3583e0a6349358998b760cea82d2a"] + "primary": [ + "df4a4a8169904cdb9c03d61a21f42140" + ], + "secondary": [ + "a2c3583e0a6349358998b760cea82d2a" + ] }, "vendor": "Plugwise" }, @@ -96,6 +113,7 @@ "location": "cd143c07248f491493cea0533bc3d669", "model": "Plug", "model_id": "160-01", + "module_id": "a03128e5e9334b088c724fd96947c765", "name": "Playstation Smart Plug", "sensors": { "electricity_consumed": 84.1, @@ -125,7 +143,13 @@ "dev_class": "climate", "model": "ThermoZone", "name": "Garage", - "preset_modes": ["home", "asleep", "away", "vacation", "no_frost"], + "preset_modes": [ + "home", + "asleep", + "away", + "vacation", + "no_frost" + ], "select_schedule": "off", "sensors": { "temperature": 15.6 @@ -137,7 +161,9 @@ "upper_bound": 100.0 }, "thermostats": { - "primary": ["e7693eb9582644e5b865dba8d4447cf1"], + "primary": [ + "e7693eb9582644e5b865dba8d4447cf1" + ], "secondary": [] }, "vendor": "Plugwise" @@ -149,6 +175,7 @@ "location": "cd143c07248f491493cea0533bc3d669", "model": "Plug", "model_id": "160-01", + "module_id": "822e635587994817a76599ea1190f9ee", "name": "USG Smart Plug", "sensors": { "electricity_consumed": 8.5, @@ -170,6 +197,7 @@ "location": "cd143c07248f491493cea0533bc3d669", "model": "Plug", "model_id": "160-01", + "module_id": "a5a8713dd3f94f2a9d63db8a521af6b2", "name": "Ziggo Modem", "sensors": { "electricity_consumed": 12.2, @@ -195,6 +223,7 @@ "location": "08963fec7c53423ca5680aa4cb502c63", "model": "Tom", "model_id": "106-03", + "module_id": "b622e3c6a32544f8a4d83e3385592e36", "name": "Thermostatic Radiator Badkamer 1", "sensors": { "battery": 51, @@ -223,6 +252,7 @@ "location": "82fa13f017d240daa0d0ea1775420f24", "model": "Lisa", "model_id": "158-01", + "module_id": "f887b0af3d1e45c794057ee606b21db8", "name": "Zone Thermostat Jessie", "sensors": { "battery": 37, @@ -245,6 +275,7 @@ "location": "c50f167537524366a5af7aa3942feb1e", "model": "Plug", "model_id": "160-01", + "module_id": "800d5287643c4fd89dfcfbf336d4f7ec", "name": "CV Pomp", "sensors": { "electricity_consumed": 35.6, @@ -273,7 +304,13 @@ "dev_class": "climate", "model": "ThermoZone", "name": "Jessie", - "preset_modes": ["home", "asleep", "away", "vacation", "no_frost"], + "preset_modes": [ + "home", + "asleep", + "away", + "vacation", + "no_frost" + ], "select_schedule": "CV Jessie", "sensors": { "temperature": 17.2 @@ -285,8 +322,12 @@ "upper_bound": 100.0 }, "thermostats": { - "primary": ["6a3bf693d05e48e0b460c815a4fdd09d"], - "secondary": ["d3da73bde12a47d5a6b8f9dad971f2ec"] + "primary": [ + "6a3bf693d05e48e0b460c815a4fdd09d" + ], + "secondary": [ + "d3da73bde12a47d5a6b8f9dad971f2ec" + ] }, "vendor": "Plugwise" }, @@ -311,6 +352,7 @@ "location": "cd143c07248f491493cea0533bc3d669", "model": "Plug", "model_id": "160-01", + "module_id": "5ccda7375b0f467e88499a636450dc91", "name": "Fibaro HC2", "sensors": { "electricity_consumed": 12.5, @@ -336,6 +378,7 @@ "location": "12493538af164a409c6a1c79e38afe1c", "model": "Tom", "model_id": "106-03", + "module_id": "39e077a2eb224dcea3415471de00823c", "name": "Bios Cv Thermostatic Radiator ", "sensors": { "battery": 62, @@ -361,6 +404,7 @@ "location": "c50f167537524366a5af7aa3942feb1e", "model": "Tom", "model_id": "106-03", + "module_id": "02d1299fdbab4f7b93765e0af1c250d8", "name": "Floor kraan", "sensors": { "setpoint": 21.5, @@ -388,6 +432,7 @@ "location": "c50f167537524366a5af7aa3942feb1e", "model": "Lisa", "model_id": "158-01", + "module_id": "dd68d0641eb04571be62b9940aae363a", "name": "Zone Lisa WK", "sensors": { "battery": 34, @@ -418,7 +463,13 @@ "dev_class": "climate", "model": "ThermoZone", "name": "Woonkamer", - "preset_modes": ["home", "asleep", "away", "vacation", "no_frost"], + "preset_modes": [ + "home", + "asleep", + "away", + "vacation", + "no_frost" + ], "select_schedule": "GF7 Woonkamer", "sensors": { "electricity_consumed": 35.6, @@ -432,8 +483,12 @@ "upper_bound": 100.0 }, "thermostats": { - "primary": ["b59bcebaf94b499ea7d46e4a66fb62d8"], - "secondary": ["b310b72a0e354bfab43089919b9a88bf"] + "primary": [ + "b59bcebaf94b499ea7d46e4a66fb62d8" + ], + "secondary": [ + "b310b72a0e354bfab43089919b9a88bf" + ] }, "vendor": "Plugwise" }, @@ -444,6 +499,7 @@ "location": "cd143c07248f491493cea0533bc3d669", "model": "Plug", "model_id": "160-01", + "module_id": "3e4e2fa7fa2a4cf18b1be5ed32a978a1", "name": "NAS", "sensors": { "electricity_consumed": 16.5, @@ -469,6 +525,7 @@ "location": "82fa13f017d240daa0d0ea1775420f24", "model": "Tom", "model_id": "106-03", + "module_id": "468bbe14853f4fb18a8860333cecc42a", "name": "Thermostatic Radiator Jessie", "sensors": { "battery": 62, @@ -497,6 +554,7 @@ "location": "12493538af164a409c6a1c79e38afe1c", "model": "Lisa", "model_id": "158-01", + "module_id": "e5f81fd832d844e5bd46219831468a62", "name": "Zone Lisa Bios", "sensors": { "battery": 67, @@ -537,6 +595,7 @@ "location": "446ac08dd04d4eff8ac57489757b7314", "model": "Tom", "model_id": "106-03", + "module_id": "d00e1ba75ed14b2388971b32abc94cde", "name": "CV Kraan Garage", "sensors": { "battery": 68, @@ -582,6 +641,7 @@ "location": "08963fec7c53423ca5680aa4cb502c63", "model": "Lisa", "model_id": "158-01", + "module_id": "ebd9f53ab3894bee91e36350c1fbb6c7", "name": "Thermostatic Radiator Badkamer 2", "sensors": { "battery": 92, diff --git a/tests/data/adam/adam_onoff_cooling_fake_firmware.json b/tests/data/adam/adam_onoff_cooling_fake_firmware.json index f822e33d8..77a452707 100644 --- a/tests/data/adam/adam_onoff_cooling_fake_firmware.json +++ b/tests/data/adam/adam_onoff_cooling_fake_firmware.json @@ -42,7 +42,11 @@ }, "dev_class": "gateway", "firmware": "3.2.8", - "gateway_modes": ["away", "full", "vacation"], + "gateway_modes": [ + "away", + "full", + "vacation" + ], "hardware": "AME Smile 2.0 board", "location": "eedadcb297564f1483faa509179aebed", "mac_address": "012345670001", @@ -70,6 +74,7 @@ "location": "fa5fa6b34f6b40a0972988b20e888ed4", "model": "ThermoTouch", "model_id": "143.1", + "module_id": "e2d52aece0524fde9c346953e5e1acb2", "name": "Thermostaat WK", "sensors": { "setpoint": 21.5, @@ -90,7 +95,13 @@ "dev_class": "climate", "model": "ThermoZone", "name": "Woonkamer", - "preset_modes": ["no_frost", "vacation", "away", "home", "asleep"], + "preset_modes": [ + "no_frost", + "vacation", + "away", + "home", + "asleep" + ], "select_schedule": "Werkdag schema", "select_zone_profile": "active", "sensors": { @@ -105,10 +116,16 @@ "upper_bound": 35.0 }, "thermostats": { - "primary": ["ca79d23ae0094120b877558734cff85c"], + "primary": [ + "ca79d23ae0094120b877558734cff85c" + ], "secondary": [] }, "vendor": "Plugwise", - "zone_profiles": ["active", "off", "passive"] + "zone_profiles": [ + "active", + "off", + "passive" + ] } } diff --git a/tests/data/adam/adam_plus_anna.json b/tests/data/adam/adam_plus_anna.json index 8533e7468..00d4014dd 100644 --- a/tests/data/adam/adam_plus_anna.json +++ b/tests/data/adam/adam_plus_anna.json @@ -1,13 +1,22 @@ { "009490cc2f674ce6b576863fbb64f867": { "active_preset": "home", - "available_schedules": ["Weekschema", "off"], + "available_schedules": [ + "Weekschema", + "off" + ], "climate_mode": "auto", "control_state": "idle", "dev_class": "climate", "model": "ThermoZone", "name": "Living room", - "preset_modes": ["home", "asleep", "away", "vacation", "no_frost"], + "preset_modes": [ + "home", + "asleep", + "away", + "vacation", + "no_frost" + ], "select_schedule": "Weekschema", "sensors": { "electricity_consumed": 74.2, @@ -21,7 +30,9 @@ "upper_bound": 35.0 }, "thermostats": { - "primary": ["ee62cad889f94e8ca3d09021f03a660b"], + "primary": [ + "ee62cad889f94e8ca3d09021f03a660b" + ], "secondary": [] }, "vendor": "Plugwise" @@ -42,6 +53,7 @@ "upper_bound": 100.0 }, "model": "Generic heater", + "module_id": "94c63e8b46284f6ab2f40d19619afcba", "name": "OpenTherm", "sensors": { "intended_boiler_temperature": 0.0, @@ -58,6 +70,7 @@ "location": "45d410adf8fd461e85cebf16d5ead542", "model": "Plug", "model_id": "160-01", + "module_id": "0fd8411d0bc446a08c336a7bba029e22", "name": "MediaCenter", "sensors": { "electricity_consumed": 10.3, @@ -100,6 +113,7 @@ "location": "009490cc2f674ce6b576863fbb64f867", "model": "ThermoTouch", "model_id": "143.1", + "module_id": "bb2fc3da88144d018ee51861e13f505d", "name": "Anna", "sensors": { "setpoint": 20.5, @@ -112,6 +126,7 @@ "dev_class": "computer_desktop_plug", "firmware": "2019-06-21T02:00:00+02:00", "location": "5ccb6c41a7d9403988d261ceee04239f", + "module_id": "72b2aa43d2ea4a33b23ade5e6629de8d", "name": "Work-PC", "sensors": { "electricity_consumed": 80.5, diff --git a/tests/data/adam/adam_zone_per_device.json b/tests/data/adam/adam_zone_per_device.json index ce3d258b4..d6bdc441e 100644 --- a/tests/data/adam/adam_zone_per_device.json +++ b/tests/data/adam/adam_zone_per_device.json @@ -6,6 +6,7 @@ "location": "c4d2bda6df8146caa2e5c2b5dc65660e", "model": "Plug", "model_id": "160-01", + "module_id": "4e1da90f22384bc691fe0282e02d272f", "name": "NVR", "sensors": { "electricity_consumed": 34.0, @@ -35,7 +36,13 @@ "dev_class": "climate", "model": "ThermoZone", "name": "Badkamer", - "preset_modes": ["home", "asleep", "away", "vacation", "no_frost"], + "preset_modes": [ + "home", + "asleep", + "away", + "vacation", + "no_frost" + ], "select_schedule": "Badkamer Schema", "sensors": { "temperature": 18.8 @@ -47,8 +54,12 @@ "upper_bound": 100.0 }, "thermostats": { - "primary": ["f1fee6043d3642a9b0a65297455f008e"], - "secondary": ["680423ff840043738f42cc7f1ff97a36"] + "primary": [ + "f1fee6043d3642a9b0a65297455f008e" + ], + "secondary": [ + "680423ff840043738f42cc7f1ff97a36" + ] }, "vendor": "Plugwise" }, @@ -67,7 +78,13 @@ "dev_class": "climate", "model": "ThermoZone", "name": "Bios", - "preset_modes": ["home", "asleep", "away", "vacation", "no_frost"], + "preset_modes": [ + "home", + "asleep", + "away", + "vacation", + "no_frost" + ], "select_schedule": "off", "sensors": { "electricity_consumed": 0.0, @@ -81,8 +98,12 @@ "upper_bound": 100.0 }, "thermostats": { - "primary": ["df4a4a8169904cdb9c03d61a21f42140"], - "secondary": ["a2c3583e0a6349358998b760cea82d2a"] + "primary": [ + "df4a4a8169904cdb9c03d61a21f42140" + ], + "secondary": [ + "a2c3583e0a6349358998b760cea82d2a" + ] }, "vendor": "Plugwise" }, @@ -93,6 +114,7 @@ "location": "4efbab4c8bb84fbab26c8decf670eb96", "model": "Plug", "model_id": "160-01", + "module_id": "a03128e5e9334b088c724fd96947c765", "name": "Playstation Smart Plug", "sensors": { "electricity_consumed": 80.1, @@ -122,7 +144,13 @@ "dev_class": "climate", "model": "ThermoZone", "name": "Garage", - "preset_modes": ["home", "asleep", "away", "vacation", "no_frost"], + "preset_modes": [ + "home", + "asleep", + "away", + "vacation", + "no_frost" + ], "select_schedule": "off", "sensors": { "temperature": 15.6 @@ -134,7 +162,9 @@ "upper_bound": 100.0 }, "thermostats": { - "primary": ["e7693eb9582644e5b865dba8d4447cf1"], + "primary": [ + "e7693eb9582644e5b865dba8d4447cf1" + ], "secondary": [] }, "vendor": "Plugwise" @@ -146,6 +176,7 @@ "location": "0217e9743c174eef9d6e9f680d403ce2", "model": "Plug", "model_id": "160-01", + "module_id": "822e635587994817a76599ea1190f9ee", "name": "USG Smart Plug", "sensors": { "electricity_consumed": 8.5, @@ -167,6 +198,7 @@ "location": "2b1591ecf6344d4d93b03dece9747648", "model": "Plug", "model_id": "160-01", + "module_id": "a5a8713dd3f94f2a9d63db8a521af6b2", "name": "Ziggo Modem", "sensors": { "electricity_consumed": 12.2, @@ -192,6 +224,7 @@ "location": "08963fec7c53423ca5680aa4cb502c63", "model": "Tom", "model_id": "106-03", + "module_id": "b622e3c6a32544f8a4d83e3385592e36", "name": "Thermostatic Radiator Badkamer", "sensors": { "battery": 51, @@ -220,6 +253,7 @@ "location": "82fa13f017d240daa0d0ea1775420f24", "model": "Lisa", "model_id": "158-01", + "module_id": "f887b0af3d1e45c794057ee606b21db8", "name": "Zone Thermostat Jessie", "sensors": { "battery": 37, @@ -242,6 +276,7 @@ "location": "c50f167537524366a5af7aa3942feb1e", "model": "Plug", "model_id": "160-01", + "module_id": "800d5287643c4fd89dfcfbf336d4f7ec", "name": "CV Pomp", "sensors": { "electricity_consumed": 35.8, @@ -270,7 +305,13 @@ "dev_class": "climate", "model": "ThermoZone", "name": "Jessie", - "preset_modes": ["home", "asleep", "away", "vacation", "no_frost"], + "preset_modes": [ + "home", + "asleep", + "away", + "vacation", + "no_frost" + ], "select_schedule": "CV Jessie", "sensors": { "temperature": 17.1 @@ -282,8 +323,12 @@ "upper_bound": 100.0 }, "thermostats": { - "primary": ["6a3bf693d05e48e0b460c815a4fdd09d"], - "secondary": ["d3da73bde12a47d5a6b8f9dad971f2ec"] + "primary": [ + "6a3bf693d05e48e0b460c815a4fdd09d" + ], + "secondary": [ + "d3da73bde12a47d5a6b8f9dad971f2ec" + ] }, "vendor": "Plugwise" }, @@ -308,6 +353,7 @@ "location": "cd143c07248f491493cea0533bc3d669", "model": "Plug", "model_id": "160-01", + "module_id": "5ccda7375b0f467e88499a636450dc91", "name": "Fibaro HC2", "sensors": { "electricity_consumed": 12.5, @@ -333,6 +379,7 @@ "location": "12493538af164a409c6a1c79e38afe1c", "model": "Tom", "model_id": "106-03", + "module_id": "39e077a2eb224dcea3415471de00823c", "name": "Bios Cv Thermostatic Radiator ", "sensors": { "battery": 62, @@ -358,6 +405,7 @@ "location": "c50f167537524366a5af7aa3942feb1e", "model": "Tom", "model_id": "106-03", + "module_id": "02d1299fdbab4f7b93765e0af1c250d8", "name": "Floor kraan", "sensors": { "setpoint": 21.5, @@ -385,6 +433,7 @@ "location": "c50f167537524366a5af7aa3942feb1e", "model": "Lisa", "model_id": "158-01", + "module_id": "dd68d0641eb04571be62b9940aae363a", "name": "Zone Lisa WK", "sensors": { "battery": 34, @@ -415,7 +464,13 @@ "dev_class": "climate", "model": "ThermoZone", "name": "Woonkamer", - "preset_modes": ["home", "asleep", "away", "vacation", "no_frost"], + "preset_modes": [ + "home", + "asleep", + "away", + "vacation", + "no_frost" + ], "select_schedule": "GF7 Woonkamer", "sensors": { "electricity_consumed": 35.8, @@ -429,8 +484,12 @@ "upper_bound": 100.0 }, "thermostats": { - "primary": ["b59bcebaf94b499ea7d46e4a66fb62d8"], - "secondary": ["b310b72a0e354bfab43089919b9a88bf"] + "primary": [ + "b59bcebaf94b499ea7d46e4a66fb62d8" + ], + "secondary": [ + "b310b72a0e354bfab43089919b9a88bf" + ] }, "vendor": "Plugwise" }, @@ -441,6 +500,7 @@ "location": "e704bae65654496f9cade9c855decdfe", "model": "Plug", "model_id": "160-01", + "module_id": "3e4e2fa7fa2a4cf18b1be5ed32a978a1", "name": "NAS", "sensors": { "electricity_consumed": 16.5, @@ -466,6 +526,7 @@ "location": "82fa13f017d240daa0d0ea1775420f24", "model": "Tom", "model_id": "106-03", + "module_id": "468bbe14853f4fb18a8860333cecc42a", "name": "Thermostatic Radiator Jessie", "sensors": { "battery": 62, @@ -494,6 +555,7 @@ "location": "12493538af164a409c6a1c79e38afe1c", "model": "Lisa", "model_id": "158-01", + "module_id": "e5f81fd832d844e5bd46219831468a62", "name": "Zone Lisa Bios", "sensors": { "battery": 67, @@ -534,6 +596,7 @@ "location": "446ac08dd04d4eff8ac57489757b7314", "model": "Tom", "model_id": "106-03", + "module_id": "d00e1ba75ed14b2388971b32abc94cde", "name": "CV Kraan Garage", "sensors": { "battery": 68, @@ -562,6 +625,7 @@ "location": "08963fec7c53423ca5680aa4cb502c63", "model": "Lisa", "model_id": "158-01", + "module_id": "ebd9f53ab3894bee91e36350c1fbb6c7", "name": "Zone Thermostat Badkamer", "sensors": { "battery": 92, diff --git a/tests/data/anna/anna_v4.json b/tests/data/anna/anna_v4.json index 7e6f138be..563bd837e 100644 --- a/tests/data/anna/anna_v4.json +++ b/tests/data/anna/anna_v4.json @@ -1,7 +1,11 @@ { "01b85360fdd243d0aaad4d6ac2a5ba7e": { "active_preset": "home", - "available_schedules": ["Standaard", "Thuiswerken", "off"], + "available_schedules": [ + "Standaard", + "Thuiswerken", + "off" + ], "climate_mode": "heat", "control_state": "heating", "dev_class": "thermostat", @@ -9,8 +13,15 @@ "hardware": "6539-1301-5002", "location": "eb5309212bf5407bb143e5bfa3b18aee", "model": "ThermoTouch", + "module_id": "807a45cbc950419c98ce4624bc27ff09", "name": "Anna", - "preset_modes": ["vacation", "no_frost", "away", "asleep", "home"], + "preset_modes": [ + "vacation", + "no_frost", + "away", + "asleep", + "home" + ], "select_schedule": "off", "sensors": { "illuminance": 60.0, @@ -72,6 +83,7 @@ }, "model": "Generic heater", "model_id": "2.32", + "module_id": "88c1299c194f4b39b857e369803c2481", "name": "OpenTherm", "sensors": { "intended_boiler_temperature": 39.9, diff --git a/tests/test_adam.py b/tests/test_adam.py index e47b3db18..c860accc5 100644 --- a/tests/test_adam.py +++ b/tests/test_adam.py @@ -228,7 +228,7 @@ async def test_connect_adam_zone_per_device(self): test_items = await self.device_test(api, "2022-05-16 00:00:01", testdata) assert api.gateway_id == "fe799307f1624099878210aa0b9f1475" - assert self.entity_items == 386 + assert self.entity_items == 402 assert test_items == self.entity_items assert "af82e4ccf9c548528166d38e560662a4" in self.notifications @@ -302,7 +302,7 @@ async def test_connect_adam_multiple_devices_per_zone(self): ) test_items = await self.device_test(api, "2022-05-16 00:00:01", testdata) - assert self.entity_items == 394 + assert self.entity_items == 410 assert test_items == self.entity_items assert "af82e4ccf9c548528166d38e560662a4" in self.notifications @@ -339,7 +339,7 @@ async def test_adam_heatpump_cooling(self): server, api, client = await self.connect_wrapper() test_items = await self.device_test(api, "2022-01-02 00:00:01", testdata) - assert self.entity_items == 539 + assert self.entity_items == 560 assert test_items == self.entity_items assert self.cooling_present assert self._cooling_enabled @@ -363,7 +363,7 @@ async def test_connect_adam_onoff_cooling_fake_firmware(self): ) test_items = await self.device_test(api, "2022-01-02 00:00:01", testdata) - assert self.entity_items == 70 + assert self.entity_items == 71 assert test_items == self.entity_items assert self.cooling_present # assert self._cooling_enabled - no cooling_enabled indication present @@ -388,7 +388,7 @@ async def test_connect_adam_plus_anna(self): test_items = await self.device_test(api, "2020-03-22 00:00:01", testdata) assert api.gateway_id == "b128b4bbbd1f47e9bf4d756e8fb5ee94" - assert self.entity_items == 82 + assert self.entity_items == 86 assert test_items == self.entity_items assert "6fb89e35caeb4b1cb275184895202d84" in self.notifications @@ -429,7 +429,7 @@ async def test_adam_plus_jip(self): test_items = await self.device_test(api, "2021-06-20 00:00:01", testdata) assert api.gateway_id == "b5c2386c6f6342669e50fe49dd05b188" - assert self.entity_items == 269 + assert self.entity_items == 279 assert test_items == self.entity_items # Negative test diff --git a/tests/test_anna.py b/tests/test_anna.py index 84fbcf27a..26f72bfcc 100644 --- a/tests/test_anna.py +++ b/tests/test_anna.py @@ -29,7 +29,7 @@ async def test_connect_anna_v4(self): await self.device_test(api, "2020-04-05 00:00:01", testdata) assert api.gateway_id == "0466eae8520144c78afb29628384edeb" - assert self.entity_items == 60 + assert self.entity_items == 62 assert not self.notifications assert not self.cooling_present @@ -101,7 +101,7 @@ async def test_connect_anna_v4_dhw(self): ) await self.device_test(api, "2020-04-05 00:00:01", testdata) - assert self.entity_items == 60 + assert self.entity_items == 62 assert not self.notifications result = await self.tinker_thermostat( @@ -130,7 +130,7 @@ async def test_connect_anna_v4_no_tag(self): ) await self.device_test(api, "2020-04-05 00:00:01", testdata) - assert self.entity_items == 60 + assert self.entity_items == 62 result = await self.tinker_thermostat( api, @@ -158,7 +158,7 @@ async def test_connect_anna_without_boiler_fw441(self): ) await self.device_test(api, "2022-05-16 00:00:01", testdata) - assert self.entity_items == 41 + assert self.entity_items == 43 assert not self.notifications result = await self.tinker_thermostat( @@ -186,7 +186,7 @@ async def test_connect_anna_heatpump_heating(self): await self.device_test(api, "2020-04-12 00:00:01", testdata) assert api.gateway_id == "015ae9ea3f964e668e490fa39da3870b" - assert self.entity_items == 69 + assert self.entity_items == 71 assert not self.notifications assert self.cooling_present assert not self._cooling_enabled @@ -216,7 +216,7 @@ async def test_connect_anna_heatpump_heating(self): await self.device_test( api, "2020-04-13 00:00:01", testdata_updated, initialize=False ) - assert self.entity_items == 66 + assert self.entity_items == 68 await api.close_connection() await self.disconnect(server, client) @@ -241,7 +241,7 @@ async def test_connect_anna_heatpump_cooling(self): ) await self.device_test(api, "2020-04-19 00:00:01", testdata) - assert self.entity_items == 66 + assert self.entity_items == 68 assert self.cooling_present assert not self.notifications @@ -287,7 +287,7 @@ async def test_connect_anna_heatpump_cooling_fake_firmware(self): ) await self.device_test(api, "2020-04-19 00:00:01", testdata) - assert self.entity_items == 66 + assert self.entity_items == 68 assert self.cooling_present assert self._cooling_enabled assert self._cooling_active @@ -313,7 +313,7 @@ async def test_connect_anna_elga_no_cooling(self): await self.device_test(api, "2020-04-12 00:00:01", testdata) assert api.gateway_id == "015ae9ea3f964e668e490fa39da3870b" - assert self.entity_items == 65 + assert self.entity_items == 67 assert not self.notifications assert not self.cooling_present @@ -336,7 +336,7 @@ async def test_connect_anna_elga_2(self): ) await self.device_test(api, "2022-03-13 00:00:01", testdata) - assert self.entity_items == 61 + assert self.entity_items == 63 assert api.gateway_id == "fb49af122f6e4b0f91267e1cf7666d6f" assert self.cooling_present assert not self._cooling_enabled @@ -356,7 +356,7 @@ async def test_connect_anna_elga_2_schedule_off(self): await self.device_test(api, "2022-03-13 00:00:01", testdata) assert not self._cooling_enabled - assert self.entity_items == 65 + assert self.entity_items == 67 result = await self.tinker_thermostat( api, @@ -387,7 +387,7 @@ async def test_connect_anna_elga_2_cooling(self): ) await self.device_test(api, "2022-03-10 00:00:01", testdata) - assert self.entity_items == 65 + assert self.entity_items == 67 assert not self.notifications assert self.cooling_present @@ -440,7 +440,7 @@ async def test_connect_anna_loria_heating_idle(self): ) await self.device_test(api, "2022-05-16 00:00:01", testdata) - assert self.entity_items == 68 + assert self.entity_items == 70 assert self.cooling_present assert not self._cooling_enabled @@ -505,7 +505,7 @@ async def test_connect_anna_loria_cooling_active(self): ) await self.device_test(api, "2022-05-16 00:00:01", testdata) - assert self.entity_items == 68 + assert self.entity_items == 70 assert self.cooling_present assert self._cooling_enabled @@ -528,7 +528,7 @@ async def test_connect_anna_loria_driessens(self): ) await self.device_test(api, "2022-05-16 00:00:01", testdata) - assert self.entity_items == 68 + assert self.entity_items == 70 assert self.cooling_present assert not self._cooling_enabled @@ -551,7 +551,7 @@ async def test_connect_anna_p1(self): ) await self.device_test(api, "2025-11-02 00:00:01", testdata) - assert self.entity_items == 76 + assert self.entity_items == 78 await api.close_connection() await self.disconnect(server, client) @@ -572,7 +572,7 @@ async def test_connect_anna_v4_no_modules(self): ) await self.device_test(api, "2022-05-16 00:00:01", testdata) - assert self.entity_items == 12 + assert self.entity_items == 14 await api.close_connection() await self.disconnect(server, client) From 4054328b6b5b90c4b9cb1b0b28151b825af7ee8c Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Thu, 18 Dec 2025 18:05:43 +0100 Subject: [PATCH 41/99] Debug --- plugwise/helper.py | 1 + 1 file changed, 1 insertion(+) diff --git a/plugwise/helper.py b/plugwise/helper.py index 519be067b..270af3612 100644 --- a/plugwise/helper.py +++ b/plugwise/helper.py @@ -699,6 +699,7 @@ def _get_gateway_outdoor_temp(self, entity_id: str, data: GwEntityData) -> None: locator = "./logs/point_log[type='outdoor_temperature']/period/measurement" if (found := self._home_location.find(locator)) is not None: value = format_measure(found.text, NONE) + LOGGER.debug("HOI outdoor_temp = %s", value) data.update({"sensors": {"outdoor_temperature": value}}) self._count += 1 From 8ef0d49003ff2b439ce1f4233931acd4af3389d1 Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Thu, 18 Dec 2025 18:29:08 +0100 Subject: [PATCH 42/99] Try --- plugwise/__init__.py | 1 - 1 file changed, 1 deletion(-) diff --git a/plugwise/__init__.py b/plugwise/__init__.py index bf4f3b04b..e4e912802 100644 --- a/plugwise/__init__.py +++ b/plugwise/__init__.py @@ -328,7 +328,6 @@ async def _smile_detect_legacy( async def async_update(self) -> dict[str, GwEntityData]: """Update the Plughwise Gateway entities and their data and states.""" - data: dict[str, GwEntityData] = {} try: data = await self._smile_api.async_update() except (DataMissingError, KeyError) as err: From c442c002ba4cb1e83abba20e653f6f25d9b776df Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Thu, 18 Dec 2025 18:31:39 +0100 Subject: [PATCH 43/99] Debug 2 --- plugwise/__init__.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugwise/__init__.py b/plugwise/__init__.py index e4e912802..a5614c644 100644 --- a/plugwise/__init__.py +++ b/plugwise/__init__.py @@ -328,11 +328,13 @@ async def _smile_detect_legacy( async def async_update(self) -> dict[str, GwEntityData]: """Update the Plughwise Gateway entities and their data and states.""" + data: dict[str, GwEntityData] = {} try: data = await self._smile_api.async_update() except (DataMissingError, KeyError) as err: raise PlugwiseError("No Plugwise data received") from err + LOGGER.debug("HOI data: %s", data) return data ######################################################################################################## From 225e2850dcc50e05c5e8530a42e09d9fc8985386 Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Fri, 19 Dec 2025 15:56:13 +0100 Subject: [PATCH 44/99] Detect appliance name-change --- plugwise/helper.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugwise/helper.py b/plugwise/helper.py index 270af3612..226eac406 100644 --- a/plugwise/helper.py +++ b/plugwise/helper.py @@ -169,7 +169,10 @@ def _get_appliances(self) -> bool: continue self._new_appliances.append(appl.entity_id) - if appl.entity_id in self._existing_appliances: + if ( + appl.entity_id in self._existing_appliances + and self.gw_entities[appl.entity_id]["name"] == appl.name + ): continue self._create_gw_entities(appl) From e34a4149b348392bb291661a005fb88e88ebb7b4 Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Fri, 19 Dec 2025 16:35:56 +0100 Subject: [PATCH 45/99] Update test entity_items asserts and test-jsons - 2 --- fixtures/adam_heatpump_cooling/data.json | 207 +++++++++++++++--- fixtures/adam_jip/data.json | 111 ++++++++-- .../adam_multiple_devices_per_zone/data.json | 84 ++++++- .../data.json | 25 ++- fixtures/adam_plus_anna/data.json | 21 +- fixtures/adam_plus_anna_new/data.json | 60 ++++- .../data.json | 62 +++++- fixtures/adam_zone_per_device/data.json | 92 ++++++-- fixtures/anna_elga_2/data.json | 15 +- fixtures/anna_elga_2_cooling/data.json | 15 +- fixtures/anna_elga_2_schedule_off/data.json | 15 +- fixtures/anna_elga_no_cooling/data.json | 15 +- fixtures/anna_heatpump_cooling/data.json | 15 +- .../data.json | 15 +- fixtures/anna_heatpump_heating/data.json | 15 +- fixtures/anna_loria_cooling_active/data.json | 24 +- fixtures/anna_loria_driessens/data.json | 18 +- fixtures/anna_loria_heating_idle/data.json | 24 +- fixtures/anna_p1/data.json | 16 +- fixtures/anna_v4/data.json | 16 +- fixtures/anna_v4_dhw/data.json | 16 +- fixtures/anna_v4_no_tag/data.json | 16 +- fixtures/anna_without_boiler_fw441/data.json | 15 +- tests/test_anna.py | 8 +- tests/test_legacy_anna.py | 4 +- 25 files changed, 787 insertions(+), 137 deletions(-) diff --git a/fixtures/adam_heatpump_cooling/data.json b/fixtures/adam_heatpump_cooling/data.json index 71bfad7e2..60d15563c 100644 --- a/fixtures/adam_heatpump_cooling/data.json +++ b/fixtures/adam_heatpump_cooling/data.json @@ -12,7 +12,13 @@ "dev_class": "climate", "model": "ThermoZone", "name": "Slaapkamer SJ", - "preset_modes": ["no_frost", "vacation", "away", "home", "asleep"], + "preset_modes": [ + "no_frost", + "vacation", + "away", + "home", + "asleep" + ], "select_schedule": "off", "select_zone_profile": "passive", "sensors": { @@ -27,11 +33,17 @@ "upper_bound": 99.9 }, "thermostats": { - "primary": ["d3a276aeb3114a509bab1e4bf8c40348"], + "primary": [ + "d3a276aeb3114a509bab1e4bf8c40348" + ], "secondary": [] }, "vendor": "Plugwise", - "zone_profiles": ["active", "off", "passive"] + "zone_profiles": [ + "active", + "off", + "passive" + ] }, "0ca13e8176204ca7bf6f09de59f81c83": { "available": true, @@ -58,6 +70,7 @@ }, "model": "Generic heater/cooler", "model_id": "17.1", + "module_id": "1ad05e10747b4e40ba2ba82f2872d1c1", "name": "OpenTherm", "sensors": { "dhw_temperature": 63.5, @@ -84,6 +97,7 @@ "location": "b52908550469425b812c87f766fe5303", "model": "Lisa", "model_id": "158-01", + "module_id": "1f0d0e98291145afa4da4432f76a7bd2", "name": "Thermostaat BK", "sensors": { "battery": 55, @@ -106,6 +120,7 @@ "location": "20e735858f8146cead98b873177a4f99", "model": "Plug", "model_id": "160-01", + "module_id": "0a00ddca4e9543c69c6648e5488590dd", "name": "Smart Plug DB", "sensors": { "electricity_consumed": 0.0, @@ -132,7 +147,13 @@ "dev_class": "climate", "model": "ThermoZone", "name": "Slaapkamer DB", - "preset_modes": ["no_frost", "vacation", "away", "home", "asleep"], + "preset_modes": [ + "no_frost", + "vacation", + "away", + "home", + "asleep" + ], "select_schedule": "off", "select_zone_profile": "passive", "sensors": { @@ -147,11 +168,17 @@ "upper_bound": 99.9 }, "thermostats": { - "primary": ["47e2c550a33846b680725aa3fb229473"], + "primary": [ + "47e2c550a33846b680725aa3fb229473" + ], "secondary": [] }, "vendor": "Plugwise", - "zone_profiles": ["active", "off", "passive"] + "zone_profiles": [ + "active", + "off", + "passive" + ] }, "2e0fc4db2a6d4cbeb7cf786143543961": { "available": true, @@ -160,6 +187,7 @@ "location": "a562019b0b1f47a4bde8ebe3dbe3e8a9", "model": "Plug", "model_id": "160-01", + "module_id": "3fa224c4c39f458583b2dab4515210bf", "name": "Smart Plug KK", "sensors": { "electricity_consumed": 2.13, @@ -180,6 +208,7 @@ "location": "04b15f6e884448288f811d29fb7b1b30", "model": "Plug", "model_id": "160-01", + "module_id": "483836101eb141e2b04045eedc3716ff", "name": "Smart Plug SJ", "sensors": { "electricity_consumed": 0.0, @@ -200,6 +229,7 @@ "location": "fa5fa6b34f6b40a0972988b20e888ed4", "model": "Plug", "model_id": "160-01", + "module_id": "e20da25d0cbf456097aa1a954efed11b", "name": "Smart Plug WK", "sensors": { "electricity_consumed": 0.0, @@ -221,6 +251,7 @@ "location": "20e735858f8146cead98b873177a4f99", "model": "Lisa", "model_id": "158-01", + "module_id": "ddd4ed4873864199b6121459ae9fa4ae", "name": "Thermostaat DB", "sensors": { "setpoint": 18.0, @@ -248,7 +279,13 @@ "dev_class": "climate", "model": "ThermoZone", "name": "Badkamer 2", - "preset_modes": ["no_frost", "vacation", "away", "home", "asleep"], + "preset_modes": [ + "no_frost", + "vacation", + "away", + "home", + "asleep" + ], "select_schedule": "Werkdag schema", "select_zone_profile": "passive", "sensors": { @@ -262,11 +299,17 @@ "upper_bound": 99.9 }, "thermostats": { - "primary": ["f04c985c11ad4848b8fcd710343f9dcf"], + "primary": [ + "f04c985c11ad4848b8fcd710343f9dcf" + ], "secondary": [] }, "vendor": "Plugwise", - "zone_profiles": ["active", "off", "passive"] + "zone_profiles": [ + "active", + "off", + "passive" + ] }, "5ead63c65e5f44e7870ba2bd680ceb9e": { "available": true, @@ -275,6 +318,7 @@ "location": "9a27714b970547ee9a6bdadc2b815ad5", "model": "Plug", "model_id": "160-01", + "module_id": "2028add51f214a3dbddfa1706e63cfed", "name": "Smart Plug SQ", "sensors": { "electricity_consumed": 0.0, @@ -294,7 +338,11 @@ }, "dev_class": "gateway", "firmware": "3.2.8", - "gateway_modes": ["away", "full", "vacation"], + "gateway_modes": [ + "away", + "full", + "vacation" + ], "hardware": "AME Smile 2.0 board", "location": "eedadcb297564f1483faa509179aebed", "mac_address": "012345670001", @@ -325,6 +373,7 @@ "location": "e39529c79ab54fda9bed26cfc0447546", "model": "Lisa", "model_id": "158-01", + "module_id": "d2f732f328ba447abd5be12f2e196205", "name": "Thermostaat JM", "sensors": { "setpoint": 18.0, @@ -346,6 +395,7 @@ "location": "b52908550469425b812c87f766fe5303", "model": "Plug", "model_id": "160-01", + "module_id": "44fe408e4afd47c19928941ef5499298", "name": "Smart Plug BK", "sensors": { "electricity_consumed": 0.0, @@ -366,6 +416,7 @@ "location": "5cc21042f87f4b4c94ccb5537c47a53f", "model": "Plug", "model_id": "160-01", + "module_id": "1695cccaacc94580860544338b272ce0", "name": "Smart Plug BK2", "sensors": { "electricity_consumed": 0.0, @@ -392,7 +443,13 @@ "dev_class": "climate", "model": "ThermoZone", "name": "Badkamer 1", - "preset_modes": ["no_frost", "vacation", "away", "home", "asleep"], + "preset_modes": [ + "no_frost", + "vacation", + "away", + "home", + "asleep" + ], "select_schedule": "Werkdag schema", "select_zone_profile": "passive", "sensors": { @@ -407,11 +464,17 @@ "upper_bound": 99.9 }, "thermostats": { - "primary": ["eac5db95d97241f6b17790897847ccf5"], + "primary": [ + "eac5db95d97241f6b17790897847ccf5" + ], "secondary": [] }, "vendor": "Plugwise", - "zone_profiles": ["active", "off", "passive"] + "zone_profiles": [ + "active", + "off", + "passive" + ] }, "93ac3f7bf25342f58cbb77c4a99ac0b3": { "active_preset": "away", @@ -426,7 +489,13 @@ "dev_class": "climate", "model": "ThermoZone", "name": "Slaapkamer RB", - "preset_modes": ["no_frost", "vacation", "away", "home", "asleep"], + "preset_modes": [ + "no_frost", + "vacation", + "away", + "home", + "asleep" + ], "select_schedule": "off", "select_zone_profile": "passive", "sensors": { @@ -440,11 +509,17 @@ "upper_bound": 99.9 }, "thermostats": { - "primary": ["c4ed311d54e341f58b4cdd201d1fde7e"], + "primary": [ + "c4ed311d54e341f58b4cdd201d1fde7e" + ], "secondary": [] }, "vendor": "Plugwise", - "zone_profiles": ["active", "off", "passive"] + "zone_profiles": [ + "active", + "off", + "passive" + ] }, "96714ad90fc948bcbcb5021c4b9f5ae9": { "available": true, @@ -453,6 +528,7 @@ "location": "e39529c79ab54fda9bed26cfc0447546", "model": "Plug", "model_id": "160-01", + "module_id": "9a3848f23b814b708f7f5bf15702c60d", "name": "Smart Plug JM", "sensors": { "electricity_consumed": 0.0, @@ -479,7 +555,13 @@ "dev_class": "climate", "model": "ThermoZone", "name": "Slaapkamer SQ", - "preset_modes": ["no_frost", "vacation", "away", "home", "asleep"], + "preset_modes": [ + "no_frost", + "vacation", + "away", + "home", + "asleep" + ], "select_schedule": "off", "select_zone_profile": "passive", "sensors": { @@ -494,11 +576,17 @@ "upper_bound": 99.9 }, "thermostats": { - "primary": ["beb32da072274e698146db8b022f3c36"], + "primary": [ + "beb32da072274e698146db8b022f3c36" + ], "secondary": [] }, "vendor": "Plugwise", - "zone_profiles": ["active", "off", "passive"] + "zone_profiles": [ + "active", + "off", + "passive" + ] }, "a03b6e8e76dd4646af1a77c31dd9370c": { "available": true, @@ -507,6 +595,7 @@ "location": "93ac3f7bf25342f58cbb77c4a99ac0b3", "model": "Plug", "model_id": "160-01", + "module_id": "3e205ba6cede43e5b461e7c76340a64d", "name": "Smart Plug RB", "sensors": { "electricity_consumed": 3.13, @@ -533,7 +622,13 @@ "dev_class": "climate", "model": "ThermoZone", "name": "Keuken", - "preset_modes": ["no_frost", "vacation", "away", "home", "asleep"], + "preset_modes": [ + "no_frost", + "vacation", + "away", + "home", + "asleep" + ], "select_schedule": "Werkdag schema", "select_zone_profile": "active", "sensors": { @@ -548,11 +643,17 @@ "upper_bound": 99.9 }, "thermostats": { - "primary": ["ea8372c0e3ad4622ad45a041d02425f5"], + "primary": [ + "ea8372c0e3ad4622ad45a041d02425f5" + ], "secondary": [] }, "vendor": "Plugwise", - "zone_profiles": ["active", "off", "passive"] + "zone_profiles": [ + "active", + "off", + "passive" + ] }, "b52908550469425b812c87f766fe5303": { "active_preset": "away", @@ -567,7 +668,13 @@ "dev_class": "climate", "model": "ThermoZone", "name": "Bijkeuken", - "preset_modes": ["no_frost", "vacation", "away", "home", "asleep"], + "preset_modes": [ + "no_frost", + "vacation", + "away", + "home", + "asleep" + ], "select_schedule": "off", "select_zone_profile": "active", "sensors": { @@ -582,11 +689,17 @@ "upper_bound": 99.9 }, "thermostats": { - "primary": ["1053c8bbf8be43c6921742b146a625f1"], + "primary": [ + "1053c8bbf8be43c6921742b146a625f1" + ], "secondary": [] }, "vendor": "Plugwise", - "zone_profiles": ["active", "off", "passive"] + "zone_profiles": [ + "active", + "off", + "passive" + ] }, "bbcffa48019f4b09b8368bbaf9559e68": { "available": true, @@ -595,6 +708,7 @@ "location": "8cf650a4c10c44819e426bed406aec34", "model": "Plug", "model_id": "160-01", + "module_id": "7435452fbc684a30a4978913f342c68b", "name": "Smart Plug BK1", "sensors": { "electricity_consumed": 0.0, @@ -616,6 +730,7 @@ "location": "9a27714b970547ee9a6bdadc2b815ad5", "model": "Lisa", "model_id": "158-01", + "module_id": "6991158ce7774dca864ec8fcf7a039ab", "name": "Thermostaat SQ", "sensors": { "setpoint": 18.5, @@ -638,6 +753,7 @@ "location": "93ac3f7bf25342f58cbb77c4a99ac0b3", "model": "Lisa", "model_id": "158-01", + "module_id": "11e4f552602c4b03980e0955e0f114f0", "name": "Thermostaat RB", "sensors": { "setpoint": 17.0, @@ -657,6 +773,7 @@ "location": "fa5fa6b34f6b40a0972988b20e888ed4", "model": "ThermoTouch", "model_id": "143.1", + "module_id": "e2d52aece0524fde9c346953e5e1acb2", "name": "Thermostaat WK", "sensors": { "setpoint": 21.5, @@ -672,6 +789,7 @@ "location": "04b15f6e884448288f811d29fb7b1b30", "model": "Lisa", "model_id": "158-01", + "module_id": "21d57d51898b41c69ad87fffb59f2581", "name": "Thermostaat SJ", "sensors": { "setpoint": 20.5, @@ -699,7 +817,13 @@ "dev_class": "climate", "model": "ThermoZone", "name": "Slaapkamer JM", - "preset_modes": ["no_frost", "vacation", "away", "home", "asleep"], + "preset_modes": [ + "no_frost", + "vacation", + "away", + "home", + "asleep" + ], "select_schedule": "off", "select_zone_profile": "passive", "sensors": { @@ -714,11 +838,17 @@ "upper_bound": 99.9 }, "thermostats": { - "primary": ["7fda9f84f01342f8afe9ebbbbff30c0f"], + "primary": [ + "7fda9f84f01342f8afe9ebbbbff30c0f" + ], "secondary": [] }, "vendor": "Plugwise", - "zone_profiles": ["active", "off", "passive"] + "zone_profiles": [ + "active", + "off", + "passive" + ] }, "ea8372c0e3ad4622ad45a041d02425f5": { "available": true, @@ -731,6 +861,7 @@ "location": "a562019b0b1f47a4bde8ebe3dbe3e8a9", "model": "Lisa", "model_id": "158-01", + "module_id": "0f19738aed2e4bc09e0ca832f2e0c5a4", "name": "Thermostaat KK", "sensors": { "battery": 53, @@ -754,6 +885,7 @@ "location": "8cf650a4c10c44819e426bed406aec34", "model": "Lisa", "model_id": "158-01", + "module_id": "efe84c28928a4ce08603024b5edc2fc7", "name": "Thermostaat BK1", "sensors": { "setpoint": 20.5, @@ -776,6 +908,7 @@ "location": "5cc21042f87f4b4c94ccb5537c47a53f", "model": "Lisa", "model_id": "158-01", + "module_id": "867bdfa029f042e2a50ab9974cff6fac", "name": "Thermostaat BK2", "sensors": { "setpoint": 20.5, @@ -803,7 +936,13 @@ "dev_class": "climate", "model": "ThermoZone", "name": "Woonkamer", - "preset_modes": ["no_frost", "vacation", "away", "home", "asleep"], + "preset_modes": [ + "no_frost", + "vacation", + "away", + "home", + "asleep" + ], "select_schedule": "Werkdag schema", "select_zone_profile": "active", "sensors": { @@ -818,10 +957,16 @@ "upper_bound": 35.0 }, "thermostats": { - "primary": ["ca79d23ae0094120b877558734cff85c"], + "primary": [ + "ca79d23ae0094120b877558734cff85c" + ], "secondary": [] }, "vendor": "Plugwise", - "zone_profiles": ["active", "off", "passive"] + "zone_profiles": [ + "active", + "off", + "passive" + ] } } diff --git a/fixtures/adam_jip/data.json b/fixtures/adam_jip/data.json index a1136e3c9..c13bd34c3 100644 --- a/fixtures/adam_jip/data.json +++ b/fixtures/adam_jip/data.json @@ -7,7 +7,13 @@ "dev_class": "climate", "model": "ThermoZone", "name": "Slaapkamer", - "preset_modes": ["home", "asleep", "away", "vacation", "no_frost"], + "preset_modes": [ + "home", + "asleep", + "away", + "vacation", + "no_frost" + ], "select_schedule": null, "select_zone_profile": "active", "sensors": { @@ -20,11 +26,19 @@ "upper_bound": 99.9 }, "thermostats": { - "primary": ["1346fbd8498d4dbcab7e18d51b771f3d"], - "secondary": ["356b65335e274d769c338223e7af9c33"] + "primary": [ + "1346fbd8498d4dbcab7e18d51b771f3d" + ], + "secondary": [ + "356b65335e274d769c338223e7af9c33" + ] }, "vendor": "Plugwise", - "zone_profiles": ["active", "off", "passive"] + "zone_profiles": [ + "active", + "off", + "passive" + ] }, "13228dab8ce04617af318a2888b3c548": { "active_preset": "home", @@ -34,7 +48,13 @@ "dev_class": "climate", "model": "ThermoZone", "name": "Woonkamer", - "preset_modes": ["home", "asleep", "away", "vacation", "no_frost"], + "preset_modes": [ + "home", + "asleep", + "away", + "vacation", + "no_frost" + ], "select_schedule": null, "select_zone_profile": "active", "sensors": { @@ -47,11 +67,19 @@ "upper_bound": 30.0 }, "thermostats": { - "primary": ["f61f1a2535f54f52ad006a3d18e459ca"], - "secondary": ["833de10f269c4deab58fb9df69901b4e"] + "primary": [ + "f61f1a2535f54f52ad006a3d18e459ca" + ], + "secondary": [ + "833de10f269c4deab58fb9df69901b4e" + ] }, "vendor": "Plugwise", - "zone_profiles": ["active", "off", "passive"] + "zone_profiles": [ + "active", + "off", + "passive" + ] }, "1346fbd8498d4dbcab7e18d51b771f3d": { "available": true, @@ -64,6 +92,7 @@ "location": "06aecb3d00354375924f50c47af36bd2", "model": "Lisa", "model_id": "158-01", + "module_id": "9a08c0d05ffd4f02be9a9bdeb3d01175", "name": "Slaapkamer", "sensors": { "battery": 92, @@ -87,6 +116,7 @@ "location": "d58fec52899f4f1c92e4f8fad6d8c48c", "model": "Tom", "model_id": "106-03", + "module_id": "e71d43382a894c9e888d379368aafba9", "name": "Tom Logeerkamer", "sensors": { "setpoint": 13.0, @@ -111,6 +141,7 @@ "location": "06aecb3d00354375924f50c47af36bd2", "model": "Tom", "model_id": "106-03", + "module_id": "ccc140dafdc5416dab052bffc465a770", "name": "Tom Slaapkamer", "sensors": { "setpoint": 13.0, @@ -133,6 +164,7 @@ "location": "9e4433a9d69f40b3aefd15e74395eaec", "model": "Aqara Smart Plug", "model_id": "lumi.plug.maeu01", + "module_id": "2ddb4057a8fd46aba92e23c770f3297d", "name": "Plug", "sensors": { "electricity_consumed_interval": 0.0 @@ -155,6 +187,7 @@ "location": "d27aede973b54be484f6842d1b2802ad", "model": "Lisa", "model_id": "158-01", + "module_id": "3f91eab3749349799b17f04873bde07e", "name": "Kinderkamer", "sensors": { "battery": 79, @@ -178,6 +211,7 @@ "location": "13228dab8ce04617af318a2888b3c548", "model": "Tom", "model_id": "106-03", + "module_id": "fc657e19ee7442ab8bfe66df62cb40b3", "name": "Tom Woonkamer", "sensors": { "setpoint": 9.0, @@ -205,6 +239,7 @@ "location": "d58fec52899f4f1c92e4f8fad6d8c48c", "model": "Lisa", "model_id": "158-01", + "module_id": "1814d63fb9824aa8aae4d4329d84dfa3", "name": "Logeerkamer", "sensors": { "battery": 80, @@ -226,7 +261,11 @@ }, "dev_class": "gateway", "firmware": "3.2.8", - "gateway_modes": ["away", "full", "vacation"], + "gateway_modes": [ + "away", + "full", + "vacation" + ], "hardware": "AME Smile 2.0 board", "location": "9e4433a9d69f40b3aefd15e74395eaec", "mac_address": "012345670001", @@ -234,7 +273,12 @@ "model_id": "smile_open_therm", "name": "Adam", "notifications": {}, - "regulation_modes": ["heating", "off", "bleeding_cold", "bleeding_hot"], + "regulation_modes": [ + "heating", + "off", + "bleeding_cold", + "bleeding_hot" + ], "select_gateway_mode": "full", "select_regulation_mode": "heating", "sensors": { @@ -251,7 +295,13 @@ "dev_class": "climate", "model": "ThermoZone", "name": "Kinderkamer", - "preset_modes": ["home", "asleep", "away", "vacation", "no_frost"], + "preset_modes": [ + "home", + "asleep", + "away", + "vacation", + "no_frost" + ], "select_schedule": null, "select_zone_profile": "active", "sensors": { @@ -264,11 +314,19 @@ "upper_bound": 99.9 }, "thermostats": { - "primary": ["6f3e9d7084214c21b9dfa46f6eeb8700"], - "secondary": ["d4496250d0e942cfa7aea3476e9070d5"] + "primary": [ + "6f3e9d7084214c21b9dfa46f6eeb8700" + ], + "secondary": [ + "d4496250d0e942cfa7aea3476e9070d5" + ] }, "vendor": "Plugwise", - "zone_profiles": ["active", "off", "passive"] + "zone_profiles": [ + "active", + "off", + "passive" + ] }, "d4496250d0e942cfa7aea3476e9070d5": { "available": true, @@ -278,6 +336,7 @@ "location": "d27aede973b54be484f6842d1b2802ad", "model": "Tom", "model_id": "106-03", + "module_id": "5785d8678bed443ea72b52a1c8a7108d", "name": "Tom Kinderkamer", "sensors": { "setpoint": 13.0, @@ -302,7 +361,13 @@ "dev_class": "climate", "model": "ThermoZone", "name": "Logeerkamer", - "preset_modes": ["home", "asleep", "away", "vacation", "no_frost"], + "preset_modes": [ + "home", + "asleep", + "away", + "vacation", + "no_frost" + ], "select_schedule": null, "select_zone_profile": "active", "sensors": { @@ -315,11 +380,19 @@ "upper_bound": 99.9 }, "thermostats": { - "primary": ["a6abc6a129ee499c88a4d420cc413b47"], - "secondary": ["1da4d325838e4ad8aac12177214505c9"] + "primary": [ + "a6abc6a129ee499c88a4d420cc413b47" + ], + "secondary": [ + "1da4d325838e4ad8aac12177214505c9" + ] }, "vendor": "Plugwise", - "zone_profiles": ["active", "off", "passive"] + "zone_profiles": [ + "active", + "off", + "passive" + ] }, "e4684553153b44afbef2200885f379dc": { "available": true, @@ -344,6 +417,7 @@ }, "model": "Generic heater", "model_id": "10.20", + "module_id": "2bd6e83f0ae340058606c33503202c72", "name": "OpenTherm", "sensors": { "intended_boiler_temperature": 0.0, @@ -368,6 +442,7 @@ "location": "13228dab8ce04617af318a2888b3c548", "model": "Jip", "model_id": "168-01", + "module_id": "73a5e7c19d3744ad96dfad74142d2db4", "name": "Woonkamer", "sensors": { "battery": 100, diff --git a/fixtures/adam_multiple_devices_per_zone/data.json b/fixtures/adam_multiple_devices_per_zone/data.json index a64835649..23c37dc63 100644 --- a/fixtures/adam_multiple_devices_per_zone/data.json +++ b/fixtures/adam_multiple_devices_per_zone/data.json @@ -6,6 +6,7 @@ "location": "cd143c07248f491493cea0533bc3d669", "model": "Plug", "model_id": "160-01", + "module_id": "4e1da90f22384bc691fe0282e02d272f", "name": "NVR", "sensors": { "electricity_consumed": 34.0, @@ -35,7 +36,13 @@ "dev_class": "climate", "model": "ThermoZone", "name": "Badkamer", - "preset_modes": ["home", "asleep", "away", "vacation", "no_frost"], + "preset_modes": [ + "home", + "asleep", + "away", + "vacation", + "no_frost" + ], "select_schedule": "Badkamer Schema", "sensors": { "temperature": 18.9 @@ -70,7 +77,13 @@ "dev_class": "climate", "model": "ThermoZone", "name": "Bios", - "preset_modes": ["home", "asleep", "away", "vacation", "no_frost"], + "preset_modes": [ + "home", + "asleep", + "away", + "vacation", + "no_frost" + ], "select_schedule": "off", "sensors": { "electricity_consumed": 0.0, @@ -84,8 +97,12 @@ "upper_bound": 100.0 }, "thermostats": { - "primary": ["df4a4a8169904cdb9c03d61a21f42140"], - "secondary": ["a2c3583e0a6349358998b760cea82d2a"] + "primary": [ + "df4a4a8169904cdb9c03d61a21f42140" + ], + "secondary": [ + "a2c3583e0a6349358998b760cea82d2a" + ] }, "vendor": "Plugwise" }, @@ -96,6 +113,7 @@ "location": "cd143c07248f491493cea0533bc3d669", "model": "Plug", "model_id": "160-01", + "module_id": "a03128e5e9334b088c724fd96947c765", "name": "Playstation Smart Plug", "sensors": { "electricity_consumed": 84.1, @@ -125,7 +143,13 @@ "dev_class": "climate", "model": "ThermoZone", "name": "Garage", - "preset_modes": ["home", "asleep", "away", "vacation", "no_frost"], + "preset_modes": [ + "home", + "asleep", + "away", + "vacation", + "no_frost" + ], "select_schedule": "off", "sensors": { "temperature": 15.6 @@ -137,7 +161,9 @@ "upper_bound": 100.0 }, "thermostats": { - "primary": ["e7693eb9582644e5b865dba8d4447cf1"], + "primary": [ + "e7693eb9582644e5b865dba8d4447cf1" + ], "secondary": [] }, "vendor": "Plugwise" @@ -149,6 +175,7 @@ "location": "cd143c07248f491493cea0533bc3d669", "model": "Plug", "model_id": "160-01", + "module_id": "822e635587994817a76599ea1190f9ee", "name": "USG Smart Plug", "sensors": { "electricity_consumed": 8.5, @@ -170,6 +197,7 @@ "location": "cd143c07248f491493cea0533bc3d669", "model": "Plug", "model_id": "160-01", + "module_id": "a5a8713dd3f94f2a9d63db8a521af6b2", "name": "Ziggo Modem", "sensors": { "electricity_consumed": 12.2, @@ -195,6 +223,7 @@ "location": "08963fec7c53423ca5680aa4cb502c63", "model": "Tom", "model_id": "106-03", + "module_id": "b622e3c6a32544f8a4d83e3385592e36", "name": "Thermostatic Radiator Badkamer 1", "sensors": { "battery": 51, @@ -223,6 +252,7 @@ "location": "82fa13f017d240daa0d0ea1775420f24", "model": "Lisa", "model_id": "158-01", + "module_id": "f887b0af3d1e45c794057ee606b21db8", "name": "Zone Thermostat Jessie", "sensors": { "battery": 37, @@ -245,6 +275,7 @@ "location": "c50f167537524366a5af7aa3942feb1e", "model": "Plug", "model_id": "160-01", + "module_id": "800d5287643c4fd89dfcfbf336d4f7ec", "name": "CV Pomp", "sensors": { "electricity_consumed": 35.6, @@ -273,7 +304,13 @@ "dev_class": "climate", "model": "ThermoZone", "name": "Jessie", - "preset_modes": ["home", "asleep", "away", "vacation", "no_frost"], + "preset_modes": [ + "home", + "asleep", + "away", + "vacation", + "no_frost" + ], "select_schedule": "CV Jessie", "sensors": { "temperature": 17.2 @@ -285,8 +322,12 @@ "upper_bound": 100.0 }, "thermostats": { - "primary": ["6a3bf693d05e48e0b460c815a4fdd09d"], - "secondary": ["d3da73bde12a47d5a6b8f9dad971f2ec"] + "primary": [ + "6a3bf693d05e48e0b460c815a4fdd09d" + ], + "secondary": [ + "d3da73bde12a47d5a6b8f9dad971f2ec" + ] }, "vendor": "Plugwise" }, @@ -311,6 +352,7 @@ "location": "cd143c07248f491493cea0533bc3d669", "model": "Plug", "model_id": "160-01", + "module_id": "5ccda7375b0f467e88499a636450dc91", "name": "Fibaro HC2", "sensors": { "electricity_consumed": 12.5, @@ -336,6 +378,7 @@ "location": "12493538af164a409c6a1c79e38afe1c", "model": "Tom", "model_id": "106-03", + "module_id": "39e077a2eb224dcea3415471de00823c", "name": "Bios Cv Thermostatic Radiator ", "sensors": { "battery": 62, @@ -361,6 +404,7 @@ "location": "c50f167537524366a5af7aa3942feb1e", "model": "Tom", "model_id": "106-03", + "module_id": "02d1299fdbab4f7b93765e0af1c250d8", "name": "Floor kraan", "sensors": { "setpoint": 21.5, @@ -388,6 +432,7 @@ "location": "c50f167537524366a5af7aa3942feb1e", "model": "Lisa", "model_id": "158-01", + "module_id": "dd68d0641eb04571be62b9940aae363a", "name": "Zone Lisa WK", "sensors": { "battery": 34, @@ -418,7 +463,13 @@ "dev_class": "climate", "model": "ThermoZone", "name": "Woonkamer", - "preset_modes": ["home", "asleep", "away", "vacation", "no_frost"], + "preset_modes": [ + "home", + "asleep", + "away", + "vacation", + "no_frost" + ], "select_schedule": "GF7 Woonkamer", "sensors": { "electricity_consumed": 35.6, @@ -432,8 +483,12 @@ "upper_bound": 100.0 }, "thermostats": { - "primary": ["b59bcebaf94b499ea7d46e4a66fb62d8"], - "secondary": ["b310b72a0e354bfab43089919b9a88bf"] + "primary": [ + "b59bcebaf94b499ea7d46e4a66fb62d8" + ], + "secondary": [ + "b310b72a0e354bfab43089919b9a88bf" + ] }, "vendor": "Plugwise" }, @@ -444,6 +499,7 @@ "location": "cd143c07248f491493cea0533bc3d669", "model": "Plug", "model_id": "160-01", + "module_id": "3e4e2fa7fa2a4cf18b1be5ed32a978a1", "name": "NAS", "sensors": { "electricity_consumed": 16.5, @@ -469,6 +525,7 @@ "location": "82fa13f017d240daa0d0ea1775420f24", "model": "Tom", "model_id": "106-03", + "module_id": "468bbe14853f4fb18a8860333cecc42a", "name": "Thermostatic Radiator Jessie", "sensors": { "battery": 62, @@ -497,6 +554,7 @@ "location": "12493538af164a409c6a1c79e38afe1c", "model": "Lisa", "model_id": "158-01", + "module_id": "e5f81fd832d844e5bd46219831468a62", "name": "Zone Lisa Bios", "sensors": { "battery": 67, @@ -537,6 +595,7 @@ "location": "446ac08dd04d4eff8ac57489757b7314", "model": "Tom", "model_id": "106-03", + "module_id": "d00e1ba75ed14b2388971b32abc94cde", "name": "CV Kraan Garage", "sensors": { "battery": 68, @@ -582,6 +641,7 @@ "location": "08963fec7c53423ca5680aa4cb502c63", "model": "Lisa", "model_id": "158-01", + "module_id": "ebd9f53ab3894bee91e36350c1fbb6c7", "name": "Thermostatic Radiator Badkamer 2", "sensors": { "battery": 92, diff --git a/fixtures/adam_onoff_cooling_fake_firmware/data.json b/fixtures/adam_onoff_cooling_fake_firmware/data.json index f822e33d8..77a452707 100644 --- a/fixtures/adam_onoff_cooling_fake_firmware/data.json +++ b/fixtures/adam_onoff_cooling_fake_firmware/data.json @@ -42,7 +42,11 @@ }, "dev_class": "gateway", "firmware": "3.2.8", - "gateway_modes": ["away", "full", "vacation"], + "gateway_modes": [ + "away", + "full", + "vacation" + ], "hardware": "AME Smile 2.0 board", "location": "eedadcb297564f1483faa509179aebed", "mac_address": "012345670001", @@ -70,6 +74,7 @@ "location": "fa5fa6b34f6b40a0972988b20e888ed4", "model": "ThermoTouch", "model_id": "143.1", + "module_id": "e2d52aece0524fde9c346953e5e1acb2", "name": "Thermostaat WK", "sensors": { "setpoint": 21.5, @@ -90,7 +95,13 @@ "dev_class": "climate", "model": "ThermoZone", "name": "Woonkamer", - "preset_modes": ["no_frost", "vacation", "away", "home", "asleep"], + "preset_modes": [ + "no_frost", + "vacation", + "away", + "home", + "asleep" + ], "select_schedule": "Werkdag schema", "select_zone_profile": "active", "sensors": { @@ -105,10 +116,16 @@ "upper_bound": 35.0 }, "thermostats": { - "primary": ["ca79d23ae0094120b877558734cff85c"], + "primary": [ + "ca79d23ae0094120b877558734cff85c" + ], "secondary": [] }, "vendor": "Plugwise", - "zone_profiles": ["active", "off", "passive"] + "zone_profiles": [ + "active", + "off", + "passive" + ] } } diff --git a/fixtures/adam_plus_anna/data.json b/fixtures/adam_plus_anna/data.json index 8533e7468..00d4014dd 100644 --- a/fixtures/adam_plus_anna/data.json +++ b/fixtures/adam_plus_anna/data.json @@ -1,13 +1,22 @@ { "009490cc2f674ce6b576863fbb64f867": { "active_preset": "home", - "available_schedules": ["Weekschema", "off"], + "available_schedules": [ + "Weekschema", + "off" + ], "climate_mode": "auto", "control_state": "idle", "dev_class": "climate", "model": "ThermoZone", "name": "Living room", - "preset_modes": ["home", "asleep", "away", "vacation", "no_frost"], + "preset_modes": [ + "home", + "asleep", + "away", + "vacation", + "no_frost" + ], "select_schedule": "Weekschema", "sensors": { "electricity_consumed": 74.2, @@ -21,7 +30,9 @@ "upper_bound": 35.0 }, "thermostats": { - "primary": ["ee62cad889f94e8ca3d09021f03a660b"], + "primary": [ + "ee62cad889f94e8ca3d09021f03a660b" + ], "secondary": [] }, "vendor": "Plugwise" @@ -42,6 +53,7 @@ "upper_bound": 100.0 }, "model": "Generic heater", + "module_id": "94c63e8b46284f6ab2f40d19619afcba", "name": "OpenTherm", "sensors": { "intended_boiler_temperature": 0.0, @@ -58,6 +70,7 @@ "location": "45d410adf8fd461e85cebf16d5ead542", "model": "Plug", "model_id": "160-01", + "module_id": "0fd8411d0bc446a08c336a7bba029e22", "name": "MediaCenter", "sensors": { "electricity_consumed": 10.3, @@ -100,6 +113,7 @@ "location": "009490cc2f674ce6b576863fbb64f867", "model": "ThermoTouch", "model_id": "143.1", + "module_id": "bb2fc3da88144d018ee51861e13f505d", "name": "Anna", "sensors": { "setpoint": 20.5, @@ -112,6 +126,7 @@ "dev_class": "computer_desktop_plug", "firmware": "2019-06-21T02:00:00+02:00", "location": "5ccb6c41a7d9403988d261ceee04239f", + "module_id": "72b2aa43d2ea4a33b23ade5e6629de8d", "name": "Work-PC", "sensors": { "electricity_consumed": 80.5, diff --git a/fixtures/adam_plus_anna_new/data.json b/fixtures/adam_plus_anna_new/data.json index cf8e4ab56..37d51b261 100644 --- a/fixtures/adam_plus_anna_new/data.json +++ b/fixtures/adam_plus_anna_new/data.json @@ -15,6 +15,7 @@ "upper_bound": 95.0 }, "model": "Generic heater", + "module_id": "c043b48fa65b4292b5579d5550f19dd2", "name": "OpenTherm", "sensors": { "intended_boiler_temperature": 22.5, @@ -29,6 +30,7 @@ "dev_class": "valve_actuator_plug", "location": "d9786723dbcf4f19b5c629a54629f9c7", "model_id": "TS0011", + "module_id": "c1f98356f09346b28e26a6ebc0f69275", "name": "Aanvoer water afsluiter (nous lz3)", "switches": { "relay": false @@ -46,6 +48,7 @@ "location": "f2bf9048bef64cc5b6d5110154e33c81", "model": "Emma Pro", "model_id": "170-01", + "module_id": "85e363f2d0234f13885d41acd77ce6b8", "name": "Emma", "sensors": { "battery": 100, @@ -73,6 +76,7 @@ "location": "f871b8c4d63549319221e294e4f88074", "model": "Tom", "model_id": "106-03", + "module_id": "86937b43514d44e090903d72e53d01b3", "name": "Tom Badkamer", "sensors": { "battery": 60, @@ -97,6 +101,7 @@ "location": "f2bf9048bef64cc5b6d5110154e33c81", "model": "Plug", "model_id": "160-01", + "module_id": "fe0bb67baa774960a41ca3148137d646", "name": "Plug MediaTV", "sensors": { "electricity_consumed": 15.8, @@ -118,6 +123,7 @@ "location": "8201a2ac4d1b4303bf994e18d67311eb", "model": "Plug", "model_id": "160-01", + "module_id": "118ccd70e8fa4b1fa746c504a47d95e0", "name": "Plug Thermex Boiler", "sensors": { "electricity_consumed": 0.69, @@ -138,6 +144,7 @@ "location": "b4f211175e124df59603412bafa77a34", "model": "Aqara Smart Plug", "model_id": "lumi.plug.maeu01", + "module_id": "6fe74ec044bd44d88ac0412df67f188f", "name": "SmartPlug Floor 0", "sensors": { "electricity_consumed_interval": 0.0 @@ -156,6 +163,7 @@ "location": "f2bf9048bef64cc5b6d5110154e33c81", "model": "Plug", "model_id": "160-01", + "module_id": "0251fb339b564a378009fcc3049f023c", "name": "Plug Vloerverwarming", "sensors": { "electricity_consumed": 45.0, @@ -174,6 +182,7 @@ "location": "f2bf9048bef64cc5b6d5110154e33c81", "model": "ThermoTouch", "model_id": "143.1", + "module_id": "f7727a516f974a7e8bf8ae95b4531a7a", "name": "Anna", "sensors": { "setpoint": 20.5, @@ -202,7 +211,11 @@ }, "dev_class": "gateway", "firmware": "3.9.0", - "gateway_modes": ["away", "full", "vacation"], + "gateway_modes": [ + "away", + "full", + "vacation" + ], "hardware": "AME Smile 2.0 board", "location": "bc93488efab249e5bc54fd7e175a6f91", "mac_address": "D40FB201CBA0", @@ -210,7 +223,12 @@ "model_id": "smile_open_therm", "name": "Adam", "notifications": {}, - "regulation_modes": ["bleeding_cold", "heating", "off", "bleeding_hot"], + "regulation_modes": [ + "bleeding_cold", + "heating", + "off", + "bleeding_hot" + ], "select_gateway_mode": "full", "select_regulation_mode": "heating", "sensors": { @@ -230,6 +248,7 @@ "location": "f2bf9048bef64cc5b6d5110154e33c81", "model": "Jip", "model_id": "168-01", + "module_id": "702e95f0db7246bf831bad9fec7a68ff", "name": "Jip", "sensors": { "battery": 100, @@ -251,6 +270,7 @@ "location": "f871b8c4d63549319221e294e4f88074", "model": "Lisa", "model_id": "158-01", + "module_id": "a9df3f54db5d4c0c84b6bf6804d41632", "name": "Lisa Badkamer", "sensors": { "battery": 71, @@ -297,7 +317,13 @@ "dev_class": "climate", "model": "ThermoZone", "name": "Living room", - "preset_modes": ["vacation", "no_frost", "asleep", "home", "away"], + "preset_modes": [ + "vacation", + "no_frost", + "asleep", + "home", + "away" + ], "select_schedule": "Weekschema", "select_zone_profile": "active", "sensors": { @@ -320,7 +346,11 @@ "secondary": [] }, "vendor": "Plugwise", - "zone_profiles": ["active", "off", "passive"] + "zone_profiles": [ + "active", + "off", + "passive" + ] }, "f871b8c4d63549319221e294e4f88074": { "active_preset": "vacation", @@ -336,7 +366,13 @@ "dev_class": "climate", "model": "ThermoZone", "name": "Bathroom", - "preset_modes": ["vacation", "no_frost", "asleep", "home", "away"], + "preset_modes": [ + "vacation", + "no_frost", + "asleep", + "home", + "away" + ], "select_schedule": "off", "select_zone_profile": "passive", "sensors": { @@ -351,10 +387,18 @@ "upper_bound": 99.9 }, "thermostats": { - "primary": ["e2f4322d57924fa090fbbc48b3a140dc"], - "secondary": ["1772a4ea304041adb83f357b751341ff"] + "primary": [ + "e2f4322d57924fa090fbbc48b3a140dc" + ], + "secondary": [ + "1772a4ea304041adb83f357b751341ff" + ] }, "vendor": "Plugwise", - "zone_profiles": ["active", "off", "passive"] + "zone_profiles": [ + "active", + "off", + "passive" + ] } } diff --git a/fixtures/adam_plus_anna_new_regulation_off/data.json b/fixtures/adam_plus_anna_new_regulation_off/data.json index 888e0c21b..04b591d1e 100644 --- a/fixtures/adam_plus_anna_new_regulation_off/data.json +++ b/fixtures/adam_plus_anna_new_regulation_off/data.json @@ -15,6 +15,7 @@ "upper_bound": 95.0 }, "model": "Generic heater", + "module_id": "c043b48fa65b4292b5579d5550f19dd2", "name": "OpenTherm", "sensors": { "intended_boiler_temperature": 0.0, @@ -29,6 +30,7 @@ "dev_class": "valve_actuator_plug", "location": "d9786723dbcf4f19b5c629a54629f9c7", "model_id": "TS0011", + "module_id": "c1f98356f09346b28e26a6ebc0f69275", "name": "Aanvoer water afsluiter (nous lz3)", "switches": { "relay": false @@ -47,6 +49,7 @@ "location": "f871b8c4d63549319221e294e4f88074", "model": "Tom", "model_id": "106-03", + "module_id": "86937b43514d44e090903d72e53d01b3", "name": "Tom Badkamer", "sensors": { "battery": 99, @@ -71,6 +74,7 @@ "location": "f2bf9048bef64cc5b6d5110154e33c81", "model": "Plug", "model_id": "160-01", + "module_id": "fe0bb67baa774960a41ca3148137d646", "name": "Plug MediaTV", "sensors": { "electricity_consumed": 14.8, @@ -92,6 +96,7 @@ "location": "f2bf9048bef64cc5b6d5110154e33c81", "model": "Plug", "model_id": "160-01", + "module_id": "118ccd70e8fa4b1fa746c504a47d95e0", "name": "Plug Werkplek", "sensors": { "electricity_consumed": 91.3, @@ -112,6 +117,7 @@ "location": "b4f211175e124df59603412bafa77a34", "model": "Aqara Smart Plug", "model_id": "lumi.plug.maeu01", + "module_id": "6fe74ec044bd44d88ac0412df67f188f", "name": "SmartPlug Floor 0", "sensors": { "electricity_consumed_interval": 0.0 @@ -130,6 +136,7 @@ "location": "f2bf9048bef64cc5b6d5110154e33c81", "model": "Plug", "model_id": "160-01", + "module_id": "0251fb339b564a378009fcc3049f023c", "name": "Plug Vloerverwarming", "sensors": { "electricity_consumed": 43.8, @@ -148,6 +155,7 @@ "location": "f2bf9048bef64cc5b6d5110154e33c81", "model": "ThermoTouch", "model_id": "143.1", + "module_id": "f7727a516f974a7e8bf8ae95b4531a7a", "name": "Anna", "sensors": { "setpoint": 18.5, @@ -176,7 +184,11 @@ }, "dev_class": "gateway", "firmware": "3.7.8", - "gateway_modes": ["away", "full", "vacation"], + "gateway_modes": [ + "away", + "full", + "vacation" + ], "hardware": "AME Smile 2.0 board", "location": "bc93488efab249e5bc54fd7e175a6f91", "mac_address": "012345679891", @@ -184,7 +196,12 @@ "model_id": "smile_open_therm", "name": "Adam", "notifications": {}, - "regulation_modes": ["bleeding_hot", "bleeding_cold", "off", "heating"], + "regulation_modes": [ + "bleeding_hot", + "bleeding_cold", + "off", + "heating" + ], "select_gateway_mode": "full", "select_regulation_mode": "off", "sensors": { @@ -204,6 +221,7 @@ "location": "f871b8c4d63549319221e294e4f88074", "model": "Lisa", "model_id": "158-01", + "module_id": "a9df3f54db5d4c0c84b6bf6804d41632", "name": "Lisa Badkamer", "sensors": { "battery": 14, @@ -250,7 +268,13 @@ "dev_class": "climate", "model": "ThermoZone", "name": "Living room", - "preset_modes": ["no_frost", "asleep", "vacation", "home", "away"], + "preset_modes": [ + "no_frost", + "asleep", + "vacation", + "home", + "away" + ], "select_schedule": "off", "select_zone_profile": "active", "sensors": { @@ -265,11 +289,17 @@ "upper_bound": 35.0 }, "thermostats": { - "primary": ["ad4838d7d35c4d6ea796ee12ae5aedf8"], + "primary": [ + "ad4838d7d35c4d6ea796ee12ae5aedf8" + ], "secondary": [] }, "vendor": "Plugwise", - "zone_profiles": ["active", "off", "passive"] + "zone_profiles": [ + "active", + "off", + "passive" + ] }, "f871b8c4d63549319221e294e4f88074": { "active_preset": "home", @@ -285,7 +315,13 @@ "dev_class": "climate", "model": "ThermoZone", "name": "Bathroom", - "preset_modes": ["no_frost", "asleep", "vacation", "home", "away"], + "preset_modes": [ + "no_frost", + "asleep", + "vacation", + "home", + "away" + ], "select_schedule": "off", "select_zone_profile": "passive", "sensors": { @@ -300,10 +336,18 @@ "upper_bound": 99.9 }, "thermostats": { - "primary": ["e2f4322d57924fa090fbbc48b3a140dc"], - "secondary": ["1772a4ea304041adb83f357b751341ff"] + "primary": [ + "e2f4322d57924fa090fbbc48b3a140dc" + ], + "secondary": [ + "1772a4ea304041adb83f357b751341ff" + ] }, "vendor": "Plugwise", - "zone_profiles": ["active", "off", "passive"] + "zone_profiles": [ + "active", + "off", + "passive" + ] } } diff --git a/fixtures/adam_zone_per_device/data.json b/fixtures/adam_zone_per_device/data.json index ce3d258b4..d6bdc441e 100644 --- a/fixtures/adam_zone_per_device/data.json +++ b/fixtures/adam_zone_per_device/data.json @@ -6,6 +6,7 @@ "location": "c4d2bda6df8146caa2e5c2b5dc65660e", "model": "Plug", "model_id": "160-01", + "module_id": "4e1da90f22384bc691fe0282e02d272f", "name": "NVR", "sensors": { "electricity_consumed": 34.0, @@ -35,7 +36,13 @@ "dev_class": "climate", "model": "ThermoZone", "name": "Badkamer", - "preset_modes": ["home", "asleep", "away", "vacation", "no_frost"], + "preset_modes": [ + "home", + "asleep", + "away", + "vacation", + "no_frost" + ], "select_schedule": "Badkamer Schema", "sensors": { "temperature": 18.8 @@ -47,8 +54,12 @@ "upper_bound": 100.0 }, "thermostats": { - "primary": ["f1fee6043d3642a9b0a65297455f008e"], - "secondary": ["680423ff840043738f42cc7f1ff97a36"] + "primary": [ + "f1fee6043d3642a9b0a65297455f008e" + ], + "secondary": [ + "680423ff840043738f42cc7f1ff97a36" + ] }, "vendor": "Plugwise" }, @@ -67,7 +78,13 @@ "dev_class": "climate", "model": "ThermoZone", "name": "Bios", - "preset_modes": ["home", "asleep", "away", "vacation", "no_frost"], + "preset_modes": [ + "home", + "asleep", + "away", + "vacation", + "no_frost" + ], "select_schedule": "off", "sensors": { "electricity_consumed": 0.0, @@ -81,8 +98,12 @@ "upper_bound": 100.0 }, "thermostats": { - "primary": ["df4a4a8169904cdb9c03d61a21f42140"], - "secondary": ["a2c3583e0a6349358998b760cea82d2a"] + "primary": [ + "df4a4a8169904cdb9c03d61a21f42140" + ], + "secondary": [ + "a2c3583e0a6349358998b760cea82d2a" + ] }, "vendor": "Plugwise" }, @@ -93,6 +114,7 @@ "location": "4efbab4c8bb84fbab26c8decf670eb96", "model": "Plug", "model_id": "160-01", + "module_id": "a03128e5e9334b088c724fd96947c765", "name": "Playstation Smart Plug", "sensors": { "electricity_consumed": 80.1, @@ -122,7 +144,13 @@ "dev_class": "climate", "model": "ThermoZone", "name": "Garage", - "preset_modes": ["home", "asleep", "away", "vacation", "no_frost"], + "preset_modes": [ + "home", + "asleep", + "away", + "vacation", + "no_frost" + ], "select_schedule": "off", "sensors": { "temperature": 15.6 @@ -134,7 +162,9 @@ "upper_bound": 100.0 }, "thermostats": { - "primary": ["e7693eb9582644e5b865dba8d4447cf1"], + "primary": [ + "e7693eb9582644e5b865dba8d4447cf1" + ], "secondary": [] }, "vendor": "Plugwise" @@ -146,6 +176,7 @@ "location": "0217e9743c174eef9d6e9f680d403ce2", "model": "Plug", "model_id": "160-01", + "module_id": "822e635587994817a76599ea1190f9ee", "name": "USG Smart Plug", "sensors": { "electricity_consumed": 8.5, @@ -167,6 +198,7 @@ "location": "2b1591ecf6344d4d93b03dece9747648", "model": "Plug", "model_id": "160-01", + "module_id": "a5a8713dd3f94f2a9d63db8a521af6b2", "name": "Ziggo Modem", "sensors": { "electricity_consumed": 12.2, @@ -192,6 +224,7 @@ "location": "08963fec7c53423ca5680aa4cb502c63", "model": "Tom", "model_id": "106-03", + "module_id": "b622e3c6a32544f8a4d83e3385592e36", "name": "Thermostatic Radiator Badkamer", "sensors": { "battery": 51, @@ -220,6 +253,7 @@ "location": "82fa13f017d240daa0d0ea1775420f24", "model": "Lisa", "model_id": "158-01", + "module_id": "f887b0af3d1e45c794057ee606b21db8", "name": "Zone Thermostat Jessie", "sensors": { "battery": 37, @@ -242,6 +276,7 @@ "location": "c50f167537524366a5af7aa3942feb1e", "model": "Plug", "model_id": "160-01", + "module_id": "800d5287643c4fd89dfcfbf336d4f7ec", "name": "CV Pomp", "sensors": { "electricity_consumed": 35.8, @@ -270,7 +305,13 @@ "dev_class": "climate", "model": "ThermoZone", "name": "Jessie", - "preset_modes": ["home", "asleep", "away", "vacation", "no_frost"], + "preset_modes": [ + "home", + "asleep", + "away", + "vacation", + "no_frost" + ], "select_schedule": "CV Jessie", "sensors": { "temperature": 17.1 @@ -282,8 +323,12 @@ "upper_bound": 100.0 }, "thermostats": { - "primary": ["6a3bf693d05e48e0b460c815a4fdd09d"], - "secondary": ["d3da73bde12a47d5a6b8f9dad971f2ec"] + "primary": [ + "6a3bf693d05e48e0b460c815a4fdd09d" + ], + "secondary": [ + "d3da73bde12a47d5a6b8f9dad971f2ec" + ] }, "vendor": "Plugwise" }, @@ -308,6 +353,7 @@ "location": "cd143c07248f491493cea0533bc3d669", "model": "Plug", "model_id": "160-01", + "module_id": "5ccda7375b0f467e88499a636450dc91", "name": "Fibaro HC2", "sensors": { "electricity_consumed": 12.5, @@ -333,6 +379,7 @@ "location": "12493538af164a409c6a1c79e38afe1c", "model": "Tom", "model_id": "106-03", + "module_id": "39e077a2eb224dcea3415471de00823c", "name": "Bios Cv Thermostatic Radiator ", "sensors": { "battery": 62, @@ -358,6 +405,7 @@ "location": "c50f167537524366a5af7aa3942feb1e", "model": "Tom", "model_id": "106-03", + "module_id": "02d1299fdbab4f7b93765e0af1c250d8", "name": "Floor kraan", "sensors": { "setpoint": 21.5, @@ -385,6 +433,7 @@ "location": "c50f167537524366a5af7aa3942feb1e", "model": "Lisa", "model_id": "158-01", + "module_id": "dd68d0641eb04571be62b9940aae363a", "name": "Zone Lisa WK", "sensors": { "battery": 34, @@ -415,7 +464,13 @@ "dev_class": "climate", "model": "ThermoZone", "name": "Woonkamer", - "preset_modes": ["home", "asleep", "away", "vacation", "no_frost"], + "preset_modes": [ + "home", + "asleep", + "away", + "vacation", + "no_frost" + ], "select_schedule": "GF7 Woonkamer", "sensors": { "electricity_consumed": 35.8, @@ -429,8 +484,12 @@ "upper_bound": 100.0 }, "thermostats": { - "primary": ["b59bcebaf94b499ea7d46e4a66fb62d8"], - "secondary": ["b310b72a0e354bfab43089919b9a88bf"] + "primary": [ + "b59bcebaf94b499ea7d46e4a66fb62d8" + ], + "secondary": [ + "b310b72a0e354bfab43089919b9a88bf" + ] }, "vendor": "Plugwise" }, @@ -441,6 +500,7 @@ "location": "e704bae65654496f9cade9c855decdfe", "model": "Plug", "model_id": "160-01", + "module_id": "3e4e2fa7fa2a4cf18b1be5ed32a978a1", "name": "NAS", "sensors": { "electricity_consumed": 16.5, @@ -466,6 +526,7 @@ "location": "82fa13f017d240daa0d0ea1775420f24", "model": "Tom", "model_id": "106-03", + "module_id": "468bbe14853f4fb18a8860333cecc42a", "name": "Thermostatic Radiator Jessie", "sensors": { "battery": 62, @@ -494,6 +555,7 @@ "location": "12493538af164a409c6a1c79e38afe1c", "model": "Lisa", "model_id": "158-01", + "module_id": "e5f81fd832d844e5bd46219831468a62", "name": "Zone Lisa Bios", "sensors": { "battery": 67, @@ -534,6 +596,7 @@ "location": "446ac08dd04d4eff8ac57489757b7314", "model": "Tom", "model_id": "106-03", + "module_id": "d00e1ba75ed14b2388971b32abc94cde", "name": "CV Kraan Garage", "sensors": { "battery": 68, @@ -562,6 +625,7 @@ "location": "08963fec7c53423ca5680aa4cb502c63", "model": "Lisa", "model_id": "158-01", + "module_id": "ebd9f53ab3894bee91e36350c1fbb6c7", "name": "Zone Thermostat Badkamer", "sensors": { "battery": 92, diff --git a/fixtures/anna_elga_2/data.json b/fixtures/anna_elga_2/data.json index e417927a2..86532596d 100644 --- a/fixtures/anna_elga_2/data.json +++ b/fixtures/anna_elga_2/data.json @@ -13,6 +13,7 @@ "dev_class": "heater_central", "location": "d34dfe6ab90b410c98068e75de3eb631", "model": "Generic heater/cooler", + "module_id": "c53888603af34264bbed2a05998ee572", "name": "OpenTherm", "sensors": { "domestic_hot_water_setpoint": 60.0, @@ -30,7 +31,10 @@ }, "ebd90df1ab334565b5895f37590ccff4": { "active_preset": "home", - "available_schedules": ["Thermostat schedule", "off"], + "available_schedules": [ + "Thermostat schedule", + "off" + ], "climate_mode": "auto", "control_state": "heating", "dev_class": "thermostat", @@ -38,8 +42,15 @@ "hardware": "6539-1301-5002", "location": "d3ce834534114348be628b61b26d9220", "model": "ThermoTouch", + "module_id": "3b36454dda794c6faaed4053a89e80ce", "name": "Anna", - "preset_modes": ["away", "no_frost", "vacation", "home", "asleep"], + "preset_modes": [ + "away", + "no_frost", + "vacation", + "home", + "asleep" + ], "select_schedule": "Thermostat schedule", "sensors": { "cooling_activation_outdoor_temperature": 24.0, diff --git a/fixtures/anna_elga_2_cooling/data.json b/fixtures/anna_elga_2_cooling/data.json index 0c417702b..e29afa85b 100644 --- a/fixtures/anna_elga_2_cooling/data.json +++ b/fixtures/anna_elga_2_cooling/data.json @@ -19,6 +19,7 @@ "upper_bound": 100.0 }, "model": "Generic heater/cooler", + "module_id": "c53888603af34264bbed2a05998ee572", "name": "OpenTherm", "sensors": { "domestic_hot_water_setpoint": 60.0, @@ -36,7 +37,10 @@ }, "ebd90df1ab334565b5895f37590ccff4": { "active_preset": "home", - "available_schedules": ["Thermostat schedule", "off"], + "available_schedules": [ + "Thermostat schedule", + "off" + ], "climate_mode": "auto", "control_state": "cooling", "dev_class": "thermostat", @@ -44,8 +48,15 @@ "hardware": "6539-1301-5002", "location": "d3ce834534114348be628b61b26d9220", "model": "ThermoTouch", + "module_id": "3b36454dda794c6faaed4053a89e80ce", "name": "Anna", - "preset_modes": ["away", "no_frost", "vacation", "home", "asleep"], + "preset_modes": [ + "away", + "no_frost", + "vacation", + "home", + "asleep" + ], "select_schedule": "Thermostat schedule", "sensors": { "cooling_activation_outdoor_temperature": 26.0, diff --git a/fixtures/anna_elga_2_schedule_off/data.json b/fixtures/anna_elga_2_schedule_off/data.json index 064a483d8..548bd5286 100644 --- a/fixtures/anna_elga_2_schedule_off/data.json +++ b/fixtures/anna_elga_2_schedule_off/data.json @@ -19,6 +19,7 @@ "upper_bound": 100.0 }, "model": "Generic heater/cooler", + "module_id": "c53888603af34264bbed2a05998ee572", "name": "OpenTherm", "sensors": { "domestic_hot_water_setpoint": 60.0, @@ -36,7 +37,10 @@ }, "ebd90df1ab334565b5895f37590ccff4": { "active_preset": "home", - "available_schedules": ["Thermostat schedule", "off"], + "available_schedules": [ + "Thermostat schedule", + "off" + ], "climate_mode": "heat_cool", "control_state": "idle", "dev_class": "thermostat", @@ -44,8 +48,15 @@ "hardware": "6539-1301-5002", "location": "d3ce834534114348be628b61b26d9220", "model": "ThermoTouch", + "module_id": "3b36454dda794c6faaed4053a89e80ce", "name": "Anna", - "preset_modes": ["away", "no_frost", "vacation", "home", "asleep"], + "preset_modes": [ + "away", + "no_frost", + "vacation", + "home", + "asleep" + ], "select_schedule": "off", "sensors": { "cooling_activation_outdoor_temperature": 26.0, diff --git a/fixtures/anna_elga_no_cooling/data.json b/fixtures/anna_elga_no_cooling/data.json index 23ec151d4..f81bda7b4 100644 --- a/fixtures/anna_elga_no_cooling/data.json +++ b/fixtures/anna_elga_no_cooling/data.json @@ -41,6 +41,7 @@ "upper_bound": 100.0 }, "model": "Generic heater", + "module_id": "1d1f157265a74d2886af70eeac1a2da2", "name": "OpenTherm", "sensors": { "dhw_temperature": 46.3, @@ -58,7 +59,10 @@ }, "3cb70739631c4d17a86b8b12e8a5161b": { "active_preset": "home", - "available_schedules": ["standaard", "off"], + "available_schedules": [ + "standaard", + "off" + ], "climate_mode": "auto", "control_state": "heating", "dev_class": "thermostat", @@ -66,8 +70,15 @@ "hardware": "6539-1301-5002", "location": "c784ee9fdab44e1395b8dee7d7a497d5", "model": "ThermoTouch", + "module_id": "e3204a14c278431a8890525dd83edf9d", "name": "Anna", - "preset_modes": ["no_frost", "home", "away", "asleep", "vacation"], + "preset_modes": [ + "no_frost", + "home", + "away", + "asleep", + "vacation" + ], "select_schedule": "standaard", "sensors": { "cooling_activation_outdoor_temperature": 21.0, diff --git a/fixtures/anna_heatpump_cooling/data.json b/fixtures/anna_heatpump_cooling/data.json index c722045a2..5243282bb 100644 --- a/fixtures/anna_heatpump_cooling/data.json +++ b/fixtures/anna_heatpump_cooling/data.json @@ -37,6 +37,7 @@ "upper_bound": 100.0 }, "model": "Generic heater/cooler", + "module_id": "1d1f157265a74d2886af70eeac1a2da2", "name": "OpenTherm", "sensors": { "dhw_temperature": 41.5, @@ -55,7 +56,10 @@ }, "3cb70739631c4d17a86b8b12e8a5161b": { "active_preset": "home", - "available_schedules": ["standaard", "off"], + "available_schedules": [ + "standaard", + "off" + ], "climate_mode": "heat_cool", "control_state": "cooling", "dev_class": "thermostat", @@ -63,8 +67,15 @@ "hardware": "6539-1301-5002", "location": "c784ee9fdab44e1395b8dee7d7a497d5", "model": "ThermoTouch", + "module_id": "e3204a14c278431a8890525dd83edf9d", "name": "Anna", - "preset_modes": ["no_frost", "home", "away", "asleep", "vacation"], + "preset_modes": [ + "no_frost", + "home", + "away", + "asleep", + "vacation" + ], "select_schedule": "off", "sensors": { "cooling_activation_outdoor_temperature": 21.0, diff --git a/fixtures/anna_heatpump_cooling_fake_firmware/data.json b/fixtures/anna_heatpump_cooling_fake_firmware/data.json index 4218240cb..bcca41647 100644 --- a/fixtures/anna_heatpump_cooling_fake_firmware/data.json +++ b/fixtures/anna_heatpump_cooling_fake_firmware/data.json @@ -37,6 +37,7 @@ "upper_bound": 100.0 }, "model": "Generic heater/cooler", + "module_id": "1d1f157265a74d2886af70eeac1a2da2", "name": "OpenTherm", "sensors": { "dhw_temperature": 41.5, @@ -55,7 +56,10 @@ }, "3cb70739631c4d17a86b8b12e8a5161b": { "active_preset": "home", - "available_schedules": ["standaard", "off"], + "available_schedules": [ + "standaard", + "off" + ], "climate_mode": "heat_cool", "control_state": "cooling", "dev_class": "thermostat", @@ -63,8 +67,15 @@ "hardware": "6539-1301-5002", "location": "c784ee9fdab44e1395b8dee7d7a497d5", "model": "ThermoTouch", + "module_id": "e3204a14c278431a8890525dd83edf9d", "name": "Anna", - "preset_modes": ["no_frost", "home", "away", "asleep", "vacation"], + "preset_modes": [ + "no_frost", + "home", + "away", + "asleep", + "vacation" + ], "select_schedule": "off", "sensors": { "cooling_activation_outdoor_temperature": 21.0, diff --git a/fixtures/anna_heatpump_heating/data.json b/fixtures/anna_heatpump_heating/data.json index ab6bdf08e..77a473317 100644 --- a/fixtures/anna_heatpump_heating/data.json +++ b/fixtures/anna_heatpump_heating/data.json @@ -43,6 +43,7 @@ "upper_bound": 100.0 }, "model": "Generic heater/cooler", + "module_id": "1d1f157265a74d2886af70eeac1a2da2", "name": "OpenTherm", "sensors": { "dhw_temperature": 46.3, @@ -60,7 +61,10 @@ }, "3cb70739631c4d17a86b8b12e8a5161b": { "active_preset": "home", - "available_schedules": ["standaard", "off"], + "available_schedules": [ + "standaard", + "off" + ], "climate_mode": "auto", "control_state": "heating", "dev_class": "thermostat", @@ -68,8 +72,15 @@ "hardware": "6539-1301-5002", "location": "c784ee9fdab44e1395b8dee7d7a497d5", "model": "ThermoTouch", + "module_id": "e3204a14c278431a8890525dd83edf9d", "name": "Anna", - "preset_modes": ["no_frost", "home", "away", "asleep", "vacation"], + "preset_modes": [ + "no_frost", + "home", + "away", + "asleep", + "vacation" + ], "select_schedule": "standaard", "sensors": { "cooling_activation_outdoor_temperature": 21.0, diff --git a/fixtures/anna_loria_cooling_active/data.json b/fixtures/anna_loria_cooling_active/data.json index 8b6c7341e..592d2b75a 100644 --- a/fixtures/anna_loria_cooling_active/data.json +++ b/fixtures/anna_loria_cooling_active/data.json @@ -1,7 +1,11 @@ { "582dfbdace4d4aeb832923ce7d1ddda0": { "active_preset": "home", - "available_schedules": ["Winter", "Test ", "off"], + "available_schedules": [ + "Winter", + "Test ", + "off" + ], "climate_mode": "auto", "control_state": "cooling", "dev_class": "thermostat", @@ -9,8 +13,15 @@ "hardware": "6539-1301-5002", "location": "15da035090b847e7a21f93e08c015ebc", "model": "ThermoTouch", + "module_id": "734af4309ab3417499e85d16e5750015", "name": "Anna", - "preset_modes": ["away", "vacation", "no_frost", "home", "asleep"], + "preset_modes": [ + "away", + "vacation", + "no_frost", + "home", + "asleep" + ], "select_schedule": "Winter", "sensors": { "illuminance": 45.0, @@ -61,7 +72,13 @@ "heating_state": false }, "dev_class": "heater_central", - "dhw_modes": ["off", "auto", "boost", "eco", "comfort"], + "dhw_modes": [ + "off", + "auto", + "boost", + "eco", + "comfort" + ], "location": "674b657c138a41a291d315d7471deb06", "max_dhw_temperature": { "lower_bound": 35.0, @@ -77,6 +94,7 @@ }, "model": "Generic heater/cooler", "model_id": "173", + "module_id": "f3b09d3f16964c18a55ee7614afc3437", "name": "OpenTherm", "select_dhw_mode": "auto", "sensors": { diff --git a/fixtures/anna_loria_driessens/data.json b/fixtures/anna_loria_driessens/data.json index 2519d1f45..3a8440db4 100644 --- a/fixtures/anna_loria_driessens/data.json +++ b/fixtures/anna_loria_driessens/data.json @@ -33,8 +33,15 @@ "hardware": "6539-1301-5002", "location": "fa70e08550c94de3a34feb27ecf31421", "model": "ThermoTouch", + "module_id": "ca2dedb4b4a14a89bfc6a42aa0053ddb", "name": "Anna", - "preset_modes": ["no_frost", "asleep", "vacation", "away", "home"], + "preset_modes": [ + "no_frost", + "asleep", + "vacation", + "away", + "home" + ], "select_schedule": "Verwarmen@9-23u", "sensors": { "illuminance": 5.5, @@ -67,7 +74,13 @@ "heating_state": false }, "dev_class": "heater_central", - "dhw_modes": ["comfort", "eco", "off", "boost", "auto"], + "dhw_modes": [ + "comfort", + "eco", + "off", + "boost", + "auto" + ], "location": "82c15f65c9bf44c592d69e16139355e3", "max_dhw_temperature": { "lower_bound": 35.0, @@ -83,6 +96,7 @@ }, "model": "Generic heater/cooler", "model_id": "173", + "module_id": "007bd043e2764ddc99d42ac1a46a8841", "name": "OpenTherm", "select_dhw_mode": "auto", "sensors": { diff --git a/fixtures/anna_loria_heating_idle/data.json b/fixtures/anna_loria_heating_idle/data.json index d1b640345..b04941dcb 100644 --- a/fixtures/anna_loria_heating_idle/data.json +++ b/fixtures/anna_loria_heating_idle/data.json @@ -1,7 +1,11 @@ { "582dfbdace4d4aeb832923ce7d1ddda0": { "active_preset": "home", - "available_schedules": ["Winter", "Test ", "off"], + "available_schedules": [ + "Winter", + "Test ", + "off" + ], "climate_mode": "auto", "control_state": "idle", "dev_class": "thermostat", @@ -9,8 +13,15 @@ "hardware": "6539-1301-5002", "location": "15da035090b847e7a21f93e08c015ebc", "model": "ThermoTouch", + "module_id": "734af4309ab3417499e85d16e5750015", "name": "Anna", - "preset_modes": ["away", "vacation", "no_frost", "home", "asleep"], + "preset_modes": [ + "away", + "vacation", + "no_frost", + "home", + "asleep" + ], "select_schedule": "Winter", "sensors": { "illuminance": 45.0, @@ -61,7 +72,13 @@ "heating_state": false }, "dev_class": "heater_central", - "dhw_modes": ["off", "auto", "boost", "eco", "comfort"], + "dhw_modes": [ + "off", + "auto", + "boost", + "eco", + "comfort" + ], "location": "674b657c138a41a291d315d7471deb06", "max_dhw_temperature": { "lower_bound": 35.0, @@ -77,6 +94,7 @@ }, "model": "Generic heater/cooler", "model_id": "173", + "module_id": "f3b09d3f16964c18a55ee7614afc3437", "name": "OpenTherm", "select_dhw_mode": "auto", "sensors": { diff --git a/fixtures/anna_p1/data.json b/fixtures/anna_p1/data.json index fd0bc91fb..ee4b57ea4 100644 --- a/fixtures/anna_p1/data.json +++ b/fixtures/anna_p1/data.json @@ -1,7 +1,10 @@ { "1e5e55b958ac445583602f767cb45942": { "active_preset": "home", - "available_schedules": ["Thermostat schedule", "off"], + "available_schedules": [ + "Thermostat schedule", + "off" + ], "climate_mode": "heat", "control_state": "idle", "dev_class": "thermostat", @@ -9,8 +12,15 @@ "hardware": "6539-1301-500", "location": "5b13651d79c4454684fd268850b1bff8", "model": "ThermoTouch", + "module_id": "4cac351dd8494d0fb4adbb75f4cdf89c", "name": "Anna", - "preset_modes": ["home", "asleep", "away", "vacation", "no_frost"], + "preset_modes": [ + "home", + "asleep", + "away", + "vacation", + "no_frost" + ], "select_schedule": "off", "sensors": { "illuminance": 2.0, @@ -42,6 +52,7 @@ "location": "da7be222ab3b420c927f3e49fade0304", "model": "Generic heater", "model_id": "HR24", + "module_id": "4641927b856f45638df120358f98da9a", "name": "OpenTherm", "sensors": { "intended_boiler_temperature": 0.0, @@ -77,6 +88,7 @@ "dev_class": "smartmeter", "location": "da7be222ab3b420c927f3e49fade0304", "model": "2MS212 SMR5.5", + "module_id": "0caec7b5fac2419bbb3aea7bc93170f1", "name": "P1", "sensors": { "electricity_consumed_off_peak_cumulative": 618.001, diff --git a/fixtures/anna_v4/data.json b/fixtures/anna_v4/data.json index 7e6f138be..563bd837e 100644 --- a/fixtures/anna_v4/data.json +++ b/fixtures/anna_v4/data.json @@ -1,7 +1,11 @@ { "01b85360fdd243d0aaad4d6ac2a5ba7e": { "active_preset": "home", - "available_schedules": ["Standaard", "Thuiswerken", "off"], + "available_schedules": [ + "Standaard", + "Thuiswerken", + "off" + ], "climate_mode": "heat", "control_state": "heating", "dev_class": "thermostat", @@ -9,8 +13,15 @@ "hardware": "6539-1301-5002", "location": "eb5309212bf5407bb143e5bfa3b18aee", "model": "ThermoTouch", + "module_id": "807a45cbc950419c98ce4624bc27ff09", "name": "Anna", - "preset_modes": ["vacation", "no_frost", "away", "asleep", "home"], + "preset_modes": [ + "vacation", + "no_frost", + "away", + "asleep", + "home" + ], "select_schedule": "off", "sensors": { "illuminance": 60.0, @@ -72,6 +83,7 @@ }, "model": "Generic heater", "model_id": "2.32", + "module_id": "88c1299c194f4b39b857e369803c2481", "name": "OpenTherm", "sensors": { "intended_boiler_temperature": 39.9, diff --git a/fixtures/anna_v4_dhw/data.json b/fixtures/anna_v4_dhw/data.json index a560de161..f7ab1fb4b 100644 --- a/fixtures/anna_v4_dhw/data.json +++ b/fixtures/anna_v4_dhw/data.json @@ -1,7 +1,11 @@ { "01b85360fdd243d0aaad4d6ac2a5ba7e": { "active_preset": "home", - "available_schedules": ["Standaard", "Thuiswerken", "off"], + "available_schedules": [ + "Standaard", + "Thuiswerken", + "off" + ], "climate_mode": "heat", "control_state": "idle", "dev_class": "thermostat", @@ -9,8 +13,15 @@ "hardware": "6539-1301-5002", "location": "eb5309212bf5407bb143e5bfa3b18aee", "model": "ThermoTouch", + "module_id": "807a45cbc950419c98ce4624bc27ff09", "name": "Anna", - "preset_modes": ["vacation", "no_frost", "away", "asleep", "home"], + "preset_modes": [ + "vacation", + "no_frost", + "away", + "asleep", + "home" + ], "select_schedule": "off", "sensors": { "illuminance": 60.0, @@ -72,6 +83,7 @@ }, "model": "Generic heater", "model_id": "2.32", + "module_id": "88c1299c194f4b39b857e369803c2481", "name": "OpenTherm", "sensors": { "intended_boiler_temperature": 39.9, diff --git a/fixtures/anna_v4_no_tag/data.json b/fixtures/anna_v4_no_tag/data.json index 513e7ce20..7a6c43567 100644 --- a/fixtures/anna_v4_no_tag/data.json +++ b/fixtures/anna_v4_no_tag/data.json @@ -1,7 +1,11 @@ { "01b85360fdd243d0aaad4d6ac2a5ba7e": { "active_preset": "home", - "available_schedules": ["Standaard", "Thuiswerken", "off"], + "available_schedules": [ + "Standaard", + "Thuiswerken", + "off" + ], "climate_mode": "auto", "control_state": "heating", "dev_class": "thermostat", @@ -9,8 +13,15 @@ "hardware": "6539-1301-5002", "location": "eb5309212bf5407bb143e5bfa3b18aee", "model": "ThermoTouch", + "module_id": "807a45cbc950419c98ce4624bc27ff09", "name": "Anna", - "preset_modes": ["vacation", "no_frost", "away", "asleep", "home"], + "preset_modes": [ + "vacation", + "no_frost", + "away", + "asleep", + "home" + ], "select_schedule": "Thuiswerken", "sensors": { "illuminance": 60.0, @@ -72,6 +83,7 @@ }, "model": "Generic heater", "model_id": "2.32", + "module_id": "88c1299c194f4b39b857e369803c2481", "name": "OpenTherm", "sensors": { "intended_boiler_temperature": 39.9, diff --git a/fixtures/anna_without_boiler_fw441/data.json b/fixtures/anna_without_boiler_fw441/data.json index 7e0b7cc4f..fc6a556b6 100644 --- a/fixtures/anna_without_boiler_fw441/data.json +++ b/fixtures/anna_without_boiler_fw441/data.json @@ -1,7 +1,11 @@ { "7ffbb3ab4b6c4ab2915d7510f7bf8fe9": { "active_preset": "home", - "available_schedules": ["Test", "Normaal", "off"], + "available_schedules": [ + "Test", + "Normaal", + "off" + ], "climate_mode": "auto", "control_state": "idle", "dev_class": "thermostat", @@ -9,8 +13,15 @@ "hardware": "6539-1301-5002", "location": "c34c6864216446528e95d88985e714cc", "model": "ThermoTouch", + "module_id": "2174b15978334867a3d634a16d14ada8", "name": "Anna", - "preset_modes": ["no_frost", "asleep", "away", "vacation", "home"], + "preset_modes": [ + "no_frost", + "asleep", + "away", + "vacation", + "home" + ], "select_schedule": "Normaal", "sensors": { "illuminance": 0.25, diff --git a/tests/test_anna.py b/tests/test_anna.py index 26f72bfcc..c67c3e66f 100644 --- a/tests/test_anna.py +++ b/tests/test_anna.py @@ -158,7 +158,7 @@ async def test_connect_anna_without_boiler_fw441(self): ) await self.device_test(api, "2022-05-16 00:00:01", testdata) - assert self.entity_items == 43 + assert self.entity_items == 42 assert not self.notifications result = await self.tinker_thermostat( @@ -216,7 +216,7 @@ async def test_connect_anna_heatpump_heating(self): await self.device_test( api, "2020-04-13 00:00:01", testdata_updated, initialize=False ) - assert self.entity_items == 68 + assert self.entity_items == 45 await api.close_connection() await self.disconnect(server, client) @@ -551,7 +551,7 @@ async def test_connect_anna_p1(self): ) await self.device_test(api, "2025-11-02 00:00:01", testdata) - assert self.entity_items == 78 + assert self.entity_items == 79 await api.close_connection() await self.disconnect(server, client) @@ -572,7 +572,7 @@ async def test_connect_anna_v4_no_modules(self): ) await self.device_test(api, "2022-05-16 00:00:01", testdata) - assert self.entity_items == 14 + assert self.entity_items == 12 await api.close_connection() await self.disconnect(server, client) diff --git a/tests/test_legacy_anna.py b/tests/test_legacy_anna.py index bf12e143c..521c89bed 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 == 44 + assert self.entity_items == 46 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 == 44 + assert self.entity_items == 46 result = await self.tinker_legacy_thermostat(api) assert result From ca7ff5119db3b0d32bae103fb26ce2290a75bc6e Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Fri, 19 Dec 2025 17:26:01 +0100 Subject: [PATCH 46/99] Rework legacy - 2 --- plugwise/legacy/helper.py | 1 + 1 file changed, 1 insertion(+) diff --git a/plugwise/legacy/helper.py b/plugwise/legacy/helper.py index 4f3c806c3..646611213 100644 --- a/plugwise/legacy/helper.py +++ b/plugwise/legacy/helper.py @@ -239,6 +239,7 @@ def _p1_smartmeter_info_finder(self, appl: Munch) -> None: appl.mac = None appl.model = self.smile.model appl.model_id = None + appl.module_id = None appl.name = "P1" appl.pwclass = "smartmeter" appl.zigbee_mac = None From b03ad00fd0487ed814e9b65066f7eaeae39a2846 Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Fri, 19 Dec 2025 17:28:02 +0100 Subject: [PATCH 47/99] Update test entity_items asserts and test-jsons - 3 --- tests/test_p1.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test_p1.py b/tests/test_p1.py index 1c459d216..80af2b91a 100644 --- a/tests/test_p1.py +++ b/tests/test_p1.py @@ -28,7 +28,7 @@ async def test_connect_p1v4_442_single(self): await self.device_test(api, "2022-05-16 00:00:01", testdata) assert api.gateway_id == "a455b61e52394b2db5081ce025a430f3" - assert self.entity_items == 33 + assert self.entity_items == 34 assert not self.notifications # Now change some data and change directory reading xml from @@ -78,7 +78,7 @@ async def test_connect_p1v4_442_triple(self): await self.device_test(api, "2022-05-16 00:00:01", testdata) assert api.gateway_id == "03e65b16e4b247a29ae0d75a78cb492e" - assert self.entity_items == 42 + assert self.entity_items == 43 assert self.notifications await api.close_connection() From 0b55efbf5a8da1c6f961121236441e7fe497d296 Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Sat, 20 Dec 2025 16:51:11 +0100 Subject: [PATCH 48/99] Typing and other fixes --- plugwise/helper.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugwise/helper.py b/plugwise/helper.py index 226eac406..4673a1003 100644 --- a/plugwise/helper.py +++ b/plugwise/helper.py @@ -856,7 +856,7 @@ def _scan_thermostats(self) -> None: self._existing_zones = self._new_zones self._new_zones = [] - def _match_and_rank_thermostats(self) -> dict[str, ThermoLoc]: + def _match_and_rank_thermostats(self) -> None: """Helper-function for _scan_thermostats(). Match thermostat-appliances with locations, rank them for locations with multiple thermostats. From ec66121cb698f22f73f9575db2273a5a1c6388e7 Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Sat, 20 Dec 2025 16:58:33 +0100 Subject: [PATCH 49/99] Save updated fixtures --- fixtures/adam_heatpump_cooling/data.json | 186 +++--------------- fixtures/adam_jip/data.json | 101 ++-------- .../adam_multiple_devices_per_zone/data.json | 68 ++----- .../data.json | 24 +-- fixtures/adam_plus_anna/data.json | 17 +- fixtures/adam_plus_anna_new/data.json | 49 +---- .../data.json | 53 +---- fixtures/adam_zone_per_device/data.json | 76 ++----- fixtures/anna_elga_2/data.json | 13 +- fixtures/anna_elga_2_cooling/data.json | 13 +- fixtures/anna_elga_2_schedule_off/data.json | 13 +- fixtures/anna_elga_no_cooling/data.json | 13 +- fixtures/anna_heatpump_cooling/data.json | 13 +- .../data.json | 13 +- fixtures/anna_heatpump_heating/data.json | 13 +- fixtures/anna_loria_cooling_active/data.json | 22 +-- fixtures/anna_loria_driessens/data.json | 16 +- fixtures/anna_loria_heating_idle/data.json | 22 +-- fixtures/anna_p1/data.json | 13 +- fixtures/anna_v4/data.json | 14 +- fixtures/anna_v4_dhw/data.json | 14 +- fixtures/anna_v4_no_tag/data.json | 14 +- fixtures/anna_without_boiler_fw441/data.json | 14 +- fixtures/legacy_anna/data.json | 2 + fixtures/legacy_anna_2/data.json | 2 + fixtures/m_adam_cooling/data.json | 6 + fixtures/m_adam_heating/data.json | 6 + fixtures/m_adam_jip/data.json | 10 + .../data.json | 16 ++ fixtures/m_anna_heatpump_cooling/data.json | 2 + fixtures/m_anna_heatpump_idle/data.json | 2 + fixtures/p1v4_442_single/data.json | 1 + fixtures/p1v4_442_triple/data.json | 1 + tests/data/adam/adam_heatpump_cooling.json | 186 +++--------------- tests/data/adam/adam_jip.json | 101 ++-------- .../adam/adam_multiple_devices_per_zone.json | 68 ++----- .../adam_onoff_cooling_fake_firmware.json | 24 +-- tests/data/adam/adam_plus_anna.json | 17 +- tests/data/adam/adam_plus_anna_new.json | 49 +---- tests/data/adam/adam_zone_per_device.json | 76 ++----- tests/data/anna/anna_v4.json | 14 +- 41 files changed, 271 insertions(+), 1106 deletions(-) diff --git a/fixtures/adam_heatpump_cooling/data.json b/fixtures/adam_heatpump_cooling/data.json index 60d15563c..ce4bcc63b 100644 --- a/fixtures/adam_heatpump_cooling/data.json +++ b/fixtures/adam_heatpump_cooling/data.json @@ -12,13 +12,7 @@ "dev_class": "climate", "model": "ThermoZone", "name": "Slaapkamer SJ", - "preset_modes": [ - "no_frost", - "vacation", - "away", - "home", - "asleep" - ], + "preset_modes": ["no_frost", "vacation", "away", "home", "asleep"], "select_schedule": "off", "select_zone_profile": "passive", "sensors": { @@ -33,17 +27,11 @@ "upper_bound": 99.9 }, "thermostats": { - "primary": [ - "d3a276aeb3114a509bab1e4bf8c40348" - ], + "primary": ["d3a276aeb3114a509bab1e4bf8c40348"], "secondary": [] }, "vendor": "Plugwise", - "zone_profiles": [ - "active", - "off", - "passive" - ] + "zone_profiles": ["active", "off", "passive"] }, "0ca13e8176204ca7bf6f09de59f81c83": { "available": true, @@ -147,13 +135,7 @@ "dev_class": "climate", "model": "ThermoZone", "name": "Slaapkamer DB", - "preset_modes": [ - "no_frost", - "vacation", - "away", - "home", - "asleep" - ], + "preset_modes": ["no_frost", "vacation", "away", "home", "asleep"], "select_schedule": "off", "select_zone_profile": "passive", "sensors": { @@ -168,17 +150,11 @@ "upper_bound": 99.9 }, "thermostats": { - "primary": [ - "47e2c550a33846b680725aa3fb229473" - ], + "primary": ["47e2c550a33846b680725aa3fb229473"], "secondary": [] }, "vendor": "Plugwise", - "zone_profiles": [ - "active", - "off", - "passive" - ] + "zone_profiles": ["active", "off", "passive"] }, "2e0fc4db2a6d4cbeb7cf786143543961": { "available": true, @@ -279,13 +255,7 @@ "dev_class": "climate", "model": "ThermoZone", "name": "Badkamer 2", - "preset_modes": [ - "no_frost", - "vacation", - "away", - "home", - "asleep" - ], + "preset_modes": ["no_frost", "vacation", "away", "home", "asleep"], "select_schedule": "Werkdag schema", "select_zone_profile": "passive", "sensors": { @@ -299,17 +269,11 @@ "upper_bound": 99.9 }, "thermostats": { - "primary": [ - "f04c985c11ad4848b8fcd710343f9dcf" - ], + "primary": ["f04c985c11ad4848b8fcd710343f9dcf"], "secondary": [] }, "vendor": "Plugwise", - "zone_profiles": [ - "active", - "off", - "passive" - ] + "zone_profiles": ["active", "off", "passive"] }, "5ead63c65e5f44e7870ba2bd680ceb9e": { "available": true, @@ -338,11 +302,7 @@ }, "dev_class": "gateway", "firmware": "3.2.8", - "gateway_modes": [ - "away", - "full", - "vacation" - ], + "gateway_modes": ["away", "full", "vacation"], "hardware": "AME Smile 2.0 board", "location": "eedadcb297564f1483faa509179aebed", "mac_address": "012345670001", @@ -443,13 +403,7 @@ "dev_class": "climate", "model": "ThermoZone", "name": "Badkamer 1", - "preset_modes": [ - "no_frost", - "vacation", - "away", - "home", - "asleep" - ], + "preset_modes": ["no_frost", "vacation", "away", "home", "asleep"], "select_schedule": "Werkdag schema", "select_zone_profile": "passive", "sensors": { @@ -464,17 +418,11 @@ "upper_bound": 99.9 }, "thermostats": { - "primary": [ - "eac5db95d97241f6b17790897847ccf5" - ], + "primary": ["eac5db95d97241f6b17790897847ccf5"], "secondary": [] }, "vendor": "Plugwise", - "zone_profiles": [ - "active", - "off", - "passive" - ] + "zone_profiles": ["active", "off", "passive"] }, "93ac3f7bf25342f58cbb77c4a99ac0b3": { "active_preset": "away", @@ -489,13 +437,7 @@ "dev_class": "climate", "model": "ThermoZone", "name": "Slaapkamer RB", - "preset_modes": [ - "no_frost", - "vacation", - "away", - "home", - "asleep" - ], + "preset_modes": ["no_frost", "vacation", "away", "home", "asleep"], "select_schedule": "off", "select_zone_profile": "passive", "sensors": { @@ -509,17 +451,11 @@ "upper_bound": 99.9 }, "thermostats": { - "primary": [ - "c4ed311d54e341f58b4cdd201d1fde7e" - ], + "primary": ["c4ed311d54e341f58b4cdd201d1fde7e"], "secondary": [] }, "vendor": "Plugwise", - "zone_profiles": [ - "active", - "off", - "passive" - ] + "zone_profiles": ["active", "off", "passive"] }, "96714ad90fc948bcbcb5021c4b9f5ae9": { "available": true, @@ -555,13 +491,7 @@ "dev_class": "climate", "model": "ThermoZone", "name": "Slaapkamer SQ", - "preset_modes": [ - "no_frost", - "vacation", - "away", - "home", - "asleep" - ], + "preset_modes": ["no_frost", "vacation", "away", "home", "asleep"], "select_schedule": "off", "select_zone_profile": "passive", "sensors": { @@ -576,17 +506,11 @@ "upper_bound": 99.9 }, "thermostats": { - "primary": [ - "beb32da072274e698146db8b022f3c36" - ], + "primary": ["beb32da072274e698146db8b022f3c36"], "secondary": [] }, "vendor": "Plugwise", - "zone_profiles": [ - "active", - "off", - "passive" - ] + "zone_profiles": ["active", "off", "passive"] }, "a03b6e8e76dd4646af1a77c31dd9370c": { "available": true, @@ -622,13 +546,7 @@ "dev_class": "climate", "model": "ThermoZone", "name": "Keuken", - "preset_modes": [ - "no_frost", - "vacation", - "away", - "home", - "asleep" - ], + "preset_modes": ["no_frost", "vacation", "away", "home", "asleep"], "select_schedule": "Werkdag schema", "select_zone_profile": "active", "sensors": { @@ -643,17 +561,11 @@ "upper_bound": 99.9 }, "thermostats": { - "primary": [ - "ea8372c0e3ad4622ad45a041d02425f5" - ], + "primary": ["ea8372c0e3ad4622ad45a041d02425f5"], "secondary": [] }, "vendor": "Plugwise", - "zone_profiles": [ - "active", - "off", - "passive" - ] + "zone_profiles": ["active", "off", "passive"] }, "b52908550469425b812c87f766fe5303": { "active_preset": "away", @@ -668,13 +580,7 @@ "dev_class": "climate", "model": "ThermoZone", "name": "Bijkeuken", - "preset_modes": [ - "no_frost", - "vacation", - "away", - "home", - "asleep" - ], + "preset_modes": ["no_frost", "vacation", "away", "home", "asleep"], "select_schedule": "off", "select_zone_profile": "active", "sensors": { @@ -689,17 +595,11 @@ "upper_bound": 99.9 }, "thermostats": { - "primary": [ - "1053c8bbf8be43c6921742b146a625f1" - ], + "primary": ["1053c8bbf8be43c6921742b146a625f1"], "secondary": [] }, "vendor": "Plugwise", - "zone_profiles": [ - "active", - "off", - "passive" - ] + "zone_profiles": ["active", "off", "passive"] }, "bbcffa48019f4b09b8368bbaf9559e68": { "available": true, @@ -817,13 +717,7 @@ "dev_class": "climate", "model": "ThermoZone", "name": "Slaapkamer JM", - "preset_modes": [ - "no_frost", - "vacation", - "away", - "home", - "asleep" - ], + "preset_modes": ["no_frost", "vacation", "away", "home", "asleep"], "select_schedule": "off", "select_zone_profile": "passive", "sensors": { @@ -838,17 +732,11 @@ "upper_bound": 99.9 }, "thermostats": { - "primary": [ - "7fda9f84f01342f8afe9ebbbbff30c0f" - ], + "primary": ["7fda9f84f01342f8afe9ebbbbff30c0f"], "secondary": [] }, "vendor": "Plugwise", - "zone_profiles": [ - "active", - "off", - "passive" - ] + "zone_profiles": ["active", "off", "passive"] }, "ea8372c0e3ad4622ad45a041d02425f5": { "available": true, @@ -936,13 +824,7 @@ "dev_class": "climate", "model": "ThermoZone", "name": "Woonkamer", - "preset_modes": [ - "no_frost", - "vacation", - "away", - "home", - "asleep" - ], + "preset_modes": ["no_frost", "vacation", "away", "home", "asleep"], "select_schedule": "Werkdag schema", "select_zone_profile": "active", "sensors": { @@ -957,16 +839,10 @@ "upper_bound": 35.0 }, "thermostats": { - "primary": [ - "ca79d23ae0094120b877558734cff85c" - ], + "primary": ["ca79d23ae0094120b877558734cff85c"], "secondary": [] }, "vendor": "Plugwise", - "zone_profiles": [ - "active", - "off", - "passive" - ] + "zone_profiles": ["active", "off", "passive"] } } diff --git a/fixtures/adam_jip/data.json b/fixtures/adam_jip/data.json index c13bd34c3..d680a2293 100644 --- a/fixtures/adam_jip/data.json +++ b/fixtures/adam_jip/data.json @@ -7,13 +7,7 @@ "dev_class": "climate", "model": "ThermoZone", "name": "Slaapkamer", - "preset_modes": [ - "home", - "asleep", - "away", - "vacation", - "no_frost" - ], + "preset_modes": ["home", "asleep", "away", "vacation", "no_frost"], "select_schedule": null, "select_zone_profile": "active", "sensors": { @@ -26,19 +20,11 @@ "upper_bound": 99.9 }, "thermostats": { - "primary": [ - "1346fbd8498d4dbcab7e18d51b771f3d" - ], - "secondary": [ - "356b65335e274d769c338223e7af9c33" - ] + "primary": ["1346fbd8498d4dbcab7e18d51b771f3d"], + "secondary": ["356b65335e274d769c338223e7af9c33"] }, "vendor": "Plugwise", - "zone_profiles": [ - "active", - "off", - "passive" - ] + "zone_profiles": ["active", "off", "passive"] }, "13228dab8ce04617af318a2888b3c548": { "active_preset": "home", @@ -48,13 +34,7 @@ "dev_class": "climate", "model": "ThermoZone", "name": "Woonkamer", - "preset_modes": [ - "home", - "asleep", - "away", - "vacation", - "no_frost" - ], + "preset_modes": ["home", "asleep", "away", "vacation", "no_frost"], "select_schedule": null, "select_zone_profile": "active", "sensors": { @@ -67,19 +47,11 @@ "upper_bound": 30.0 }, "thermostats": { - "primary": [ - "f61f1a2535f54f52ad006a3d18e459ca" - ], - "secondary": [ - "833de10f269c4deab58fb9df69901b4e" - ] + "primary": ["f61f1a2535f54f52ad006a3d18e459ca"], + "secondary": ["833de10f269c4deab58fb9df69901b4e"] }, "vendor": "Plugwise", - "zone_profiles": [ - "active", - "off", - "passive" - ] + "zone_profiles": ["active", "off", "passive"] }, "1346fbd8498d4dbcab7e18d51b771f3d": { "available": true, @@ -261,11 +233,7 @@ }, "dev_class": "gateway", "firmware": "3.2.8", - "gateway_modes": [ - "away", - "full", - "vacation" - ], + "gateway_modes": ["away", "full", "vacation"], "hardware": "AME Smile 2.0 board", "location": "9e4433a9d69f40b3aefd15e74395eaec", "mac_address": "012345670001", @@ -273,12 +241,7 @@ "model_id": "smile_open_therm", "name": "Adam", "notifications": {}, - "regulation_modes": [ - "heating", - "off", - "bleeding_cold", - "bleeding_hot" - ], + "regulation_modes": ["heating", "off", "bleeding_cold", "bleeding_hot"], "select_gateway_mode": "full", "select_regulation_mode": "heating", "sensors": { @@ -295,13 +258,7 @@ "dev_class": "climate", "model": "ThermoZone", "name": "Kinderkamer", - "preset_modes": [ - "home", - "asleep", - "away", - "vacation", - "no_frost" - ], + "preset_modes": ["home", "asleep", "away", "vacation", "no_frost"], "select_schedule": null, "select_zone_profile": "active", "sensors": { @@ -314,19 +271,11 @@ "upper_bound": 99.9 }, "thermostats": { - "primary": [ - "6f3e9d7084214c21b9dfa46f6eeb8700" - ], - "secondary": [ - "d4496250d0e942cfa7aea3476e9070d5" - ] + "primary": ["6f3e9d7084214c21b9dfa46f6eeb8700"], + "secondary": ["d4496250d0e942cfa7aea3476e9070d5"] }, "vendor": "Plugwise", - "zone_profiles": [ - "active", - "off", - "passive" - ] + "zone_profiles": ["active", "off", "passive"] }, "d4496250d0e942cfa7aea3476e9070d5": { "available": true, @@ -361,13 +310,7 @@ "dev_class": "climate", "model": "ThermoZone", "name": "Logeerkamer", - "preset_modes": [ - "home", - "asleep", - "away", - "vacation", - "no_frost" - ], + "preset_modes": ["home", "asleep", "away", "vacation", "no_frost"], "select_schedule": null, "select_zone_profile": "active", "sensors": { @@ -380,19 +323,11 @@ "upper_bound": 99.9 }, "thermostats": { - "primary": [ - "a6abc6a129ee499c88a4d420cc413b47" - ], - "secondary": [ - "1da4d325838e4ad8aac12177214505c9" - ] + "primary": ["a6abc6a129ee499c88a4d420cc413b47"], + "secondary": ["1da4d325838e4ad8aac12177214505c9"] }, "vendor": "Plugwise", - "zone_profiles": [ - "active", - "off", - "passive" - ] + "zone_profiles": ["active", "off", "passive"] }, "e4684553153b44afbef2200885f379dc": { "available": true, diff --git a/fixtures/adam_multiple_devices_per_zone/data.json b/fixtures/adam_multiple_devices_per_zone/data.json index 23c37dc63..6f4dab2ff 100644 --- a/fixtures/adam_multiple_devices_per_zone/data.json +++ b/fixtures/adam_multiple_devices_per_zone/data.json @@ -36,13 +36,7 @@ "dev_class": "climate", "model": "ThermoZone", "name": "Badkamer", - "preset_modes": [ - "home", - "asleep", - "away", - "vacation", - "no_frost" - ], + "preset_modes": ["home", "asleep", "away", "vacation", "no_frost"], "select_schedule": "Badkamer Schema", "sensors": { "temperature": 18.9 @@ -77,13 +71,7 @@ "dev_class": "climate", "model": "ThermoZone", "name": "Bios", - "preset_modes": [ - "home", - "asleep", - "away", - "vacation", - "no_frost" - ], + "preset_modes": ["home", "asleep", "away", "vacation", "no_frost"], "select_schedule": "off", "sensors": { "electricity_consumed": 0.0, @@ -97,12 +85,8 @@ "upper_bound": 100.0 }, "thermostats": { - "primary": [ - "df4a4a8169904cdb9c03d61a21f42140" - ], - "secondary": [ - "a2c3583e0a6349358998b760cea82d2a" - ] + "primary": ["df4a4a8169904cdb9c03d61a21f42140"], + "secondary": ["a2c3583e0a6349358998b760cea82d2a"] }, "vendor": "Plugwise" }, @@ -143,13 +127,7 @@ "dev_class": "climate", "model": "ThermoZone", "name": "Garage", - "preset_modes": [ - "home", - "asleep", - "away", - "vacation", - "no_frost" - ], + "preset_modes": ["home", "asleep", "away", "vacation", "no_frost"], "select_schedule": "off", "sensors": { "temperature": 15.6 @@ -161,9 +139,7 @@ "upper_bound": 100.0 }, "thermostats": { - "primary": [ - "e7693eb9582644e5b865dba8d4447cf1" - ], + "primary": ["e7693eb9582644e5b865dba8d4447cf1"], "secondary": [] }, "vendor": "Plugwise" @@ -304,13 +280,7 @@ "dev_class": "climate", "model": "ThermoZone", "name": "Jessie", - "preset_modes": [ - "home", - "asleep", - "away", - "vacation", - "no_frost" - ], + "preset_modes": ["home", "asleep", "away", "vacation", "no_frost"], "select_schedule": "CV Jessie", "sensors": { "temperature": 17.2 @@ -322,12 +292,8 @@ "upper_bound": 100.0 }, "thermostats": { - "primary": [ - "6a3bf693d05e48e0b460c815a4fdd09d" - ], - "secondary": [ - "d3da73bde12a47d5a6b8f9dad971f2ec" - ] + "primary": ["6a3bf693d05e48e0b460c815a4fdd09d"], + "secondary": ["d3da73bde12a47d5a6b8f9dad971f2ec"] }, "vendor": "Plugwise" }, @@ -463,13 +429,7 @@ "dev_class": "climate", "model": "ThermoZone", "name": "Woonkamer", - "preset_modes": [ - "home", - "asleep", - "away", - "vacation", - "no_frost" - ], + "preset_modes": ["home", "asleep", "away", "vacation", "no_frost"], "select_schedule": "GF7 Woonkamer", "sensors": { "electricity_consumed": 35.6, @@ -483,12 +443,8 @@ "upper_bound": 100.0 }, "thermostats": { - "primary": [ - "b59bcebaf94b499ea7d46e4a66fb62d8" - ], - "secondary": [ - "b310b72a0e354bfab43089919b9a88bf" - ] + "primary": ["b59bcebaf94b499ea7d46e4a66fb62d8"], + "secondary": ["b310b72a0e354bfab43089919b9a88bf"] }, "vendor": "Plugwise" }, diff --git a/fixtures/adam_onoff_cooling_fake_firmware/data.json b/fixtures/adam_onoff_cooling_fake_firmware/data.json index 77a452707..a2dcb5111 100644 --- a/fixtures/adam_onoff_cooling_fake_firmware/data.json +++ b/fixtures/adam_onoff_cooling_fake_firmware/data.json @@ -42,11 +42,7 @@ }, "dev_class": "gateway", "firmware": "3.2.8", - "gateway_modes": [ - "away", - "full", - "vacation" - ], + "gateway_modes": ["away", "full", "vacation"], "hardware": "AME Smile 2.0 board", "location": "eedadcb297564f1483faa509179aebed", "mac_address": "012345670001", @@ -95,13 +91,7 @@ "dev_class": "climate", "model": "ThermoZone", "name": "Woonkamer", - "preset_modes": [ - "no_frost", - "vacation", - "away", - "home", - "asleep" - ], + "preset_modes": ["no_frost", "vacation", "away", "home", "asleep"], "select_schedule": "Werkdag schema", "select_zone_profile": "active", "sensors": { @@ -116,16 +106,10 @@ "upper_bound": 35.0 }, "thermostats": { - "primary": [ - "ca79d23ae0094120b877558734cff85c" - ], + "primary": ["ca79d23ae0094120b877558734cff85c"], "secondary": [] }, "vendor": "Plugwise", - "zone_profiles": [ - "active", - "off", - "passive" - ] + "zone_profiles": ["active", "off", "passive"] } } diff --git a/fixtures/adam_plus_anna/data.json b/fixtures/adam_plus_anna/data.json index 00d4014dd..ccb46dfb2 100644 --- a/fixtures/adam_plus_anna/data.json +++ b/fixtures/adam_plus_anna/data.json @@ -1,22 +1,13 @@ { "009490cc2f674ce6b576863fbb64f867": { "active_preset": "home", - "available_schedules": [ - "Weekschema", - "off" - ], + "available_schedules": ["Weekschema", "off"], "climate_mode": "auto", "control_state": "idle", "dev_class": "climate", "model": "ThermoZone", "name": "Living room", - "preset_modes": [ - "home", - "asleep", - "away", - "vacation", - "no_frost" - ], + "preset_modes": ["home", "asleep", "away", "vacation", "no_frost"], "select_schedule": "Weekschema", "sensors": { "electricity_consumed": 74.2, @@ -30,9 +21,7 @@ "upper_bound": 35.0 }, "thermostats": { - "primary": [ - "ee62cad889f94e8ca3d09021f03a660b" - ], + "primary": ["ee62cad889f94e8ca3d09021f03a660b"], "secondary": [] }, "vendor": "Plugwise" diff --git a/fixtures/adam_plus_anna_new/data.json b/fixtures/adam_plus_anna_new/data.json index 37d51b261..eda4a7bbf 100644 --- a/fixtures/adam_plus_anna_new/data.json +++ b/fixtures/adam_plus_anna_new/data.json @@ -211,11 +211,7 @@ }, "dev_class": "gateway", "firmware": "3.9.0", - "gateway_modes": [ - "away", - "full", - "vacation" - ], + "gateway_modes": ["away", "full", "vacation"], "hardware": "AME Smile 2.0 board", "location": "bc93488efab249e5bc54fd7e175a6f91", "mac_address": "D40FB201CBA0", @@ -223,12 +219,7 @@ "model_id": "smile_open_therm", "name": "Adam", "notifications": {}, - "regulation_modes": [ - "bleeding_cold", - "heating", - "off", - "bleeding_hot" - ], + "regulation_modes": ["bleeding_cold", "heating", "off", "bleeding_hot"], "select_gateway_mode": "full", "select_regulation_mode": "heating", "sensors": { @@ -317,13 +308,7 @@ "dev_class": "climate", "model": "ThermoZone", "name": "Living room", - "preset_modes": [ - "vacation", - "no_frost", - "asleep", - "home", - "away" - ], + "preset_modes": ["vacation", "no_frost", "asleep", "home", "away"], "select_schedule": "Weekschema", "select_zone_profile": "active", "sensors": { @@ -346,11 +331,7 @@ "secondary": [] }, "vendor": "Plugwise", - "zone_profiles": [ - "active", - "off", - "passive" - ] + "zone_profiles": ["active", "off", "passive"] }, "f871b8c4d63549319221e294e4f88074": { "active_preset": "vacation", @@ -366,13 +347,7 @@ "dev_class": "climate", "model": "ThermoZone", "name": "Bathroom", - "preset_modes": [ - "vacation", - "no_frost", - "asleep", - "home", - "away" - ], + "preset_modes": ["vacation", "no_frost", "asleep", "home", "away"], "select_schedule": "off", "select_zone_profile": "passive", "sensors": { @@ -387,18 +362,10 @@ "upper_bound": 99.9 }, "thermostats": { - "primary": [ - "e2f4322d57924fa090fbbc48b3a140dc" - ], - "secondary": [ - "1772a4ea304041adb83f357b751341ff" - ] + "primary": ["e2f4322d57924fa090fbbc48b3a140dc"], + "secondary": ["1772a4ea304041adb83f357b751341ff"] }, "vendor": "Plugwise", - "zone_profiles": [ - "active", - "off", - "passive" - ] + "zone_profiles": ["active", "off", "passive"] } } diff --git a/fixtures/adam_plus_anna_new_regulation_off/data.json b/fixtures/adam_plus_anna_new_regulation_off/data.json index 04b591d1e..bd9dfa846 100644 --- a/fixtures/adam_plus_anna_new_regulation_off/data.json +++ b/fixtures/adam_plus_anna_new_regulation_off/data.json @@ -184,11 +184,7 @@ }, "dev_class": "gateway", "firmware": "3.7.8", - "gateway_modes": [ - "away", - "full", - "vacation" - ], + "gateway_modes": ["away", "full", "vacation"], "hardware": "AME Smile 2.0 board", "location": "bc93488efab249e5bc54fd7e175a6f91", "mac_address": "012345679891", @@ -196,12 +192,7 @@ "model_id": "smile_open_therm", "name": "Adam", "notifications": {}, - "regulation_modes": [ - "bleeding_hot", - "bleeding_cold", - "off", - "heating" - ], + "regulation_modes": ["bleeding_hot", "bleeding_cold", "off", "heating"], "select_gateway_mode": "full", "select_regulation_mode": "off", "sensors": { @@ -268,13 +259,7 @@ "dev_class": "climate", "model": "ThermoZone", "name": "Living room", - "preset_modes": [ - "no_frost", - "asleep", - "vacation", - "home", - "away" - ], + "preset_modes": ["no_frost", "asleep", "vacation", "home", "away"], "select_schedule": "off", "select_zone_profile": "active", "sensors": { @@ -289,17 +274,11 @@ "upper_bound": 35.0 }, "thermostats": { - "primary": [ - "ad4838d7d35c4d6ea796ee12ae5aedf8" - ], + "primary": ["ad4838d7d35c4d6ea796ee12ae5aedf8"], "secondary": [] }, "vendor": "Plugwise", - "zone_profiles": [ - "active", - "off", - "passive" - ] + "zone_profiles": ["active", "off", "passive"] }, "f871b8c4d63549319221e294e4f88074": { "active_preset": "home", @@ -315,13 +294,7 @@ "dev_class": "climate", "model": "ThermoZone", "name": "Bathroom", - "preset_modes": [ - "no_frost", - "asleep", - "vacation", - "home", - "away" - ], + "preset_modes": ["no_frost", "asleep", "vacation", "home", "away"], "select_schedule": "off", "select_zone_profile": "passive", "sensors": { @@ -336,18 +309,10 @@ "upper_bound": 99.9 }, "thermostats": { - "primary": [ - "e2f4322d57924fa090fbbc48b3a140dc" - ], - "secondary": [ - "1772a4ea304041adb83f357b751341ff" - ] + "primary": ["e2f4322d57924fa090fbbc48b3a140dc"], + "secondary": ["1772a4ea304041adb83f357b751341ff"] }, "vendor": "Plugwise", - "zone_profiles": [ - "active", - "off", - "passive" - ] + "zone_profiles": ["active", "off", "passive"] } } diff --git a/fixtures/adam_zone_per_device/data.json b/fixtures/adam_zone_per_device/data.json index d6bdc441e..e1187ccda 100644 --- a/fixtures/adam_zone_per_device/data.json +++ b/fixtures/adam_zone_per_device/data.json @@ -36,13 +36,7 @@ "dev_class": "climate", "model": "ThermoZone", "name": "Badkamer", - "preset_modes": [ - "home", - "asleep", - "away", - "vacation", - "no_frost" - ], + "preset_modes": ["home", "asleep", "away", "vacation", "no_frost"], "select_schedule": "Badkamer Schema", "sensors": { "temperature": 18.8 @@ -54,12 +48,8 @@ "upper_bound": 100.0 }, "thermostats": { - "primary": [ - "f1fee6043d3642a9b0a65297455f008e" - ], - "secondary": [ - "680423ff840043738f42cc7f1ff97a36" - ] + "primary": ["f1fee6043d3642a9b0a65297455f008e"], + "secondary": ["680423ff840043738f42cc7f1ff97a36"] }, "vendor": "Plugwise" }, @@ -78,13 +68,7 @@ "dev_class": "climate", "model": "ThermoZone", "name": "Bios", - "preset_modes": [ - "home", - "asleep", - "away", - "vacation", - "no_frost" - ], + "preset_modes": ["home", "asleep", "away", "vacation", "no_frost"], "select_schedule": "off", "sensors": { "electricity_consumed": 0.0, @@ -98,12 +82,8 @@ "upper_bound": 100.0 }, "thermostats": { - "primary": [ - "df4a4a8169904cdb9c03d61a21f42140" - ], - "secondary": [ - "a2c3583e0a6349358998b760cea82d2a" - ] + "primary": ["df4a4a8169904cdb9c03d61a21f42140"], + "secondary": ["a2c3583e0a6349358998b760cea82d2a"] }, "vendor": "Plugwise" }, @@ -144,13 +124,7 @@ "dev_class": "climate", "model": "ThermoZone", "name": "Garage", - "preset_modes": [ - "home", - "asleep", - "away", - "vacation", - "no_frost" - ], + "preset_modes": ["home", "asleep", "away", "vacation", "no_frost"], "select_schedule": "off", "sensors": { "temperature": 15.6 @@ -162,9 +136,7 @@ "upper_bound": 100.0 }, "thermostats": { - "primary": [ - "e7693eb9582644e5b865dba8d4447cf1" - ], + "primary": ["e7693eb9582644e5b865dba8d4447cf1"], "secondary": [] }, "vendor": "Plugwise" @@ -305,13 +277,7 @@ "dev_class": "climate", "model": "ThermoZone", "name": "Jessie", - "preset_modes": [ - "home", - "asleep", - "away", - "vacation", - "no_frost" - ], + "preset_modes": ["home", "asleep", "away", "vacation", "no_frost"], "select_schedule": "CV Jessie", "sensors": { "temperature": 17.1 @@ -323,12 +289,8 @@ "upper_bound": 100.0 }, "thermostats": { - "primary": [ - "6a3bf693d05e48e0b460c815a4fdd09d" - ], - "secondary": [ - "d3da73bde12a47d5a6b8f9dad971f2ec" - ] + "primary": ["6a3bf693d05e48e0b460c815a4fdd09d"], + "secondary": ["d3da73bde12a47d5a6b8f9dad971f2ec"] }, "vendor": "Plugwise" }, @@ -464,13 +426,7 @@ "dev_class": "climate", "model": "ThermoZone", "name": "Woonkamer", - "preset_modes": [ - "home", - "asleep", - "away", - "vacation", - "no_frost" - ], + "preset_modes": ["home", "asleep", "away", "vacation", "no_frost"], "select_schedule": "GF7 Woonkamer", "sensors": { "electricity_consumed": 35.8, @@ -484,12 +440,8 @@ "upper_bound": 100.0 }, "thermostats": { - "primary": [ - "b59bcebaf94b499ea7d46e4a66fb62d8" - ], - "secondary": [ - "b310b72a0e354bfab43089919b9a88bf" - ] + "primary": ["b59bcebaf94b499ea7d46e4a66fb62d8"], + "secondary": ["b310b72a0e354bfab43089919b9a88bf"] }, "vendor": "Plugwise" }, diff --git a/fixtures/anna_elga_2/data.json b/fixtures/anna_elga_2/data.json index 86532596d..77812c8a5 100644 --- a/fixtures/anna_elga_2/data.json +++ b/fixtures/anna_elga_2/data.json @@ -31,10 +31,7 @@ }, "ebd90df1ab334565b5895f37590ccff4": { "active_preset": "home", - "available_schedules": [ - "Thermostat schedule", - "off" - ], + "available_schedules": ["Thermostat schedule", "off"], "climate_mode": "auto", "control_state": "heating", "dev_class": "thermostat", @@ -44,13 +41,7 @@ "model": "ThermoTouch", "module_id": "3b36454dda794c6faaed4053a89e80ce", "name": "Anna", - "preset_modes": [ - "away", - "no_frost", - "vacation", - "home", - "asleep" - ], + "preset_modes": ["away", "no_frost", "vacation", "home", "asleep"], "select_schedule": "Thermostat schedule", "sensors": { "cooling_activation_outdoor_temperature": 24.0, diff --git a/fixtures/anna_elga_2_cooling/data.json b/fixtures/anna_elga_2_cooling/data.json index e29afa85b..035b39073 100644 --- a/fixtures/anna_elga_2_cooling/data.json +++ b/fixtures/anna_elga_2_cooling/data.json @@ -37,10 +37,7 @@ }, "ebd90df1ab334565b5895f37590ccff4": { "active_preset": "home", - "available_schedules": [ - "Thermostat schedule", - "off" - ], + "available_schedules": ["Thermostat schedule", "off"], "climate_mode": "auto", "control_state": "cooling", "dev_class": "thermostat", @@ -50,13 +47,7 @@ "model": "ThermoTouch", "module_id": "3b36454dda794c6faaed4053a89e80ce", "name": "Anna", - "preset_modes": [ - "away", - "no_frost", - "vacation", - "home", - "asleep" - ], + "preset_modes": ["away", "no_frost", "vacation", "home", "asleep"], "select_schedule": "Thermostat schedule", "sensors": { "cooling_activation_outdoor_temperature": 26.0, diff --git a/fixtures/anna_elga_2_schedule_off/data.json b/fixtures/anna_elga_2_schedule_off/data.json index 548bd5286..004398661 100644 --- a/fixtures/anna_elga_2_schedule_off/data.json +++ b/fixtures/anna_elga_2_schedule_off/data.json @@ -37,10 +37,7 @@ }, "ebd90df1ab334565b5895f37590ccff4": { "active_preset": "home", - "available_schedules": [ - "Thermostat schedule", - "off" - ], + "available_schedules": ["Thermostat schedule", "off"], "climate_mode": "heat_cool", "control_state": "idle", "dev_class": "thermostat", @@ -50,13 +47,7 @@ "model": "ThermoTouch", "module_id": "3b36454dda794c6faaed4053a89e80ce", "name": "Anna", - "preset_modes": [ - "away", - "no_frost", - "vacation", - "home", - "asleep" - ], + "preset_modes": ["away", "no_frost", "vacation", "home", "asleep"], "select_schedule": "off", "sensors": { "cooling_activation_outdoor_temperature": 26.0, diff --git a/fixtures/anna_elga_no_cooling/data.json b/fixtures/anna_elga_no_cooling/data.json index f81bda7b4..6a1ac4438 100644 --- a/fixtures/anna_elga_no_cooling/data.json +++ b/fixtures/anna_elga_no_cooling/data.json @@ -59,10 +59,7 @@ }, "3cb70739631c4d17a86b8b12e8a5161b": { "active_preset": "home", - "available_schedules": [ - "standaard", - "off" - ], + "available_schedules": ["standaard", "off"], "climate_mode": "auto", "control_state": "heating", "dev_class": "thermostat", @@ -72,13 +69,7 @@ "model": "ThermoTouch", "module_id": "e3204a14c278431a8890525dd83edf9d", "name": "Anna", - "preset_modes": [ - "no_frost", - "home", - "away", - "asleep", - "vacation" - ], + "preset_modes": ["no_frost", "home", "away", "asleep", "vacation"], "select_schedule": "standaard", "sensors": { "cooling_activation_outdoor_temperature": 21.0, diff --git a/fixtures/anna_heatpump_cooling/data.json b/fixtures/anna_heatpump_cooling/data.json index 5243282bb..5d1868a4a 100644 --- a/fixtures/anna_heatpump_cooling/data.json +++ b/fixtures/anna_heatpump_cooling/data.json @@ -56,10 +56,7 @@ }, "3cb70739631c4d17a86b8b12e8a5161b": { "active_preset": "home", - "available_schedules": [ - "standaard", - "off" - ], + "available_schedules": ["standaard", "off"], "climate_mode": "heat_cool", "control_state": "cooling", "dev_class": "thermostat", @@ -69,13 +66,7 @@ "model": "ThermoTouch", "module_id": "e3204a14c278431a8890525dd83edf9d", "name": "Anna", - "preset_modes": [ - "no_frost", - "home", - "away", - "asleep", - "vacation" - ], + "preset_modes": ["no_frost", "home", "away", "asleep", "vacation"], "select_schedule": "off", "sensors": { "cooling_activation_outdoor_temperature": 21.0, diff --git a/fixtures/anna_heatpump_cooling_fake_firmware/data.json b/fixtures/anna_heatpump_cooling_fake_firmware/data.json index bcca41647..99d51e503 100644 --- a/fixtures/anna_heatpump_cooling_fake_firmware/data.json +++ b/fixtures/anna_heatpump_cooling_fake_firmware/data.json @@ -56,10 +56,7 @@ }, "3cb70739631c4d17a86b8b12e8a5161b": { "active_preset": "home", - "available_schedules": [ - "standaard", - "off" - ], + "available_schedules": ["standaard", "off"], "climate_mode": "heat_cool", "control_state": "cooling", "dev_class": "thermostat", @@ -69,13 +66,7 @@ "model": "ThermoTouch", "module_id": "e3204a14c278431a8890525dd83edf9d", "name": "Anna", - "preset_modes": [ - "no_frost", - "home", - "away", - "asleep", - "vacation" - ], + "preset_modes": ["no_frost", "home", "away", "asleep", "vacation"], "select_schedule": "off", "sensors": { "cooling_activation_outdoor_temperature": 21.0, diff --git a/fixtures/anna_heatpump_heating/data.json b/fixtures/anna_heatpump_heating/data.json index 77a473317..b4ebdeace 100644 --- a/fixtures/anna_heatpump_heating/data.json +++ b/fixtures/anna_heatpump_heating/data.json @@ -61,10 +61,7 @@ }, "3cb70739631c4d17a86b8b12e8a5161b": { "active_preset": "home", - "available_schedules": [ - "standaard", - "off" - ], + "available_schedules": ["standaard", "off"], "climate_mode": "auto", "control_state": "heating", "dev_class": "thermostat", @@ -74,13 +71,7 @@ "model": "ThermoTouch", "module_id": "e3204a14c278431a8890525dd83edf9d", "name": "Anna", - "preset_modes": [ - "no_frost", - "home", - "away", - "asleep", - "vacation" - ], + "preset_modes": ["no_frost", "home", "away", "asleep", "vacation"], "select_schedule": "standaard", "sensors": { "cooling_activation_outdoor_temperature": 21.0, diff --git a/fixtures/anna_loria_cooling_active/data.json b/fixtures/anna_loria_cooling_active/data.json index 592d2b75a..8e08679f5 100644 --- a/fixtures/anna_loria_cooling_active/data.json +++ b/fixtures/anna_loria_cooling_active/data.json @@ -1,11 +1,7 @@ { "582dfbdace4d4aeb832923ce7d1ddda0": { "active_preset": "home", - "available_schedules": [ - "Winter", - "Test ", - "off" - ], + "available_schedules": ["Winter", "Test ", "off"], "climate_mode": "auto", "control_state": "cooling", "dev_class": "thermostat", @@ -15,13 +11,7 @@ "model": "ThermoTouch", "module_id": "734af4309ab3417499e85d16e5750015", "name": "Anna", - "preset_modes": [ - "away", - "vacation", - "no_frost", - "home", - "asleep" - ], + "preset_modes": ["away", "vacation", "no_frost", "home", "asleep"], "select_schedule": "Winter", "sensors": { "illuminance": 45.0, @@ -72,13 +62,7 @@ "heating_state": false }, "dev_class": "heater_central", - "dhw_modes": [ - "off", - "auto", - "boost", - "eco", - "comfort" - ], + "dhw_modes": ["off", "auto", "boost", "eco", "comfort"], "location": "674b657c138a41a291d315d7471deb06", "max_dhw_temperature": { "lower_bound": 35.0, diff --git a/fixtures/anna_loria_driessens/data.json b/fixtures/anna_loria_driessens/data.json index 3a8440db4..7b1cd7e67 100644 --- a/fixtures/anna_loria_driessens/data.json +++ b/fixtures/anna_loria_driessens/data.json @@ -35,13 +35,7 @@ "model": "ThermoTouch", "module_id": "ca2dedb4b4a14a89bfc6a42aa0053ddb", "name": "Anna", - "preset_modes": [ - "no_frost", - "asleep", - "vacation", - "away", - "home" - ], + "preset_modes": ["no_frost", "asleep", "vacation", "away", "home"], "select_schedule": "Verwarmen@9-23u", "sensors": { "illuminance": 5.5, @@ -74,13 +68,7 @@ "heating_state": false }, "dev_class": "heater_central", - "dhw_modes": [ - "comfort", - "eco", - "off", - "boost", - "auto" - ], + "dhw_modes": ["comfort", "eco", "off", "boost", "auto"], "location": "82c15f65c9bf44c592d69e16139355e3", "max_dhw_temperature": { "lower_bound": 35.0, diff --git a/fixtures/anna_loria_heating_idle/data.json b/fixtures/anna_loria_heating_idle/data.json index b04941dcb..7954e7d55 100644 --- a/fixtures/anna_loria_heating_idle/data.json +++ b/fixtures/anna_loria_heating_idle/data.json @@ -1,11 +1,7 @@ { "582dfbdace4d4aeb832923ce7d1ddda0": { "active_preset": "home", - "available_schedules": [ - "Winter", - "Test ", - "off" - ], + "available_schedules": ["Winter", "Test ", "off"], "climate_mode": "auto", "control_state": "idle", "dev_class": "thermostat", @@ -15,13 +11,7 @@ "model": "ThermoTouch", "module_id": "734af4309ab3417499e85d16e5750015", "name": "Anna", - "preset_modes": [ - "away", - "vacation", - "no_frost", - "home", - "asleep" - ], + "preset_modes": ["away", "vacation", "no_frost", "home", "asleep"], "select_schedule": "Winter", "sensors": { "illuminance": 45.0, @@ -72,13 +62,7 @@ "heating_state": false }, "dev_class": "heater_central", - "dhw_modes": [ - "off", - "auto", - "boost", - "eco", - "comfort" - ], + "dhw_modes": ["off", "auto", "boost", "eco", "comfort"], "location": "674b657c138a41a291d315d7471deb06", "max_dhw_temperature": { "lower_bound": 35.0, diff --git a/fixtures/anna_p1/data.json b/fixtures/anna_p1/data.json index ee4b57ea4..055816f67 100644 --- a/fixtures/anna_p1/data.json +++ b/fixtures/anna_p1/data.json @@ -1,10 +1,7 @@ { "1e5e55b958ac445583602f767cb45942": { "active_preset": "home", - "available_schedules": [ - "Thermostat schedule", - "off" - ], + "available_schedules": ["Thermostat schedule", "off"], "climate_mode": "heat", "control_state": "idle", "dev_class": "thermostat", @@ -14,13 +11,7 @@ "model": "ThermoTouch", "module_id": "4cac351dd8494d0fb4adbb75f4cdf89c", "name": "Anna", - "preset_modes": [ - "home", - "asleep", - "away", - "vacation", - "no_frost" - ], + "preset_modes": ["home", "asleep", "away", "vacation", "no_frost"], "select_schedule": "off", "sensors": { "illuminance": 2.0, diff --git a/fixtures/anna_v4/data.json b/fixtures/anna_v4/data.json index 563bd837e..ed80590c4 100644 --- a/fixtures/anna_v4/data.json +++ b/fixtures/anna_v4/data.json @@ -1,11 +1,7 @@ { "01b85360fdd243d0aaad4d6ac2a5ba7e": { "active_preset": "home", - "available_schedules": [ - "Standaard", - "Thuiswerken", - "off" - ], + "available_schedules": ["Standaard", "Thuiswerken", "off"], "climate_mode": "heat", "control_state": "heating", "dev_class": "thermostat", @@ -15,13 +11,7 @@ "model": "ThermoTouch", "module_id": "807a45cbc950419c98ce4624bc27ff09", "name": "Anna", - "preset_modes": [ - "vacation", - "no_frost", - "away", - "asleep", - "home" - ], + "preset_modes": ["vacation", "no_frost", "away", "asleep", "home"], "select_schedule": "off", "sensors": { "illuminance": 60.0, diff --git a/fixtures/anna_v4_dhw/data.json b/fixtures/anna_v4_dhw/data.json index f7ab1fb4b..27dec8952 100644 --- a/fixtures/anna_v4_dhw/data.json +++ b/fixtures/anna_v4_dhw/data.json @@ -1,11 +1,7 @@ { "01b85360fdd243d0aaad4d6ac2a5ba7e": { "active_preset": "home", - "available_schedules": [ - "Standaard", - "Thuiswerken", - "off" - ], + "available_schedules": ["Standaard", "Thuiswerken", "off"], "climate_mode": "heat", "control_state": "idle", "dev_class": "thermostat", @@ -15,13 +11,7 @@ "model": "ThermoTouch", "module_id": "807a45cbc950419c98ce4624bc27ff09", "name": "Anna", - "preset_modes": [ - "vacation", - "no_frost", - "away", - "asleep", - "home" - ], + "preset_modes": ["vacation", "no_frost", "away", "asleep", "home"], "select_schedule": "off", "sensors": { "illuminance": 60.0, diff --git a/fixtures/anna_v4_no_tag/data.json b/fixtures/anna_v4_no_tag/data.json index 7a6c43567..3d9b8ee0e 100644 --- a/fixtures/anna_v4_no_tag/data.json +++ b/fixtures/anna_v4_no_tag/data.json @@ -1,11 +1,7 @@ { "01b85360fdd243d0aaad4d6ac2a5ba7e": { "active_preset": "home", - "available_schedules": [ - "Standaard", - "Thuiswerken", - "off" - ], + "available_schedules": ["Standaard", "Thuiswerken", "off"], "climate_mode": "auto", "control_state": "heating", "dev_class": "thermostat", @@ -15,13 +11,7 @@ "model": "ThermoTouch", "module_id": "807a45cbc950419c98ce4624bc27ff09", "name": "Anna", - "preset_modes": [ - "vacation", - "no_frost", - "away", - "asleep", - "home" - ], + "preset_modes": ["vacation", "no_frost", "away", "asleep", "home"], "select_schedule": "Thuiswerken", "sensors": { "illuminance": 60.0, diff --git a/fixtures/anna_without_boiler_fw441/data.json b/fixtures/anna_without_boiler_fw441/data.json index fc6a556b6..1d99207a9 100644 --- a/fixtures/anna_without_boiler_fw441/data.json +++ b/fixtures/anna_without_boiler_fw441/data.json @@ -1,11 +1,7 @@ { "7ffbb3ab4b6c4ab2915d7510f7bf8fe9": { "active_preset": "home", - "available_schedules": [ - "Test", - "Normaal", - "off" - ], + "available_schedules": ["Test", "Normaal", "off"], "climate_mode": "auto", "control_state": "idle", "dev_class": "thermostat", @@ -15,13 +11,7 @@ "model": "ThermoTouch", "module_id": "2174b15978334867a3d634a16d14ada8", "name": "Anna", - "preset_modes": [ - "no_frost", - "asleep", - "away", - "vacation", - "home" - ], + "preset_modes": ["no_frost", "asleep", "away", "vacation", "home"], "select_schedule": "Normaal", "sensors": { "illuminance": 0.25, diff --git a/fixtures/legacy_anna/data.json b/fixtures/legacy_anna/data.json index 75c12a4c8..69cbb7063 100644 --- a/fixtures/legacy_anna/data.json +++ b/fixtures/legacy_anna/data.json @@ -22,6 +22,7 @@ "upper_bound": 90.0 }, "model": "Generic heater", + "module_id": "e24e9dcb7066426e812606ea5130aab5", "name": "OpenTherm", "sensors": { "dhw_temperature": 51.2, @@ -43,6 +44,7 @@ "hardware": "6539-1301-500", "location": "0000aaaa0000aaaa0000aaaa0000aa00", "model": "ThermoTouch", + "module_id": "49537ee71b3a4da0a324b87562ec8b5f", "name": "Anna", "preset_modes": ["away", "vacation", "asleep", "home", "no_frost"], "select_schedule": null, diff --git a/fixtures/legacy_anna_2/data.json b/fixtures/legacy_anna_2/data.json index 5f1ef01f9..806caaef9 100644 --- a/fixtures/legacy_anna_2/data.json +++ b/fixtures/legacy_anna_2/data.json @@ -9,6 +9,7 @@ "hardware": "6539-1301-5002", "location": "be81e3f8275b4129852c4d8d550ae2eb", "model": "ThermoTouch", + "module_id": "8ee7dfdf4d1c4ad58e6f8b274ff7da9c", "name": "Anna", "preset_modes": ["vacation", "away", "no_frost", "home", "asleep"], "select_schedule": "off", @@ -51,6 +52,7 @@ "upper_bound": 90.0 }, "model": "Generic heater", + "module_id": "43de3a9e223743aa8127e7bfe8e66fb2", "name": "OpenTherm", "sensors": { "dhw_temperature": 0.0, diff --git a/fixtures/m_adam_cooling/data.json b/fixtures/m_adam_cooling/data.json index edd7d0ea5..20112a868 100644 --- a/fixtures/m_adam_cooling/data.json +++ b/fixtures/m_adam_cooling/data.json @@ -16,6 +16,7 @@ "upper_bound": 95.0 }, "model": "Generic heater", + "module_id": "c043b48fa65b4292b5579d5550f19dd2", "name": "OpenTherm", "sensors": { "intended_boiler_temperature": 17.5, @@ -35,6 +36,7 @@ "location": "f2bf9048bef64cc5b6d5110154e33c81", "model": "Emma Pro", "model_id": "170-01", + "module_id": "85e363f2d0234f13885d41acd77ce6b8", "name": "Emma", "sensors": { "battery": 100, @@ -62,6 +64,7 @@ "location": "f871b8c4d63549319221e294e4f88074", "model": "Tom", "model_id": "106-03", + "module_id": "86937b43514d44e090903d72e53d01b3", "name": "Tom Badkamer", "sensors": { "battery": 60, @@ -84,6 +87,7 @@ "location": "f2bf9048bef64cc5b6d5110154e33c81", "model": "ThermoTouch", "model_id": "143.1", + "module_id": "f7727a516f974a7e8bf8ae95b4531a7a", "name": "Anna", "sensors": { "setpoint": 23.5, @@ -146,6 +150,7 @@ "location": "f2bf9048bef64cc5b6d5110154e33c81", "model": "Jip", "model_id": "168-01", + "module_id": "702e95f0db7246bf831bad9fec7a68ff", "name": "Jip", "sensors": { "battery": 100, @@ -167,6 +172,7 @@ "location": "f871b8c4d63549319221e294e4f88074", "model": "Lisa", "model_id": "158-01", + "module_id": "a9df3f54db5d4c0c84b6bf6804d41632", "name": "Lisa Badkamer", "sensors": { "battery": 71, diff --git a/fixtures/m_adam_heating/data.json b/fixtures/m_adam_heating/data.json index 7b997d288..78ef08cc8 100644 --- a/fixtures/m_adam_heating/data.json +++ b/fixtures/m_adam_heating/data.json @@ -21,6 +21,7 @@ "upper_bound": 95.0 }, "model": "Generic heater", + "module_id": "c043b48fa65b4292b5579d5550f19dd2", "name": "OpenTherm", "sensors": { "intended_boiler_temperature": 38.1, @@ -40,6 +41,7 @@ "location": "f2bf9048bef64cc5b6d5110154e33c81", "model": "Emma Pro", "model_id": "170-01", + "module_id": "85e363f2d0234f13885d41acd77ce6b8", "name": "Emma", "sensors": { "battery": 100, @@ -67,6 +69,7 @@ "location": "f871b8c4d63549319221e294e4f88074", "model": "Tom", "model_id": "106-03", + "module_id": "86937b43514d44e090903d72e53d01b3", "name": "Tom Badkamer", "sensors": { "battery": 60, @@ -89,6 +92,7 @@ "location": "f2bf9048bef64cc5b6d5110154e33c81", "model": "ThermoTouch", "model_id": "143.1", + "module_id": "f7727a516f974a7e8bf8ae95b4531a7a", "name": "Anna", "sensors": { "setpoint": 20.0, @@ -145,6 +149,7 @@ "location": "f2bf9048bef64cc5b6d5110154e33c81", "model": "Jip", "model_id": "168-01", + "module_id": "702e95f0db7246bf831bad9fec7a68ff", "name": "Jip", "sensors": { "battery": 100, @@ -166,6 +171,7 @@ "location": "f871b8c4d63549319221e294e4f88074", "model": "Lisa", "model_id": "158-01", + "module_id": "a9df3f54db5d4c0c84b6bf6804d41632", "name": "Lisa Badkamer", "sensors": { "battery": 71, diff --git a/fixtures/m_adam_jip/data.json b/fixtures/m_adam_jip/data.json index 160cec1aa..2e484105b 100644 --- a/fixtures/m_adam_jip/data.json +++ b/fixtures/m_adam_jip/data.json @@ -63,6 +63,7 @@ "location": "06aecb3d00354375924f50c47af36bd2", "model": "Lisa", "model_id": "158-01", + "module_id": "9a08c0d05ffd4f02be9a9bdeb3d01175", "name": "Slaapkamer", "sensors": { "battery": 92, @@ -86,6 +87,7 @@ "location": "d58fec52899f4f1c92e4f8fad6d8c48c", "model": "Tom", "model_id": "106-03", + "module_id": "e71d43382a894c9e888d379368aafba9", "name": "Tom Logeerkamer", "sensors": { "setpoint": 13.0, @@ -110,6 +112,7 @@ "location": "06aecb3d00354375924f50c47af36bd2", "model": "Tom", "model_id": "106-03", + "module_id": "ccc140dafdc5416dab052bffc465a770", "name": "Tom Slaapkamer", "sensors": { "setpoint": 13.0, @@ -132,6 +135,7 @@ "location": "9e4433a9d69f40b3aefd15e74395eaec", "model": "Aqara Smart Plug", "model_id": "lumi.plug.maeu01", + "module_id": "2ddb4057a8fd46aba92e23c770f3297d", "name": "Plug", "sensors": { "electricity_consumed_interval": 0.0 @@ -154,6 +158,7 @@ "location": "d27aede973b54be484f6842d1b2802ad", "model": "Lisa", "model_id": "158-01", + "module_id": "3f91eab3749349799b17f04873bde07e", "name": "Kinderkamer", "sensors": { "battery": 79, @@ -177,6 +182,7 @@ "location": "13228dab8ce04617af318a2888b3c548", "model": "Tom", "model_id": "106-03", + "module_id": "fc657e19ee7442ab8bfe66df62cb40b3", "name": "Tom Woonkamer", "sensors": { "setpoint": 9.0, @@ -204,6 +210,7 @@ "location": "d58fec52899f4f1c92e4f8fad6d8c48c", "model": "Lisa", "model_id": "158-01", + "module_id": "1814d63fb9824aa8aae4d4329d84dfa3", "name": "Logeerkamer", "sensors": { "battery": 80, @@ -277,6 +284,7 @@ "location": "d27aede973b54be484f6842d1b2802ad", "model": "Tom", "model_id": "106-03", + "module_id": "5785d8678bed443ea72b52a1c8a7108d", "name": "Tom Kinderkamer", "sensors": { "setpoint": 13.0, @@ -343,6 +351,7 @@ }, "model": "Generic heater", "model_id": "10.20", + "module_id": "2bd6e83f0ae340058606c33503202c72", "name": "OpenTherm", "sensors": { "intended_boiler_temperature": 0.0, @@ -367,6 +376,7 @@ "location": "13228dab8ce04617af318a2888b3c548", "model": "Jip", "model_id": "168-01", + "module_id": "73a5e7c19d3744ad96dfad74142d2db4", "name": "Woonkamer", "sensors": { "battery": 100, diff --git a/fixtures/m_adam_multiple_devices_per_zone/data.json b/fixtures/m_adam_multiple_devices_per_zone/data.json index 981c094ce..8fa13cc40 100644 --- a/fixtures/m_adam_multiple_devices_per_zone/data.json +++ b/fixtures/m_adam_multiple_devices_per_zone/data.json @@ -6,6 +6,7 @@ "location": "cd143c07248f491493cea0533bc3d669", "model": "Plug", "model_id": "160-01", + "module_id": "4e1da90f22384bc691fe0282e02d272f", "name": "NVR", "sensors": { "electricity_consumed": 34.0, @@ -96,6 +97,7 @@ "location": "cd143c07248f491493cea0533bc3d669", "model": "Plug", "model_id": "160-01", + "module_id": "a03128e5e9334b088c724fd96947c765", "name": "Playstation Smart Plug", "sensors": { "electricity_consumed": 84.1, @@ -142,6 +144,7 @@ "location": "cd143c07248f491493cea0533bc3d669", "model": "Plug", "model_id": "160-01", + "module_id": "822e635587994817a76599ea1190f9ee", "name": "USG Smart Plug", "sensors": { "electricity_consumed": 8.5, @@ -163,6 +166,7 @@ "location": "cd143c07248f491493cea0533bc3d669", "model": "Plug", "model_id": "160-01", + "module_id": "a5a8713dd3f94f2a9d63db8a521af6b2", "name": "Ziggo Modem", "sensors": { "electricity_consumed": 12.2, @@ -188,6 +192,7 @@ "location": "08963fec7c53423ca5680aa4cb502c63", "model": "Tom", "model_id": "106-03", + "module_id": "b622e3c6a32544f8a4d83e3385592e36", "name": "Thermostatic Radiator Badkamer 1", "sensors": { "battery": 51, @@ -216,6 +221,7 @@ "location": "82fa13f017d240daa0d0ea1775420f24", "model": "Lisa", "model_id": "158-01", + "module_id": "f887b0af3d1e45c794057ee606b21db8", "name": "Zone Thermostat Jessie", "sensors": { "battery": 37, @@ -238,6 +244,7 @@ "location": "c50f167537524366a5af7aa3942feb1e", "model": "Plug", "model_id": "160-01", + "module_id": "800d5287643c4fd89dfcfbf336d4f7ec", "name": "CV Pomp", "sensors": { "electricity_consumed": 35.6, @@ -304,6 +311,7 @@ "location": "cd143c07248f491493cea0533bc3d669", "model": "Plug", "model_id": "160-01", + "module_id": "5ccda7375b0f467e88499a636450dc91", "name": "Fibaro HC2", "sensors": { "electricity_consumed": 12.5, @@ -329,6 +337,7 @@ "location": "12493538af164a409c6a1c79e38afe1c", "model": "Tom", "model_id": "106-03", + "module_id": "39e077a2eb224dcea3415471de00823c", "name": "Bios Cv Thermostatic Radiator ", "sensors": { "battery": 62, @@ -354,6 +363,7 @@ "location": "c50f167537524366a5af7aa3942feb1e", "model": "Tom", "model_id": "106-03", + "module_id": "02d1299fdbab4f7b93765e0af1c250d8", "name": "Floor kraan", "sensors": { "setpoint": 21.5, @@ -381,6 +391,7 @@ "location": "c50f167537524366a5af7aa3942feb1e", "model": "Lisa", "model_id": "158-01", + "module_id": "dd68d0641eb04571be62b9940aae363a", "name": "Zone Lisa WK", "sensors": { "battery": 34, @@ -437,6 +448,7 @@ "location": "cd143c07248f491493cea0533bc3d669", "model": "Plug", "model_id": "160-01", + "module_id": "3e4e2fa7fa2a4cf18b1be5ed32a978a1", "name": "NAS", "sensors": { "electricity_consumed": 16.5, @@ -462,6 +474,7 @@ "location": "82fa13f017d240daa0d0ea1775420f24", "model": "Tom", "model_id": "106-03", + "module_id": "468bbe14853f4fb18a8860333cecc42a", "name": "Thermostatic Radiator Jessie", "sensors": { "battery": 62, @@ -490,6 +503,7 @@ "location": "12493538af164a409c6a1c79e38afe1c", "model": "Lisa", "model_id": "158-01", + "module_id": "e5f81fd832d844e5bd46219831468a62", "name": "Zone Lisa Bios", "sensors": { "battery": 67, @@ -530,6 +544,7 @@ "location": "446ac08dd04d4eff8ac57489757b7314", "model": "Tom", "model_id": "106-03", + "module_id": "d00e1ba75ed14b2388971b32abc94cde", "name": "CV Kraan Garage", "sensors": { "battery": 68, @@ -575,6 +590,7 @@ "location": "08963fec7c53423ca5680aa4cb502c63", "model": "Lisa", "model_id": "158-01", + "module_id": "ebd9f53ab3894bee91e36350c1fbb6c7", "name": "Thermostatic Radiator Badkamer 2", "sensors": { "battery": 92, diff --git a/fixtures/m_anna_heatpump_cooling/data.json b/fixtures/m_anna_heatpump_cooling/data.json index ccfd816ff..7cfd6a650 100644 --- a/fixtures/m_anna_heatpump_cooling/data.json +++ b/fixtures/m_anna_heatpump_cooling/data.json @@ -43,6 +43,7 @@ "upper_bound": 100.0 }, "model": "Generic heater/cooler", + "module_id": "1d1f157265a74d2886af70eeac1a2da2", "name": "OpenTherm", "sensors": { "dhw_temperature": 41.5, @@ -68,6 +69,7 @@ "hardware": "6539-1301-5002", "location": "c784ee9fdab44e1395b8dee7d7a497d5", "model": "ThermoTouch", + "module_id": "e3204a14c278431a8890525dd83edf9d", "name": "Anna", "preset_modes": ["no_frost", "home", "away", "asleep", "vacation"], "select_schedule": "standaard", diff --git a/fixtures/m_anna_heatpump_idle/data.json b/fixtures/m_anna_heatpump_idle/data.json index 5a1cdebd3..d460009de 100644 --- a/fixtures/m_anna_heatpump_idle/data.json +++ b/fixtures/m_anna_heatpump_idle/data.json @@ -43,6 +43,7 @@ "upper_bound": 100.0 }, "model": "Generic heater/cooler", + "module_id": "1d1f157265a74d2886af70eeac1a2da2", "name": "OpenTherm", "sensors": { "dhw_temperature": 46.3, @@ -68,6 +69,7 @@ "hardware": "6539-1301-5002", "location": "c784ee9fdab44e1395b8dee7d7a497d5", "model": "ThermoTouch", + "module_id": "e3204a14c278431a8890525dd83edf9d", "name": "Anna", "preset_modes": ["no_frost", "home", "away", "asleep", "vacation"], "select_schedule": "standaard", diff --git a/fixtures/p1v4_442_single/data.json b/fixtures/p1v4_442_single/data.json index 6dfcd7ee0..29effe959 100644 --- a/fixtures/p1v4_442_single/data.json +++ b/fixtures/p1v4_442_single/data.json @@ -19,6 +19,7 @@ "dev_class": "smartmeter", "location": "a455b61e52394b2db5081ce025a430f3", "model": "KFM5KAIFA-METER", + "module_id": "f2f7c257a0c8405f9a56582d3a22982d", "name": "P1", "sensors": { "electricity_consumed_off_peak_cumulative": 17643.423, diff --git a/fixtures/p1v4_442_triple/data.json b/fixtures/p1v4_442_triple/data.json index 943325d14..82ae72beb 100644 --- a/fixtures/p1v4_442_triple/data.json +++ b/fixtures/p1v4_442_triple/data.json @@ -23,6 +23,7 @@ "dev_class": "smartmeter", "location": "03e65b16e4b247a29ae0d75a78cb492e", "model": "XMX5LGF0010453051839", + "module_id": "560672c43a964ef29202bad5b8284985", "name": "P1", "sensors": { "electricity_consumed_off_peak_cumulative": 70537.898, diff --git a/tests/data/adam/adam_heatpump_cooling.json b/tests/data/adam/adam_heatpump_cooling.json index 60d15563c..ce4bcc63b 100644 --- a/tests/data/adam/adam_heatpump_cooling.json +++ b/tests/data/adam/adam_heatpump_cooling.json @@ -12,13 +12,7 @@ "dev_class": "climate", "model": "ThermoZone", "name": "Slaapkamer SJ", - "preset_modes": [ - "no_frost", - "vacation", - "away", - "home", - "asleep" - ], + "preset_modes": ["no_frost", "vacation", "away", "home", "asleep"], "select_schedule": "off", "select_zone_profile": "passive", "sensors": { @@ -33,17 +27,11 @@ "upper_bound": 99.9 }, "thermostats": { - "primary": [ - "d3a276aeb3114a509bab1e4bf8c40348" - ], + "primary": ["d3a276aeb3114a509bab1e4bf8c40348"], "secondary": [] }, "vendor": "Plugwise", - "zone_profiles": [ - "active", - "off", - "passive" - ] + "zone_profiles": ["active", "off", "passive"] }, "0ca13e8176204ca7bf6f09de59f81c83": { "available": true, @@ -147,13 +135,7 @@ "dev_class": "climate", "model": "ThermoZone", "name": "Slaapkamer DB", - "preset_modes": [ - "no_frost", - "vacation", - "away", - "home", - "asleep" - ], + "preset_modes": ["no_frost", "vacation", "away", "home", "asleep"], "select_schedule": "off", "select_zone_profile": "passive", "sensors": { @@ -168,17 +150,11 @@ "upper_bound": 99.9 }, "thermostats": { - "primary": [ - "47e2c550a33846b680725aa3fb229473" - ], + "primary": ["47e2c550a33846b680725aa3fb229473"], "secondary": [] }, "vendor": "Plugwise", - "zone_profiles": [ - "active", - "off", - "passive" - ] + "zone_profiles": ["active", "off", "passive"] }, "2e0fc4db2a6d4cbeb7cf786143543961": { "available": true, @@ -279,13 +255,7 @@ "dev_class": "climate", "model": "ThermoZone", "name": "Badkamer 2", - "preset_modes": [ - "no_frost", - "vacation", - "away", - "home", - "asleep" - ], + "preset_modes": ["no_frost", "vacation", "away", "home", "asleep"], "select_schedule": "Werkdag schema", "select_zone_profile": "passive", "sensors": { @@ -299,17 +269,11 @@ "upper_bound": 99.9 }, "thermostats": { - "primary": [ - "f04c985c11ad4848b8fcd710343f9dcf" - ], + "primary": ["f04c985c11ad4848b8fcd710343f9dcf"], "secondary": [] }, "vendor": "Plugwise", - "zone_profiles": [ - "active", - "off", - "passive" - ] + "zone_profiles": ["active", "off", "passive"] }, "5ead63c65e5f44e7870ba2bd680ceb9e": { "available": true, @@ -338,11 +302,7 @@ }, "dev_class": "gateway", "firmware": "3.2.8", - "gateway_modes": [ - "away", - "full", - "vacation" - ], + "gateway_modes": ["away", "full", "vacation"], "hardware": "AME Smile 2.0 board", "location": "eedadcb297564f1483faa509179aebed", "mac_address": "012345670001", @@ -443,13 +403,7 @@ "dev_class": "climate", "model": "ThermoZone", "name": "Badkamer 1", - "preset_modes": [ - "no_frost", - "vacation", - "away", - "home", - "asleep" - ], + "preset_modes": ["no_frost", "vacation", "away", "home", "asleep"], "select_schedule": "Werkdag schema", "select_zone_profile": "passive", "sensors": { @@ -464,17 +418,11 @@ "upper_bound": 99.9 }, "thermostats": { - "primary": [ - "eac5db95d97241f6b17790897847ccf5" - ], + "primary": ["eac5db95d97241f6b17790897847ccf5"], "secondary": [] }, "vendor": "Plugwise", - "zone_profiles": [ - "active", - "off", - "passive" - ] + "zone_profiles": ["active", "off", "passive"] }, "93ac3f7bf25342f58cbb77c4a99ac0b3": { "active_preset": "away", @@ -489,13 +437,7 @@ "dev_class": "climate", "model": "ThermoZone", "name": "Slaapkamer RB", - "preset_modes": [ - "no_frost", - "vacation", - "away", - "home", - "asleep" - ], + "preset_modes": ["no_frost", "vacation", "away", "home", "asleep"], "select_schedule": "off", "select_zone_profile": "passive", "sensors": { @@ -509,17 +451,11 @@ "upper_bound": 99.9 }, "thermostats": { - "primary": [ - "c4ed311d54e341f58b4cdd201d1fde7e" - ], + "primary": ["c4ed311d54e341f58b4cdd201d1fde7e"], "secondary": [] }, "vendor": "Plugwise", - "zone_profiles": [ - "active", - "off", - "passive" - ] + "zone_profiles": ["active", "off", "passive"] }, "96714ad90fc948bcbcb5021c4b9f5ae9": { "available": true, @@ -555,13 +491,7 @@ "dev_class": "climate", "model": "ThermoZone", "name": "Slaapkamer SQ", - "preset_modes": [ - "no_frost", - "vacation", - "away", - "home", - "asleep" - ], + "preset_modes": ["no_frost", "vacation", "away", "home", "asleep"], "select_schedule": "off", "select_zone_profile": "passive", "sensors": { @@ -576,17 +506,11 @@ "upper_bound": 99.9 }, "thermostats": { - "primary": [ - "beb32da072274e698146db8b022f3c36" - ], + "primary": ["beb32da072274e698146db8b022f3c36"], "secondary": [] }, "vendor": "Plugwise", - "zone_profiles": [ - "active", - "off", - "passive" - ] + "zone_profiles": ["active", "off", "passive"] }, "a03b6e8e76dd4646af1a77c31dd9370c": { "available": true, @@ -622,13 +546,7 @@ "dev_class": "climate", "model": "ThermoZone", "name": "Keuken", - "preset_modes": [ - "no_frost", - "vacation", - "away", - "home", - "asleep" - ], + "preset_modes": ["no_frost", "vacation", "away", "home", "asleep"], "select_schedule": "Werkdag schema", "select_zone_profile": "active", "sensors": { @@ -643,17 +561,11 @@ "upper_bound": 99.9 }, "thermostats": { - "primary": [ - "ea8372c0e3ad4622ad45a041d02425f5" - ], + "primary": ["ea8372c0e3ad4622ad45a041d02425f5"], "secondary": [] }, "vendor": "Plugwise", - "zone_profiles": [ - "active", - "off", - "passive" - ] + "zone_profiles": ["active", "off", "passive"] }, "b52908550469425b812c87f766fe5303": { "active_preset": "away", @@ -668,13 +580,7 @@ "dev_class": "climate", "model": "ThermoZone", "name": "Bijkeuken", - "preset_modes": [ - "no_frost", - "vacation", - "away", - "home", - "asleep" - ], + "preset_modes": ["no_frost", "vacation", "away", "home", "asleep"], "select_schedule": "off", "select_zone_profile": "active", "sensors": { @@ -689,17 +595,11 @@ "upper_bound": 99.9 }, "thermostats": { - "primary": [ - "1053c8bbf8be43c6921742b146a625f1" - ], + "primary": ["1053c8bbf8be43c6921742b146a625f1"], "secondary": [] }, "vendor": "Plugwise", - "zone_profiles": [ - "active", - "off", - "passive" - ] + "zone_profiles": ["active", "off", "passive"] }, "bbcffa48019f4b09b8368bbaf9559e68": { "available": true, @@ -817,13 +717,7 @@ "dev_class": "climate", "model": "ThermoZone", "name": "Slaapkamer JM", - "preset_modes": [ - "no_frost", - "vacation", - "away", - "home", - "asleep" - ], + "preset_modes": ["no_frost", "vacation", "away", "home", "asleep"], "select_schedule": "off", "select_zone_profile": "passive", "sensors": { @@ -838,17 +732,11 @@ "upper_bound": 99.9 }, "thermostats": { - "primary": [ - "7fda9f84f01342f8afe9ebbbbff30c0f" - ], + "primary": ["7fda9f84f01342f8afe9ebbbbff30c0f"], "secondary": [] }, "vendor": "Plugwise", - "zone_profiles": [ - "active", - "off", - "passive" - ] + "zone_profiles": ["active", "off", "passive"] }, "ea8372c0e3ad4622ad45a041d02425f5": { "available": true, @@ -936,13 +824,7 @@ "dev_class": "climate", "model": "ThermoZone", "name": "Woonkamer", - "preset_modes": [ - "no_frost", - "vacation", - "away", - "home", - "asleep" - ], + "preset_modes": ["no_frost", "vacation", "away", "home", "asleep"], "select_schedule": "Werkdag schema", "select_zone_profile": "active", "sensors": { @@ -957,16 +839,10 @@ "upper_bound": 35.0 }, "thermostats": { - "primary": [ - "ca79d23ae0094120b877558734cff85c" - ], + "primary": ["ca79d23ae0094120b877558734cff85c"], "secondary": [] }, "vendor": "Plugwise", - "zone_profiles": [ - "active", - "off", - "passive" - ] + "zone_profiles": ["active", "off", "passive"] } } diff --git a/tests/data/adam/adam_jip.json b/tests/data/adam/adam_jip.json index c13bd34c3..d680a2293 100644 --- a/tests/data/adam/adam_jip.json +++ b/tests/data/adam/adam_jip.json @@ -7,13 +7,7 @@ "dev_class": "climate", "model": "ThermoZone", "name": "Slaapkamer", - "preset_modes": [ - "home", - "asleep", - "away", - "vacation", - "no_frost" - ], + "preset_modes": ["home", "asleep", "away", "vacation", "no_frost"], "select_schedule": null, "select_zone_profile": "active", "sensors": { @@ -26,19 +20,11 @@ "upper_bound": 99.9 }, "thermostats": { - "primary": [ - "1346fbd8498d4dbcab7e18d51b771f3d" - ], - "secondary": [ - "356b65335e274d769c338223e7af9c33" - ] + "primary": ["1346fbd8498d4dbcab7e18d51b771f3d"], + "secondary": ["356b65335e274d769c338223e7af9c33"] }, "vendor": "Plugwise", - "zone_profiles": [ - "active", - "off", - "passive" - ] + "zone_profiles": ["active", "off", "passive"] }, "13228dab8ce04617af318a2888b3c548": { "active_preset": "home", @@ -48,13 +34,7 @@ "dev_class": "climate", "model": "ThermoZone", "name": "Woonkamer", - "preset_modes": [ - "home", - "asleep", - "away", - "vacation", - "no_frost" - ], + "preset_modes": ["home", "asleep", "away", "vacation", "no_frost"], "select_schedule": null, "select_zone_profile": "active", "sensors": { @@ -67,19 +47,11 @@ "upper_bound": 30.0 }, "thermostats": { - "primary": [ - "f61f1a2535f54f52ad006a3d18e459ca" - ], - "secondary": [ - "833de10f269c4deab58fb9df69901b4e" - ] + "primary": ["f61f1a2535f54f52ad006a3d18e459ca"], + "secondary": ["833de10f269c4deab58fb9df69901b4e"] }, "vendor": "Plugwise", - "zone_profiles": [ - "active", - "off", - "passive" - ] + "zone_profiles": ["active", "off", "passive"] }, "1346fbd8498d4dbcab7e18d51b771f3d": { "available": true, @@ -261,11 +233,7 @@ }, "dev_class": "gateway", "firmware": "3.2.8", - "gateway_modes": [ - "away", - "full", - "vacation" - ], + "gateway_modes": ["away", "full", "vacation"], "hardware": "AME Smile 2.0 board", "location": "9e4433a9d69f40b3aefd15e74395eaec", "mac_address": "012345670001", @@ -273,12 +241,7 @@ "model_id": "smile_open_therm", "name": "Adam", "notifications": {}, - "regulation_modes": [ - "heating", - "off", - "bleeding_cold", - "bleeding_hot" - ], + "regulation_modes": ["heating", "off", "bleeding_cold", "bleeding_hot"], "select_gateway_mode": "full", "select_regulation_mode": "heating", "sensors": { @@ -295,13 +258,7 @@ "dev_class": "climate", "model": "ThermoZone", "name": "Kinderkamer", - "preset_modes": [ - "home", - "asleep", - "away", - "vacation", - "no_frost" - ], + "preset_modes": ["home", "asleep", "away", "vacation", "no_frost"], "select_schedule": null, "select_zone_profile": "active", "sensors": { @@ -314,19 +271,11 @@ "upper_bound": 99.9 }, "thermostats": { - "primary": [ - "6f3e9d7084214c21b9dfa46f6eeb8700" - ], - "secondary": [ - "d4496250d0e942cfa7aea3476e9070d5" - ] + "primary": ["6f3e9d7084214c21b9dfa46f6eeb8700"], + "secondary": ["d4496250d0e942cfa7aea3476e9070d5"] }, "vendor": "Plugwise", - "zone_profiles": [ - "active", - "off", - "passive" - ] + "zone_profiles": ["active", "off", "passive"] }, "d4496250d0e942cfa7aea3476e9070d5": { "available": true, @@ -361,13 +310,7 @@ "dev_class": "climate", "model": "ThermoZone", "name": "Logeerkamer", - "preset_modes": [ - "home", - "asleep", - "away", - "vacation", - "no_frost" - ], + "preset_modes": ["home", "asleep", "away", "vacation", "no_frost"], "select_schedule": null, "select_zone_profile": "active", "sensors": { @@ -380,19 +323,11 @@ "upper_bound": 99.9 }, "thermostats": { - "primary": [ - "a6abc6a129ee499c88a4d420cc413b47" - ], - "secondary": [ - "1da4d325838e4ad8aac12177214505c9" - ] + "primary": ["a6abc6a129ee499c88a4d420cc413b47"], + "secondary": ["1da4d325838e4ad8aac12177214505c9"] }, "vendor": "Plugwise", - "zone_profiles": [ - "active", - "off", - "passive" - ] + "zone_profiles": ["active", "off", "passive"] }, "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 23c37dc63..6f4dab2ff 100644 --- a/tests/data/adam/adam_multiple_devices_per_zone.json +++ b/tests/data/adam/adam_multiple_devices_per_zone.json @@ -36,13 +36,7 @@ "dev_class": "climate", "model": "ThermoZone", "name": "Badkamer", - "preset_modes": [ - "home", - "asleep", - "away", - "vacation", - "no_frost" - ], + "preset_modes": ["home", "asleep", "away", "vacation", "no_frost"], "select_schedule": "Badkamer Schema", "sensors": { "temperature": 18.9 @@ -77,13 +71,7 @@ "dev_class": "climate", "model": "ThermoZone", "name": "Bios", - "preset_modes": [ - "home", - "asleep", - "away", - "vacation", - "no_frost" - ], + "preset_modes": ["home", "asleep", "away", "vacation", "no_frost"], "select_schedule": "off", "sensors": { "electricity_consumed": 0.0, @@ -97,12 +85,8 @@ "upper_bound": 100.0 }, "thermostats": { - "primary": [ - "df4a4a8169904cdb9c03d61a21f42140" - ], - "secondary": [ - "a2c3583e0a6349358998b760cea82d2a" - ] + "primary": ["df4a4a8169904cdb9c03d61a21f42140"], + "secondary": ["a2c3583e0a6349358998b760cea82d2a"] }, "vendor": "Plugwise" }, @@ -143,13 +127,7 @@ "dev_class": "climate", "model": "ThermoZone", "name": "Garage", - "preset_modes": [ - "home", - "asleep", - "away", - "vacation", - "no_frost" - ], + "preset_modes": ["home", "asleep", "away", "vacation", "no_frost"], "select_schedule": "off", "sensors": { "temperature": 15.6 @@ -161,9 +139,7 @@ "upper_bound": 100.0 }, "thermostats": { - "primary": [ - "e7693eb9582644e5b865dba8d4447cf1" - ], + "primary": ["e7693eb9582644e5b865dba8d4447cf1"], "secondary": [] }, "vendor": "Plugwise" @@ -304,13 +280,7 @@ "dev_class": "climate", "model": "ThermoZone", "name": "Jessie", - "preset_modes": [ - "home", - "asleep", - "away", - "vacation", - "no_frost" - ], + "preset_modes": ["home", "asleep", "away", "vacation", "no_frost"], "select_schedule": "CV Jessie", "sensors": { "temperature": 17.2 @@ -322,12 +292,8 @@ "upper_bound": 100.0 }, "thermostats": { - "primary": [ - "6a3bf693d05e48e0b460c815a4fdd09d" - ], - "secondary": [ - "d3da73bde12a47d5a6b8f9dad971f2ec" - ] + "primary": ["6a3bf693d05e48e0b460c815a4fdd09d"], + "secondary": ["d3da73bde12a47d5a6b8f9dad971f2ec"] }, "vendor": "Plugwise" }, @@ -463,13 +429,7 @@ "dev_class": "climate", "model": "ThermoZone", "name": "Woonkamer", - "preset_modes": [ - "home", - "asleep", - "away", - "vacation", - "no_frost" - ], + "preset_modes": ["home", "asleep", "away", "vacation", "no_frost"], "select_schedule": "GF7 Woonkamer", "sensors": { "electricity_consumed": 35.6, @@ -483,12 +443,8 @@ "upper_bound": 100.0 }, "thermostats": { - "primary": [ - "b59bcebaf94b499ea7d46e4a66fb62d8" - ], - "secondary": [ - "b310b72a0e354bfab43089919b9a88bf" - ] + "primary": ["b59bcebaf94b499ea7d46e4a66fb62d8"], + "secondary": ["b310b72a0e354bfab43089919b9a88bf"] }, "vendor": "Plugwise" }, diff --git a/tests/data/adam/adam_onoff_cooling_fake_firmware.json b/tests/data/adam/adam_onoff_cooling_fake_firmware.json index 77a452707..a2dcb5111 100644 --- a/tests/data/adam/adam_onoff_cooling_fake_firmware.json +++ b/tests/data/adam/adam_onoff_cooling_fake_firmware.json @@ -42,11 +42,7 @@ }, "dev_class": "gateway", "firmware": "3.2.8", - "gateway_modes": [ - "away", - "full", - "vacation" - ], + "gateway_modes": ["away", "full", "vacation"], "hardware": "AME Smile 2.0 board", "location": "eedadcb297564f1483faa509179aebed", "mac_address": "012345670001", @@ -95,13 +91,7 @@ "dev_class": "climate", "model": "ThermoZone", "name": "Woonkamer", - "preset_modes": [ - "no_frost", - "vacation", - "away", - "home", - "asleep" - ], + "preset_modes": ["no_frost", "vacation", "away", "home", "asleep"], "select_schedule": "Werkdag schema", "select_zone_profile": "active", "sensors": { @@ -116,16 +106,10 @@ "upper_bound": 35.0 }, "thermostats": { - "primary": [ - "ca79d23ae0094120b877558734cff85c" - ], + "primary": ["ca79d23ae0094120b877558734cff85c"], "secondary": [] }, "vendor": "Plugwise", - "zone_profiles": [ - "active", - "off", - "passive" - ] + "zone_profiles": ["active", "off", "passive"] } } diff --git a/tests/data/adam/adam_plus_anna.json b/tests/data/adam/adam_plus_anna.json index 00d4014dd..ccb46dfb2 100644 --- a/tests/data/adam/adam_plus_anna.json +++ b/tests/data/adam/adam_plus_anna.json @@ -1,22 +1,13 @@ { "009490cc2f674ce6b576863fbb64f867": { "active_preset": "home", - "available_schedules": [ - "Weekschema", - "off" - ], + "available_schedules": ["Weekschema", "off"], "climate_mode": "auto", "control_state": "idle", "dev_class": "climate", "model": "ThermoZone", "name": "Living room", - "preset_modes": [ - "home", - "asleep", - "away", - "vacation", - "no_frost" - ], + "preset_modes": ["home", "asleep", "away", "vacation", "no_frost"], "select_schedule": "Weekschema", "sensors": { "electricity_consumed": 74.2, @@ -30,9 +21,7 @@ "upper_bound": 35.0 }, "thermostats": { - "primary": [ - "ee62cad889f94e8ca3d09021f03a660b" - ], + "primary": ["ee62cad889f94e8ca3d09021f03a660b"], "secondary": [] }, "vendor": "Plugwise" diff --git a/tests/data/adam/adam_plus_anna_new.json b/tests/data/adam/adam_plus_anna_new.json index 37d51b261..eda4a7bbf 100644 --- a/tests/data/adam/adam_plus_anna_new.json +++ b/tests/data/adam/adam_plus_anna_new.json @@ -211,11 +211,7 @@ }, "dev_class": "gateway", "firmware": "3.9.0", - "gateway_modes": [ - "away", - "full", - "vacation" - ], + "gateway_modes": ["away", "full", "vacation"], "hardware": "AME Smile 2.0 board", "location": "bc93488efab249e5bc54fd7e175a6f91", "mac_address": "D40FB201CBA0", @@ -223,12 +219,7 @@ "model_id": "smile_open_therm", "name": "Adam", "notifications": {}, - "regulation_modes": [ - "bleeding_cold", - "heating", - "off", - "bleeding_hot" - ], + "regulation_modes": ["bleeding_cold", "heating", "off", "bleeding_hot"], "select_gateway_mode": "full", "select_regulation_mode": "heating", "sensors": { @@ -317,13 +308,7 @@ "dev_class": "climate", "model": "ThermoZone", "name": "Living room", - "preset_modes": [ - "vacation", - "no_frost", - "asleep", - "home", - "away" - ], + "preset_modes": ["vacation", "no_frost", "asleep", "home", "away"], "select_schedule": "Weekschema", "select_zone_profile": "active", "sensors": { @@ -346,11 +331,7 @@ "secondary": [] }, "vendor": "Plugwise", - "zone_profiles": [ - "active", - "off", - "passive" - ] + "zone_profiles": ["active", "off", "passive"] }, "f871b8c4d63549319221e294e4f88074": { "active_preset": "vacation", @@ -366,13 +347,7 @@ "dev_class": "climate", "model": "ThermoZone", "name": "Bathroom", - "preset_modes": [ - "vacation", - "no_frost", - "asleep", - "home", - "away" - ], + "preset_modes": ["vacation", "no_frost", "asleep", "home", "away"], "select_schedule": "off", "select_zone_profile": "passive", "sensors": { @@ -387,18 +362,10 @@ "upper_bound": 99.9 }, "thermostats": { - "primary": [ - "e2f4322d57924fa090fbbc48b3a140dc" - ], - "secondary": [ - "1772a4ea304041adb83f357b751341ff" - ] + "primary": ["e2f4322d57924fa090fbbc48b3a140dc"], + "secondary": ["1772a4ea304041adb83f357b751341ff"] }, "vendor": "Plugwise", - "zone_profiles": [ - "active", - "off", - "passive" - ] + "zone_profiles": ["active", "off", "passive"] } } diff --git a/tests/data/adam/adam_zone_per_device.json b/tests/data/adam/adam_zone_per_device.json index d6bdc441e..e1187ccda 100644 --- a/tests/data/adam/adam_zone_per_device.json +++ b/tests/data/adam/adam_zone_per_device.json @@ -36,13 +36,7 @@ "dev_class": "climate", "model": "ThermoZone", "name": "Badkamer", - "preset_modes": [ - "home", - "asleep", - "away", - "vacation", - "no_frost" - ], + "preset_modes": ["home", "asleep", "away", "vacation", "no_frost"], "select_schedule": "Badkamer Schema", "sensors": { "temperature": 18.8 @@ -54,12 +48,8 @@ "upper_bound": 100.0 }, "thermostats": { - "primary": [ - "f1fee6043d3642a9b0a65297455f008e" - ], - "secondary": [ - "680423ff840043738f42cc7f1ff97a36" - ] + "primary": ["f1fee6043d3642a9b0a65297455f008e"], + "secondary": ["680423ff840043738f42cc7f1ff97a36"] }, "vendor": "Plugwise" }, @@ -78,13 +68,7 @@ "dev_class": "climate", "model": "ThermoZone", "name": "Bios", - "preset_modes": [ - "home", - "asleep", - "away", - "vacation", - "no_frost" - ], + "preset_modes": ["home", "asleep", "away", "vacation", "no_frost"], "select_schedule": "off", "sensors": { "electricity_consumed": 0.0, @@ -98,12 +82,8 @@ "upper_bound": 100.0 }, "thermostats": { - "primary": [ - "df4a4a8169904cdb9c03d61a21f42140" - ], - "secondary": [ - "a2c3583e0a6349358998b760cea82d2a" - ] + "primary": ["df4a4a8169904cdb9c03d61a21f42140"], + "secondary": ["a2c3583e0a6349358998b760cea82d2a"] }, "vendor": "Plugwise" }, @@ -144,13 +124,7 @@ "dev_class": "climate", "model": "ThermoZone", "name": "Garage", - "preset_modes": [ - "home", - "asleep", - "away", - "vacation", - "no_frost" - ], + "preset_modes": ["home", "asleep", "away", "vacation", "no_frost"], "select_schedule": "off", "sensors": { "temperature": 15.6 @@ -162,9 +136,7 @@ "upper_bound": 100.0 }, "thermostats": { - "primary": [ - "e7693eb9582644e5b865dba8d4447cf1" - ], + "primary": ["e7693eb9582644e5b865dba8d4447cf1"], "secondary": [] }, "vendor": "Plugwise" @@ -305,13 +277,7 @@ "dev_class": "climate", "model": "ThermoZone", "name": "Jessie", - "preset_modes": [ - "home", - "asleep", - "away", - "vacation", - "no_frost" - ], + "preset_modes": ["home", "asleep", "away", "vacation", "no_frost"], "select_schedule": "CV Jessie", "sensors": { "temperature": 17.1 @@ -323,12 +289,8 @@ "upper_bound": 100.0 }, "thermostats": { - "primary": [ - "6a3bf693d05e48e0b460c815a4fdd09d" - ], - "secondary": [ - "d3da73bde12a47d5a6b8f9dad971f2ec" - ] + "primary": ["6a3bf693d05e48e0b460c815a4fdd09d"], + "secondary": ["d3da73bde12a47d5a6b8f9dad971f2ec"] }, "vendor": "Plugwise" }, @@ -464,13 +426,7 @@ "dev_class": "climate", "model": "ThermoZone", "name": "Woonkamer", - "preset_modes": [ - "home", - "asleep", - "away", - "vacation", - "no_frost" - ], + "preset_modes": ["home", "asleep", "away", "vacation", "no_frost"], "select_schedule": "GF7 Woonkamer", "sensors": { "electricity_consumed": 35.8, @@ -484,12 +440,8 @@ "upper_bound": 100.0 }, "thermostats": { - "primary": [ - "b59bcebaf94b499ea7d46e4a66fb62d8" - ], - "secondary": [ - "b310b72a0e354bfab43089919b9a88bf" - ] + "primary": ["b59bcebaf94b499ea7d46e4a66fb62d8"], + "secondary": ["b310b72a0e354bfab43089919b9a88bf"] }, "vendor": "Plugwise" }, diff --git a/tests/data/anna/anna_v4.json b/tests/data/anna/anna_v4.json index 563bd837e..ed80590c4 100644 --- a/tests/data/anna/anna_v4.json +++ b/tests/data/anna/anna_v4.json @@ -1,11 +1,7 @@ { "01b85360fdd243d0aaad4d6ac2a5ba7e": { "active_preset": "home", - "available_schedules": [ - "Standaard", - "Thuiswerken", - "off" - ], + "available_schedules": ["Standaard", "Thuiswerken", "off"], "climate_mode": "heat", "control_state": "heating", "dev_class": "thermostat", @@ -15,13 +11,7 @@ "model": "ThermoTouch", "module_id": "807a45cbc950419c98ce4624bc27ff09", "name": "Anna", - "preset_modes": [ - "vacation", - "no_frost", - "away", - "asleep", - "home" - ], + "preset_modes": ["vacation", "no_frost", "away", "asleep", "home"], "select_schedule": "off", "sensors": { "illuminance": 60.0, From 6d75e669d9cf6ca794d8ebcb5d70224ee00710fe Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Sat, 20 Dec 2025 19:54:31 +0100 Subject: [PATCH 50/99] Adapt _get_zigbee_availability() after rebase --- plugwise/data.py | 2 +- plugwise/helper.py | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/plugwise/data.py b/plugwise/data.py index 12f10a510..fdd647e77 100644 --- a/plugwise/data.py +++ b/plugwise/data.py @@ -196,7 +196,7 @@ def _get_entity_data(self, entity_id: str, entity: GwEntityData) -> None: entity, "heater_central", "no OpenTherm communication" ) # Zigbee node availability - self._get_zigbee_availability(data, entity) + self._get_zigbee_availability(entity) # Switching groups data self._entity_switching_group(entity) diff --git a/plugwise/helper.py b/plugwise/helper.py index 4673a1003..2c5a66697 100644 --- a/plugwise/helper.py +++ b/plugwise/helper.py @@ -448,15 +448,13 @@ def _get_measurement_data(self, entity_id: str, entity: GwEntityData) -> None: entity.update(data) - def _get_zigbee_availability( - self, data: GwEntityData, entity: GwEntityData - ) -> None: + def _get_zigbee_availability(self, entity: GwEntityData) -> None: # Check zigbee device availability if "module_id" in entity: module_id = entity["module_id"] locator = f'./module[@id="{module_id}"]/protocols/zig_bee_node' if (module := self._domain_objects.find(locator)) is not None: - data["available"] = module.find("reachable").text == "true" + entity["available"] = module.find("reachable").text == "true" def _collect_group_sensors( self, From 08a743e7b0db1adca06c00f00955c15df44ea455 Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Mon, 22 Dec 2025 16:05:35 +0100 Subject: [PATCH 51/99] Clean up after rebase --- plugwise/helper.py | 7 ------- 1 file changed, 7 deletions(-) diff --git a/plugwise/helper.py b/plugwise/helper.py index 2c5a66697..433724da8 100644 --- a/plugwise/helper.py +++ b/plugwise/helper.py @@ -157,13 +157,6 @@ def _get_appliances(self) -> bool: extend_plug_device_class(appl, appliance) - # Extend device_class name of Plugs (Plugwise and Aqara) - Pw-Beta Issue #739 - description = appliance.find("description").text - if description is not None and ( - "ZigBee protocol" in description or "smart plug" in description - ): - appl.pwclass = f"{appl.pwclass}_plug" - # Collect appliance info, skip orphaned/removed devices if not (appl := self._appliance_info_finder(appl, appliance)): continue From e73213c75ef5b3e40262a90432eb48f61e4452d6 Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Mon, 22 Dec 2025 16:15:51 +0100 Subject: [PATCH 52/99] Fixes rebase issues --- plugwise/helper.py | 10 +++++----- plugwise/smile.py | 1 + 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/plugwise/helper.py b/plugwise/helper.py index 433724da8..9e3542489 100644 --- a/plugwise/helper.py +++ b/plugwise/helper.py @@ -264,11 +264,6 @@ def _get_locations(self) -> None: f"./location[@id='{loc.loc_id}']" ) - if counter == 0: - raise KeyError( - "Error, location Home (building) not found!" - ) # pragma: no cover - removed = list(set(self._existing_locations) - set(self._new_locations)) if self._existing_locations and removed: for location_id in removed: @@ -277,6 +272,11 @@ def _get_locations(self) -> None: self._existing_locations = self._new_locations self._new_locations = [] + if counter == 0: + raise KeyError( + "Error, location Home (building) not found!" + ) # pragma: no cover + def _appliance_info_finder(self, appl: Munch, appliance: etree.Element) -> Munch: """Collect info for all appliances found.""" match appl.pwclass: diff --git a/plugwise/smile.py b/plugwise/smile.py index 9704643f5..2846e4c75 100644 --- a/plugwise/smile.py +++ b/plugwise/smile.py @@ -114,6 +114,7 @@ def get_all_gateway_entities(self) -> None: self._get_appliances_with_offset_functionality() ) + self._scan_thermostats() self._get_groups() self._all_entity_data() From b59b0e2f69b0b456374a4d8c96a1fe6198a849a3 Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Mon, 22 Dec 2025 16:39:12 +0100 Subject: [PATCH 53/99] Handle group name change, improve guarding --- plugwise/common.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/plugwise/common.py b/plugwise/common.py index 80027d560..bc1728532 100644 --- a/plugwise/common.py +++ b/plugwise/common.py @@ -205,16 +205,23 @@ def _get_groups(self) -> None: for group in self._domain_objects.findall("./group"): members: list[str] = [] group_id = group.get("id") + group_name = group.find("name").text + if group_id is None: + continue # pragma: no cover + self._new_groups.append(group_id) - if group_id in self._existing_groups: + if ( + group_id in self._existing_groups + and self.gw_entities[group_id]["name"] == group_name + ): continue - group_name = group.find("name").text + group_type = group.find("type").text group_appliances = group.findall("appliances/appliance") for item in group_appliances: self._add_member(item, members) - if group_type in GROUP_TYPES and members and group_id: + if group_type in GROUP_TYPES and members: self.gw_entities[group_id] = { "dev_class": group_type, "model": "Group", From 2744e86675b190b388e31c5dc7f54d2343a46f8c Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Mon, 22 Dec 2025 16:44:46 +0100 Subject: [PATCH 54/99] More fixing after rebase --- plugwise/common.py | 2 +- plugwise/helper.py | 15 ++++++++------- plugwise/legacy/helper.py | 1 + 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/plugwise/common.py b/plugwise/common.py index bc1728532..b7842e1b2 100644 --- a/plugwise/common.py +++ b/plugwise/common.py @@ -215,7 +215,7 @@ def _get_groups(self) -> None: and self.gw_entities[group_id]["name"] == group_name ): continue - + group_type = group.find("type").text group_appliances = group.findall("appliances/appliance") for item in group_appliances: diff --git a/plugwise/helper.py b/plugwise/helper.py index 9e3542489..02777e81f 100644 --- a/plugwise/helper.py +++ b/plugwise/helper.py @@ -243,6 +243,14 @@ def _get_locations(self) -> None: loc.loc_id = location.get("id") loc.name = location.find("name").text loc._type = location.find("type").text + # Home location is of type building + if loc._type == "building": + counter += 1 + self._home_loc_id = loc.loc_id + self._home_location = self._domain_objects.find( + f"./location[@id='{loc.loc_id}']" + ) + self._new_locations.append(loc.loc_id) if ( loc.loc_id in self._existing_locations @@ -256,13 +264,6 @@ def _get_locations(self) -> None: "primary_prio": 0, "secondary": [], } - # Home location is of type building - if loc._type == "building": - counter += 1 - self._home_loc_id = loc.loc_id - self._home_location = self._domain_objects.find( - f"./location[@id='{loc.loc_id}']" - ) removed = list(set(self._existing_locations) - set(self._new_locations)) if self._existing_locations and removed: diff --git a/plugwise/legacy/helper.py b/plugwise/legacy/helper.py index 646611213..5e4bc8641 100644 --- a/plugwise/legacy/helper.py +++ b/plugwise/legacy/helper.py @@ -108,6 +108,7 @@ def _get_appliances(self) -> None: appl.mac = None appl.model = appl.pwclass.replace("_", " ").title() appl.model_id = None + appl.module_id = None appl.name = appliance.find("name").text appl.vendor_name = None appl.zigbee_mac = None From 0e89fd80c18f01dc33e7aaf4c918d74d6937abc1 Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Mon, 22 Dec 2025 16:58:37 +0100 Subject: [PATCH 55/99] Finish zone logic --- plugwise/helper.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/plugwise/helper.py b/plugwise/helper.py index 02777e81f..fd2a4141a 100644 --- a/plugwise/helper.py +++ b/plugwise/helper.py @@ -694,7 +694,6 @@ def _get_gateway_outdoor_temp(self, entity_id: str, data: GwEntityData) -> None: locator = "./logs/point_log[type='outdoor_temperature']/period/measurement" if (found := self._home_location.find(locator)) is not None: value = format_measure(found.text, NONE) - LOGGER.debug("HOI outdoor_temp = %s", value) data.update({"sensors": {"outdoor_temperature": value}}) self._count += 1 @@ -828,6 +827,12 @@ def _scan_thermostats(self) -> None: for location_id, location in self._loc_data.items(): if location["primary_prio"] != 0: self._new_zones.append(location_id) + if ( + location_id in self._existing_zones + and self.gw_entities[location_id]["name"] == location["name"] + ): + continue + self._zones[location_id] = { "dev_class": "climate", "model": "ThermoZone", From c85cfb344c46ec334b1e3e5c826d118e0caf3e86 Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Mon, 22 Dec 2025 17:03:37 +0100 Subject: [PATCH 56/99] Add comments --- plugwise/helper.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugwise/helper.py b/plugwise/helper.py index fd2a4141a..29d133aed 100644 --- a/plugwise/helper.py +++ b/plugwise/helper.py @@ -201,9 +201,11 @@ def _add_p1_smartmeter_info(self) -> None: if not module_data["contents"]: # pragma: no cover return + # Detect a smartmeter change module_id = module_data["module_id"] if module_id in ( self.gw_entities[self._gateway_id].get("module_id"), + # legacy self.gw_entities.get(self._home_loc_id, {}).get("module_id"), ): return From 80e0fdc8c1754b2899ad180041d5287c76c935aa Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Tue, 23 Dec 2025 13:22:38 +0100 Subject: [PATCH 57/99] Improve _get_appliances() return logic --- plugwise/helper.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/plugwise/helper.py b/plugwise/helper.py index 29d133aed..c7dd53af9 100644 --- a/plugwise/helper.py +++ b/plugwise/helper.py @@ -178,14 +178,18 @@ def _get_appliances(self) -> bool: self._reorder_devices() removed = list(set(self._existing_appliances) - set(self._new_appliances)) + new = list(set(self._new_appliances) - set(self._existing_appliances)) if self._existing_appliances: for appliance in removed: self.gw_entities.pop(appliance) - return False self._existing_appliances = self._new_appliances self._new_appliances = [] - return True + + if new: + return True + + return False def _add_p1_smartmeter_info(self) -> None: """For P1 collect the smartmeter info from the Home/building location and add it as an entity. From 0e6c9d6d883d4f21373711de610b409e10282c74 Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Tue, 23 Dec 2025 13:53:51 +0100 Subject: [PATCH 58/99] Set to v1.12.0a1 for testing --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index dcc8697cd..3d26bc7e2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "plugwise" -version = "1.11.2" +version = "1.12.0a1" license = "MIT" description = "Plugwise Smile (Adam/Anna/P1) and Stretch module for Python 3." readme = "README.md" From b77f6681086fc5f86c33f11431e501be4a3ebc1c Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Tue, 23 Dec 2025 20:40:20 +0100 Subject: [PATCH 59/99] Try --- plugwise/helper.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/plugwise/helper.py b/plugwise/helper.py index c7dd53af9..a41c5a1c1 100644 --- a/plugwise/helper.py +++ b/plugwise/helper.py @@ -157,10 +157,6 @@ def _get_appliances(self) -> bool: extend_plug_device_class(appl, appliance) - # Collect appliance info, skip orphaned/removed devices - if not (appl := self._appliance_info_finder(appl, appliance)): - continue - self._new_appliances.append(appl.entity_id) if ( appl.entity_id in self._existing_appliances @@ -168,6 +164,11 @@ def _get_appliances(self) -> bool: ): continue + # Collect appliance info, skip orphaned/removed devices + if not (appl := self._appliance_info_finder(appl, appliance)): + self._new_appliances.pop() + continue + self._create_gw_entities(appl) # A smartmeter is not present as an appliance, add it specifically From 98cd67791c2305f3ebf2d2ed958da0906043a8c8 Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Thu, 25 Dec 2025 10:02:55 +0100 Subject: [PATCH 60/99] Correct entity-assert --- tests/test_anna.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_anna.py b/tests/test_anna.py index c67c3e66f..0058132e6 100644 --- a/tests/test_anna.py +++ b/tests/test_anna.py @@ -216,7 +216,7 @@ async def test_connect_anna_heatpump_heating(self): await self.device_test( api, "2020-04-13 00:00:01", testdata_updated, initialize=False ) - assert self.entity_items == 45 + assert self.entity_items == 68 await api.close_connection() await self.disconnect(server, client) From 1acf96793d5cd603ac8eaa71536f294f5e357f87 Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Thu, 25 Dec 2025 10:12:24 +0100 Subject: [PATCH 61/99] Add entity-assert test for updating --- tests/test_adam.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/test_adam.py b/tests/test_adam.py index c860accc5..b71945dd4 100644 --- a/tests/test_adam.py +++ b/tests/test_adam.py @@ -154,6 +154,7 @@ async def test_connect_adam_plus_anna_new(self): await self.device_test( api, "2022-01-16 00:00:01", testdata_updated, initialize=False ) + assert self.entity_items == 241 # Simulate receiving no xml-data after a requesting a reboot of the gateway self.smile_setup = "reboot/adam_plus_anna_new" From b1fca7db2fd16f0cc08fef6466575eef55b2bd0b Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Thu, 25 Dec 2025 10:50:45 +0100 Subject: [PATCH 62/99] Guard for appliances with changed names --- plugwise/helper.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugwise/helper.py b/plugwise/helper.py index a41c5a1c1..6c7124613 100644 --- a/plugwise/helper.py +++ b/plugwise/helper.py @@ -160,7 +160,10 @@ def _get_appliances(self) -> bool: self._new_appliances.append(appl.entity_id) if ( appl.entity_id in self._existing_appliances - and self.gw_entities[appl.entity_id]["name"] == appl.name + and ( + appl.name in ("Gateway", "Central heating boiler") + or self.gw_entities[appl.entity_id]["name"] == appl.name + ) ): continue From 458be5346415de719961d7d6313fe3d48253a76c Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Thu, 25 Dec 2025 10:54:59 +0100 Subject: [PATCH 63/99] Correct updated entity-items assert --- 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 b71945dd4..acbc40ad2 100644 --- a/tests/test_adam.py +++ b/tests/test_adam.py @@ -154,7 +154,7 @@ async def test_connect_adam_plus_anna_new(self): await self.device_test( api, "2022-01-16 00:00:01", testdata_updated, initialize=False ) - assert self.entity_items == 241 + assert self.entity_items == 109 # Simulate receiving no xml-data after a requesting a reboot of the gateway self.smile_setup = "reboot/adam_plus_anna_new" From e9b88391e9529c85304b1af626eb52571ea1504d Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Thu, 25 Dec 2025 11:02:51 +0100 Subject: [PATCH 64/99] Fix logic, don't base on names --- plugwise/helper.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugwise/helper.py b/plugwise/helper.py index 6c7124613..ce2fe9e51 100644 --- a/plugwise/helper.py +++ b/plugwise/helper.py @@ -161,7 +161,7 @@ def _get_appliances(self) -> bool: if ( appl.entity_id in self._existing_appliances and ( - appl.name in ("Gateway", "Central heating boiler") + appl.pwclass in ("gateway", "heater_central") or self.gw_entities[appl.entity_id]["name"] == appl.name ) ): From 300eb96d9facaf5feafff8fc45ecdb95d17fd0bc Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Thu, 25 Dec 2025 11:06:18 +0100 Subject: [PATCH 65/99] Correct 2nd updated entity-assert --- tests/test_anna.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_anna.py b/tests/test_anna.py index 0058132e6..c67c3e66f 100644 --- a/tests/test_anna.py +++ b/tests/test_anna.py @@ -216,7 +216,7 @@ async def test_connect_anna_heatpump_heating(self): await self.device_test( api, "2020-04-13 00:00:01", testdata_updated, initialize=False ) - assert self.entity_items == 68 + assert self.entity_items == 45 await api.close_connection() await self.disconnect(server, client) From c57fac68926402190e05afed0e32048f2fa44cf4 Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Thu, 25 Dec 2025 11:07:34 +0100 Subject: [PATCH 66/99] Ruffed --- plugwise/helper.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/plugwise/helper.py b/plugwise/helper.py index ce2fe9e51..9f5e3a845 100644 --- a/plugwise/helper.py +++ b/plugwise/helper.py @@ -158,12 +158,9 @@ def _get_appliances(self) -> bool: extend_plug_device_class(appl, appliance) self._new_appliances.append(appl.entity_id) - if ( - appl.entity_id in self._existing_appliances - and ( - appl.pwclass in ("gateway", "heater_central") - or self.gw_entities[appl.entity_id]["name"] == appl.name - ) + if appl.entity_id in self._existing_appliances and ( + appl.pwclass in ("gateway", "heater_central") + or self.gw_entities[appl.entity_id]["name"] == appl.name ): continue From a02c9e1560f6b07b0e82b4cfa81b393705e91e63 Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Thu, 25 Dec 2025 11:10:17 +0100 Subject: [PATCH 67/99] Clean up --- plugwise/__init__.py | 1 - 1 file changed, 1 deletion(-) diff --git a/plugwise/__init__.py b/plugwise/__init__.py index a5614c644..bf4f3b04b 100644 --- a/plugwise/__init__.py +++ b/plugwise/__init__.py @@ -334,7 +334,6 @@ async def async_update(self) -> dict[str, GwEntityData]: except (DataMissingError, KeyError) as err: raise PlugwiseError("No Plugwise data received") from err - LOGGER.debug("HOI data: %s", data) return data ######################################################################################################## From 2381ca3929d1e1c2cbed72860f73c72547d2835a Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Thu, 25 Dec 2025 11:42:31 +0100 Subject: [PATCH 68/99] Improve _add_or_update_notifications() --- plugwise/data.py | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/plugwise/data.py b/plugwise/data.py index fdd647e77..c14b116d2 100644 --- a/plugwise/data.py +++ b/plugwise/data.py @@ -107,16 +107,17 @@ def _add_or_update_notifications( self, entity_id: str, entity: GwEntityData ) -> None: """Helper-function adding or updating the Plugwise notifications.""" - if ( - entity_id == self._gateway_id - and (self._is_thermostat or self.smile.type == "power") - ) or ( - "binary_sensors" in entity - and "plugwise_notification" in entity["binary_sensors"] - ): - entity["binary_sensors"]["plugwise_notification"] = bool( - self._notifications - ) + + if entity_id != self._gateway_id: + return + + if (self._is_thermostat or self.smile.type == "power") and "binary_sensors" not in entity: + entity.update({"binary_sensors": {"plugwise_notification": bool(self._notifications)}}) + entity.update({"notifications": self._notifications}) + self._count += 2 + + if "plugwise_notification" in entity["binary_sensors"]: + entity["binary_sensors"]["plugwise_notification"] = bool(self._notifications) entity["notifications"] = self._notifications self._count += 2 From 3de57467f25d94e5d2a5072857d2f22867965679 Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Thu, 25 Dec 2025 12:05:13 +0100 Subject: [PATCH 69/99] Improve logic --- plugwise/data.py | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/plugwise/data.py b/plugwise/data.py index c14b116d2..ca46a390c 100644 --- a/plugwise/data.py +++ b/plugwise/data.py @@ -111,15 +111,16 @@ def _add_or_update_notifications( if entity_id != self._gateway_id: return - if (self._is_thermostat or self.smile.type == "power") and "binary_sensors" not in entity: - entity.update({"binary_sensors": {"plugwise_notification": bool(self._notifications)}}) - entity.update({"notifications": self._notifications}) - self._count += 2 - - if "plugwise_notification" in entity["binary_sensors"]: - entity["binary_sensors"]["plugwise_notification"] = bool(self._notifications) - entity["notifications"] = self._notifications - self._count += 2 + if self._is_thermostat or self.smile.type == "power": + if "plugwise_notification" not in entity: + entity["binary_sensors"].update({"plugwise_notification": bool(self._notifications)}) + entity.update({"notifications": self._notifications}) + self._count += 2 + + else: + entity["binary_sensors"]["plugwise_notification"] = bool(self._notifications) + entity["notifications"] = self._notifications + self._count += 2 def _update_for_cooling(self, entity: GwEntityData) -> None: """Helper-function for adding/updating various cooling-related values.""" From 83251369819e8b3de4e2191ad6d05743a1209bbe Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Thu, 25 Dec 2025 12:28:56 +0100 Subject: [PATCH 70/99] Bump to a2 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 3d26bc7e2..0d2f33cda 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "plugwise" -version = "1.12.0a1" +version = "1.12.0a2" license = "MIT" description = "Plugwise Smile (Adam/Anna/P1) and Stretch module for Python 3." readme = "README.md" From d18e59842d2c043f648d5c8f5163030895bb2e85 Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Thu, 25 Dec 2025 12:36:30 +0100 Subject: [PATCH 71/99] _get_appliances(): return also True for removed appliances --- plugwise/helper.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugwise/helper.py b/plugwise/helper.py index 9f5e3a845..ace2be421 100644 --- a/plugwise/helper.py +++ b/plugwise/helper.py @@ -178,8 +178,8 @@ def _get_appliances(self) -> bool: # Sort the gw_entities self._reorder_devices() - removed = list(set(self._existing_appliances) - set(self._new_appliances)) new = list(set(self._new_appliances) - set(self._existing_appliances)) + removed = list(set(self._existing_appliances) - set(self._new_appliances)) if self._existing_appliances: for appliance in removed: self.gw_entities.pop(appliance) @@ -187,7 +187,7 @@ def _get_appliances(self) -> bool: self._existing_appliances = self._new_appliances self._new_appliances = [] - if new: + if new or removed: return True return False From 37bde6a2f8112cc2d9206e312d35e53d2c7c99f9 Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Thu, 25 Dec 2025 12:41:58 +0100 Subject: [PATCH 72/99] Implement _get_groups() enhancement as suggested --- plugwise/common.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plugwise/common.py b/plugwise/common.py index b7842e1b2..ea096b2da 100644 --- a/plugwise/common.py +++ b/plugwise/common.py @@ -230,6 +230,9 @@ def _get_groups(self) -> None: "vendor": "Plugwise", } self._count += 5 + elif group_id in self._existing_groups: + # Group existed but now has no valid members -> remove + self._new_groups.remove(group_id) removed = list(set(self._existing_groups) - set(self._new_groups)) if self._existing_groups and removed: From 0d78208c902b8a19476696b2e5857fca92b41533 Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Thu, 25 Dec 2025 12:44:01 +0100 Subject: [PATCH 73/99] Implement pop-suggestion --- plugwise/helper.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugwise/helper.py b/plugwise/helper.py index ace2be421..7572b92f9 100644 --- a/plugwise/helper.py +++ b/plugwise/helper.py @@ -855,7 +855,7 @@ def _scan_thermostats(self) -> None: removed = list(set(self._existing_zones) - set(self._new_zones)) if self._existing_zones and removed: for location_id in removed: - self._zones.pop(location_id) + self._zones.pop(location_id, None) self._existing_zones = self._new_zones self._new_zones = [] From ffe8711df181dcabe8d5452b0889de313b752bfd Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Thu, 25 Dec 2025 13:09:34 +0100 Subject: [PATCH 74/99] Ruffed, bump to a3 --- plugwise/data.py | 8 ++++++-- pyproject.toml | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/plugwise/data.py b/plugwise/data.py index ca46a390c..c3d3340a1 100644 --- a/plugwise/data.py +++ b/plugwise/data.py @@ -113,12 +113,16 @@ def _add_or_update_notifications( if self._is_thermostat or self.smile.type == "power": if "plugwise_notification" not in entity: - entity["binary_sensors"].update({"plugwise_notification": bool(self._notifications)}) + entity["binary_sensors"].update( + {"plugwise_notification": bool(self._notifications)} + ) entity.update({"notifications": self._notifications}) self._count += 2 else: - entity["binary_sensors"]["plugwise_notification"] = bool(self._notifications) + entity["binary_sensors"]["plugwise_notification"] = bool( + self._notifications + ) entity["notifications"] = self._notifications self._count += 2 diff --git a/pyproject.toml b/pyproject.toml index 0d2f33cda..e1bf5a8ef 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "plugwise" -version = "1.12.0a2" +version = "1.12.0a3" license = "MIT" description = "Plugwise Smile (Adam/Anna/P1) and Stretch module for Python 3." readme = "README.md" From ff14162acbeaae6bc46289ce92e81a925518293c Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Thu, 25 Dec 2025 13:26:42 +0100 Subject: [PATCH 75/99] Don't double-count notification-related --- plugwise/data.py | 1 - 1 file changed, 1 deletion(-) diff --git a/plugwise/data.py b/plugwise/data.py index c3d3340a1..588489b5c 100644 --- a/plugwise/data.py +++ b/plugwise/data.py @@ -124,7 +124,6 @@ def _add_or_update_notifications( self._notifications ) entity["notifications"] = self._notifications - self._count += 2 def _update_for_cooling(self, entity: GwEntityData) -> None: """Helper-function for adding/updating various cooling-related values.""" From 6d536709c4c48d2cd9841d0df9190e021ea00f70 Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Thu, 25 Dec 2025 13:31:44 +0100 Subject: [PATCH 76/99] Rename to _update_zigbee_availability(), add docstring --- plugwise/data.py | 2 +- plugwise/helper.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/plugwise/data.py b/plugwise/data.py index 588489b5c..bfe1d7926 100644 --- a/plugwise/data.py +++ b/plugwise/data.py @@ -201,7 +201,7 @@ def _get_entity_data(self, entity_id: str, entity: GwEntityData) -> None: entity, "heater_central", "no OpenTherm communication" ) # Zigbee node availability - self._get_zigbee_availability(entity) + self._update_zigbee_availability(entity) # Switching groups data self._entity_switching_group(entity) diff --git a/plugwise/helper.py b/plugwise/helper.py index 7572b92f9..c0fc9fdbe 100644 --- a/plugwise/helper.py +++ b/plugwise/helper.py @@ -449,8 +449,8 @@ def _get_measurement_data(self, entity_id: str, entity: GwEntityData) -> None: entity.update(data) - def _get_zigbee_availability(self, entity: GwEntityData) -> None: - # Check zigbee device availability + def _update_zigbee_availability(self, entity: GwEntityData) -> None: + """Update zigbee device availability status.""" if "module_id" in entity: module_id = entity["module_id"] locator = f'./module[@id="{module_id}"]/protocols/zig_bee_node' From 597e0213ce4addca7f32679e4adc80033dce6535 Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Thu, 25 Dec 2025 13:37:14 +0100 Subject: [PATCH 77/99] Bump to a4 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index e1bf5a8ef..6e3d731b2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "plugwise" -version = "1.12.0a3" +version = "1.12.0a4" license = "MIT" description = "Plugwise Smile (Adam/Anna/P1) and Stretch module for Python 3." readme = "README.md" From 846ca96182918863c8ac1a3cfe0f489858ffc0fa Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Sat, 27 Dec 2025 12:32:52 +0100 Subject: [PATCH 78/99] Add err to raise messages --- plugwise/__init__.py | 2 +- plugwise/smile.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/plugwise/__init__.py b/plugwise/__init__.py index bf4f3b04b..9c4cd84dd 100644 --- a/plugwise/__init__.py +++ b/plugwise/__init__.py @@ -332,7 +332,7 @@ async def async_update(self) -> dict[str, GwEntityData]: try: data = await self._smile_api.async_update() except (DataMissingError, KeyError) as err: - raise PlugwiseError("No Plugwise data received") from err + raise PlugwiseError(f"No Plugwise data received: {err}") from err return data diff --git a/plugwise/smile.py b/plugwise/smile.py index 2846e4c75..245100e21 100644 --- a/plugwise/smile.py +++ b/plugwise/smile.py @@ -138,7 +138,7 @@ async def async_update(self) -> dict[str, GwEntityData]: "cooling_enabled" ] except KeyError as err: - raise DataMissingError("No Plugwise actual data received") from err + raise DataMissingError(f"No Plugwise actual data received: {err}") from err return self.gw_entities From 6a1c597d893422a988727e28f90e4544d39eab33 Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Sat, 27 Dec 2025 12:36:24 +0100 Subject: [PATCH 79/99] Bump to a5 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 6e3d731b2..d2be94356 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "plugwise" -version = "1.12.0a4" +version = "1.12.0a5" license = "MIT" description = "Plugwise Smile (Adam/Anna/P1) and Stretch module for Python 3." readme = "README.md" From 468d451bedadbe86ce43d7b54323e55dae69a5b1 Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Sat, 27 Dec 2025 13:18:16 +0100 Subject: [PATCH 80/99] Improve _get_groups() --- plugwise/common.py | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/plugwise/common.py b/plugwise/common.py index ea096b2da..f585f952b 100644 --- a/plugwise/common.py +++ b/plugwise/common.py @@ -203,7 +203,6 @@ def _get_groups(self) -> None: return for group in self._domain_objects.findall("./group"): - members: list[str] = [] group_id = group.get("id") group_name = group.find("name").text if group_id is None: @@ -211,16 +210,13 @@ def _get_groups(self) -> None: self._new_groups.append(group_id) if ( - group_id in self._existing_groups + (members := self._collect_members(group)) + and group_id in self._existing_groups and self.gw_entities[group_id]["name"] == group_name ): continue group_type = group.find("type").text - group_appliances = group.findall("appliances/appliance") - for item in group_appliances: - self._add_member(item, members) - if group_type in GROUP_TYPES and members: self.gw_entities[group_id] = { "dev_class": group_type, @@ -242,10 +238,15 @@ def _get_groups(self) -> None: self._existing_groups = self._new_groups self._new_groups = [] - def _add_member(self, element: etree.Element, members: list[str]) -> None: - """Check and add member to list.""" - if (member_id := element.attrib["id"]) in self.gw_entities: - members.append(member_id) + def _collect_members(self, element: etree.Element) -> list[str]: + """Check and collect members.""" + members: list[str] = [] + group_appliances = element.findall("appliances/appliance") + for item in group_appliances: + if (member_id := item.get("id")) in self.gw_entities: + members.append(member_id) + + return members def _get_lock_state( self, xml: etree.Element, data: GwEntityData, stretch_v2: bool = False From 29d0a162227d5a56834fbf7275aec7d489f78cc4 Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Sat, 27 Dec 2025 13:58:30 +0100 Subject: [PATCH 81/99] Improve _get_appliances() logic --- plugwise/common.py | 13 ++++--------- plugwise/helper.py | 10 +++++++--- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/plugwise/common.py b/plugwise/common.py index f585f952b..126ca37be 100644 --- a/plugwise/common.py +++ b/plugwise/common.py @@ -208,12 +208,10 @@ def _get_groups(self) -> None: if group_id is None: continue # pragma: no cover - self._new_groups.append(group_id) - if ( - (members := self._collect_members(group)) - and group_id in self._existing_groups - and self.gw_entities[group_id]["name"] == group_name - ): + members = self._collect_members(group) + if group_id not in self._existing_groups and members: + self._new_groups.append(group_id) + elif self.gw_entities[group_id]["name"] == group_name continue group_type = group.find("type").text @@ -226,9 +224,6 @@ def _get_groups(self) -> None: "vendor": "Plugwise", } self._count += 5 - elif group_id in self._existing_groups: - # Group existed but now has no valid members -> remove - self._new_groups.remove(group_id) removed = list(set(self._existing_groups) - set(self._new_groups)) if self._existing_groups and removed: diff --git a/plugwise/helper.py b/plugwise/helper.py index c0fc9fdbe..71472e3ce 100644 --- a/plugwise/helper.py +++ b/plugwise/helper.py @@ -157,15 +157,19 @@ def _get_appliances(self) -> bool: extend_plug_device_class(appl, appliance) - self._new_appliances.append(appl.entity_id) - if appl.entity_id in self._existing_appliances and ( + if appl.entity_id not in self._existing_appliances: + self._new_appliances.append(appl.entity_id) + elif ( appl.pwclass in ("gateway", "heater_central") or self.gw_entities[appl.entity_id]["name"] == appl.name ): continue # Collect appliance info, skip orphaned/removed devices - if not (appl := self._appliance_info_finder(appl, appliance)): + if not ( + appl := self._appliance_info_finder(appl, appliance) + and appl.entity_id in self._new_appliances + ): self._new_appliances.pop() continue From 4a7c6111b4b233e732292409907be97fee612408 Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Sat, 27 Dec 2025 13:59:19 +0100 Subject: [PATCH 82/99] Fix typo --- 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 126ca37be..ca7525f60 100644 --- a/plugwise/common.py +++ b/plugwise/common.py @@ -211,7 +211,7 @@ def _get_groups(self) -> None: members = self._collect_members(group) if group_id not in self._existing_groups and members: self._new_groups.append(group_id) - elif self.gw_entities[group_id]["name"] == group_name + elif self.gw_entities[group_id]["name"] == group_name: continue group_type = group.find("type").text diff --git a/plugwise/helper.py b/plugwise/helper.py index 71472e3ce..10638ba40 100644 --- a/plugwise/helper.py +++ b/plugwise/helper.py @@ -167,7 +167,7 @@ def _get_appliances(self) -> bool: # Collect appliance info, skip orphaned/removed devices if not ( - appl := self._appliance_info_finder(appl, appliance) + (appl := self._appliance_info_finder(appl, appliance)) and appl.entity_id in self._new_appliances ): self._new_appliances.pop() From 67309e70e500e4ac3e235df4c68e6e3a7706592b Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Sat, 27 Dec 2025 14:17:16 +0100 Subject: [PATCH 83/99] Correct logic --- plugwise/helper.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/plugwise/helper.py b/plugwise/helper.py index 10638ba40..4e40d7f79 100644 --- a/plugwise/helper.py +++ b/plugwise/helper.py @@ -166,11 +166,9 @@ def _get_appliances(self) -> bool: continue # Collect appliance info, skip orphaned/removed devices - if not ( - (appl := self._appliance_info_finder(appl, appliance)) - and appl.entity_id in self._new_appliances - ): - self._new_appliances.pop() + if not (appl := self._appliance_info_finder(appl, appliance)): + if appl.entity_id in self._new_appliances: + self._new_appliances.pop() continue self._create_gw_entities(appl) From 622f0990eab15a89bc680e4c8eb7cda6a38ef166 Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Sat, 27 Dec 2025 14:30:53 +0100 Subject: [PATCH 84/99] Don't re-init self.gw_entities --- fixtures/adam_plus_anna_new/data.json | 49 ++++++++++++++++++++++----- plugwise/common.py | 2 +- 2 files changed, 42 insertions(+), 9 deletions(-) diff --git a/fixtures/adam_plus_anna_new/data.json b/fixtures/adam_plus_anna_new/data.json index eda4a7bbf..37d51b261 100644 --- a/fixtures/adam_plus_anna_new/data.json +++ b/fixtures/adam_plus_anna_new/data.json @@ -211,7 +211,11 @@ }, "dev_class": "gateway", "firmware": "3.9.0", - "gateway_modes": ["away", "full", "vacation"], + "gateway_modes": [ + "away", + "full", + "vacation" + ], "hardware": "AME Smile 2.0 board", "location": "bc93488efab249e5bc54fd7e175a6f91", "mac_address": "D40FB201CBA0", @@ -219,7 +223,12 @@ "model_id": "smile_open_therm", "name": "Adam", "notifications": {}, - "regulation_modes": ["bleeding_cold", "heating", "off", "bleeding_hot"], + "regulation_modes": [ + "bleeding_cold", + "heating", + "off", + "bleeding_hot" + ], "select_gateway_mode": "full", "select_regulation_mode": "heating", "sensors": { @@ -308,7 +317,13 @@ "dev_class": "climate", "model": "ThermoZone", "name": "Living room", - "preset_modes": ["vacation", "no_frost", "asleep", "home", "away"], + "preset_modes": [ + "vacation", + "no_frost", + "asleep", + "home", + "away" + ], "select_schedule": "Weekschema", "select_zone_profile": "active", "sensors": { @@ -331,7 +346,11 @@ "secondary": [] }, "vendor": "Plugwise", - "zone_profiles": ["active", "off", "passive"] + "zone_profiles": [ + "active", + "off", + "passive" + ] }, "f871b8c4d63549319221e294e4f88074": { "active_preset": "vacation", @@ -347,7 +366,13 @@ "dev_class": "climate", "model": "ThermoZone", "name": "Bathroom", - "preset_modes": ["vacation", "no_frost", "asleep", "home", "away"], + "preset_modes": [ + "vacation", + "no_frost", + "asleep", + "home", + "away" + ], "select_schedule": "off", "select_zone_profile": "passive", "sensors": { @@ -362,10 +387,18 @@ "upper_bound": 99.9 }, "thermostats": { - "primary": ["e2f4322d57924fa090fbbc48b3a140dc"], - "secondary": ["1772a4ea304041adb83f357b751341ff"] + "primary": [ + "e2f4322d57924fa090fbbc48b3a140dc" + ], + "secondary": [ + "1772a4ea304041adb83f357b751341ff" + ] }, "vendor": "Plugwise", - "zone_profiles": ["active", "off", "passive"] + "zone_profiles": [ + "active", + "off", + "passive" + ] } } diff --git a/plugwise/common.py b/plugwise/common.py index ca7525f60..89f215472 100644 --- a/plugwise/common.py +++ b/plugwise/common.py @@ -58,7 +58,7 @@ def __init__(self) -> None: self._heater_id: str = NONE self._new_groups: list[str] = [] self._on_off_device: bool - self.gw_entities: dict[str, GwEntityData] = {} + self.gw_entities: dict[str, GwEntityData] self.smile: Munch @property From a3df547c2b9118cf5a4fc3f59f0bdcbc89736598 Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Sat, 27 Dec 2025 15:18:07 +0100 Subject: [PATCH 85/99] Try --- plugwise/helper.py | 4 ++-- plugwise/smile.py | 3 --- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/plugwise/helper.py b/plugwise/helper.py index 4e40d7f79..e70f9cc0c 100644 --- a/plugwise/helper.py +++ b/plugwise/helper.py @@ -97,8 +97,8 @@ def __init__(self) -> None: self._loc_data: dict[str, ThermoLoc] self._schedule_old_states: dict[str, dict[str, str]] self._gateway_id: str = NONE - self._zones: dict[str, GwEntityData] - self.gw_entities: dict[str, GwEntityData] + # self._zones: dict[str, GwEntityData] + self.gw_entities: dict[str, GwEntityData] = {} self.smile: Munch = Munch() @property diff --git a/plugwise/smile.py b/plugwise/smile.py index 245100e21..d0920f513 100644 --- a/plugwise/smile.py +++ b/plugwise/smile.py @@ -88,9 +88,6 @@ def __init__( self.smile = smile self.therms_with_offset_func: list[str] = [] - self._zones = {} - self.gw_entities = {} - @property def cooling_present(self) -> bool: """Return the cooling capability.""" From 8e63576e349882bff73609e9268c31bc9da0b010 Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Sun, 28 Dec 2025 10:29:13 +0100 Subject: [PATCH 86/99] Move _get_appliances_with_offset_functionality() --- plugwise/helper.py | 11 ----------- plugwise/smile.py | 11 +++++++++++ 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/plugwise/helper.py b/plugwise/helper.py index e70f9cc0c..1a004d3ab 100644 --- a/plugwise/helper.py +++ b/plugwise/helper.py @@ -373,17 +373,6 @@ def _get_appl_actuator_modes( return mode_list - def _get_appliances_with_offset_functionality(self) -> list[str]: - """Helper-function collecting all appliance that have offset_functionality.""" - therm_list: list[str] = [] - offset_appls = self._domain_objects.findall( - './/actuator_functionalities/offset_functionality[type="temperature_offset"]/offset/../../..' - ) - for item in offset_appls: - therm_list.append(item.get("id")) - - return therm_list - def _get_zone_data(self, loc_id: str, zone: GwEntityData) -> None: """Helper-function for smile.py: _get_entity_data(). diff --git a/plugwise/smile.py b/plugwise/smile.py index d0920f513..7afccd445 100644 --- a/plugwise/smile.py +++ b/plugwise/smile.py @@ -115,6 +115,17 @@ def get_all_gateway_entities(self) -> None: self._get_groups() self._all_entity_data() + def _get_appliances_with_offset_functionality(self) -> list[str]: + """Helper-function collecting all appliance that have offset_functionality.""" + therm_list: list[str] = [] + offset_appls = self._domain_objects.findall( + './/actuator_functionalities/offset_functionality[type="temperature_offset"]/offset/../../..' + ) + for item in offset_appls: + therm_list.append(item.get("id")) + + return therm_list + async def async_update(self) -> dict[str, GwEntityData]: """Perform an full update: re-collect all gateway entities and their data and states. From 1c74c512dee65dfd642b330ba58132c9de4a9f94 Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Sun, 28 Dec 2025 10:46:05 +0100 Subject: [PATCH 87/99] Try 2 --- plugwise/helper.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/plugwise/helper.py b/plugwise/helper.py index 1a004d3ab..49fd1e0ff 100644 --- a/plugwise/helper.py +++ b/plugwise/helper.py @@ -157,14 +157,19 @@ def _get_appliances(self) -> bool: extend_plug_device_class(appl, appliance) - if appl.entity_id not in self._existing_appliances: - self._new_appliances.append(appl.entity_id) - elif ( + self._new_appliances.append(appl.entity_id) + if appl.entity_id in self._existing_appliances and ( appl.pwclass in ("gateway", "heater_central") or self.gw_entities[appl.entity_id]["name"] == appl.name ): continue +# if ( +# appl.pwclass in ("gateway", "heater_central") # Names are fixed in software +# or self.gw_entities[appl.entity_id]["name"] == appl.name +# ): +# continue + # Collect appliance info, skip orphaned/removed devices if not (appl := self._appliance_info_finder(appl, appliance)): if appl.entity_id in self._new_appliances: From 205265e3e635d8a8072c2165bbe70e72f45c3cf1 Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Sun, 28 Dec 2025 11:04:08 +0100 Subject: [PATCH 88/99] Improve _get_groups() Try 4 --- plugwise/common.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/plugwise/common.py b/plugwise/common.py index 89f215472..23ace5b7c 100644 --- a/plugwise/common.py +++ b/plugwise/common.py @@ -208,10 +208,13 @@ def _get_groups(self) -> None: if group_id is None: continue # pragma: no cover - members = self._collect_members(group) - if group_id not in self._existing_groups and members: + if (members := self._collect_members(group)): self._new_groups.append(group_id) - elif self.gw_entities[group_id]["name"] == group_name: + + if ( + group_id in self._existing_groups + and self.gw_entities[group_id]["name"] == group_name + ): continue group_type = group.find("type").text From 05fc576cda495f0cb5be0462a8e2e6016fd4e4df Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Sun, 28 Dec 2025 11:19:45 +0100 Subject: [PATCH 89/99] Avoid adding "_plug" when already present --- plugwise/helper.py | 1 + 1 file changed, 1 insertion(+) diff --git a/plugwise/helper.py b/plugwise/helper.py index 49fd1e0ff..48abb09df 100644 --- a/plugwise/helper.py +++ b/plugwise/helper.py @@ -64,6 +64,7 @@ def extend_plug_device_class(appl: Munch, appliance: etree.Element) -> None: (search := appliance.find("description")) is not None and (description := search.text) is not None and ("ZigBee protocol" in description or "smart plug" in description) + and not appl.pwclass.endswith("_plug") ): appl.pwclass = f"{appl.pwclass}_plug" From 0512af74e900eb0cfe1f9b94d062a6b04d65600e Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Sun, 28 Dec 2025 11:26:55 +0100 Subject: [PATCH 90/99] Save entity_id locally --- plugwise/helper.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugwise/helper.py b/plugwise/helper.py index 48abb09df..1161ce9c0 100644 --- a/plugwise/helper.py +++ b/plugwise/helper.py @@ -172,8 +172,9 @@ def _get_appliances(self) -> bool: # continue # Collect appliance info, skip orphaned/removed devices + entity_id = appl.entity_id if not (appl := self._appliance_info_finder(appl, appliance)): - if appl.entity_id in self._new_appliances: + if entity_id in self._new_appliances: self._new_appliances.pop() continue From b0d4822d19ce30beb4ea1651e78f18db7f8bca09 Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Sun, 28 Dec 2025 11:33:07 +0100 Subject: [PATCH 91/99] Clean up --- plugwise/helper.py | 6 ------ 1 file changed, 6 deletions(-) diff --git a/plugwise/helper.py b/plugwise/helper.py index 1161ce9c0..7cf78ba7a 100644 --- a/plugwise/helper.py +++ b/plugwise/helper.py @@ -165,12 +165,6 @@ def _get_appliances(self) -> bool: ): continue -# if ( -# appl.pwclass in ("gateway", "heater_central") # Names are fixed in software -# or self.gw_entities[appl.entity_id]["name"] == appl.name -# ): -# continue - # Collect appliance info, skip orphaned/removed devices entity_id = appl.entity_id if not (appl := self._appliance_info_finder(appl, appliance)): From 15a71159cc84331bd966725f9a03839724729f40 Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Sun, 28 Dec 2025 11:35:05 +0100 Subject: [PATCH 92/99] Re-enable init --- plugwise/helper.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugwise/helper.py b/plugwise/helper.py index 7cf78ba7a..e4de26bd4 100644 --- a/plugwise/helper.py +++ b/plugwise/helper.py @@ -98,7 +98,7 @@ def __init__(self) -> None: self._loc_data: dict[str, ThermoLoc] self._schedule_old_states: dict[str, dict[str, str]] self._gateway_id: str = NONE - # self._zones: dict[str, GwEntityData] + self._zones: dict[str, GwEntityData] self.gw_entities: dict[str, GwEntityData] = {} self.smile: Munch = Munch() From 4b9a102ad753ae7946449edede842ccd06d07843 Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Sun, 28 Dec 2025 11:35:41 +0100 Subject: [PATCH 93/99] Ruffed --- fixtures/adam_plus_anna_new/data.json | 49 +++++---------------------- plugwise/common.py | 2 +- 2 files changed, 9 insertions(+), 42 deletions(-) diff --git a/fixtures/adam_plus_anna_new/data.json b/fixtures/adam_plus_anna_new/data.json index 37d51b261..eda4a7bbf 100644 --- a/fixtures/adam_plus_anna_new/data.json +++ b/fixtures/adam_plus_anna_new/data.json @@ -211,11 +211,7 @@ }, "dev_class": "gateway", "firmware": "3.9.0", - "gateway_modes": [ - "away", - "full", - "vacation" - ], + "gateway_modes": ["away", "full", "vacation"], "hardware": "AME Smile 2.0 board", "location": "bc93488efab249e5bc54fd7e175a6f91", "mac_address": "D40FB201CBA0", @@ -223,12 +219,7 @@ "model_id": "smile_open_therm", "name": "Adam", "notifications": {}, - "regulation_modes": [ - "bleeding_cold", - "heating", - "off", - "bleeding_hot" - ], + "regulation_modes": ["bleeding_cold", "heating", "off", "bleeding_hot"], "select_gateway_mode": "full", "select_regulation_mode": "heating", "sensors": { @@ -317,13 +308,7 @@ "dev_class": "climate", "model": "ThermoZone", "name": "Living room", - "preset_modes": [ - "vacation", - "no_frost", - "asleep", - "home", - "away" - ], + "preset_modes": ["vacation", "no_frost", "asleep", "home", "away"], "select_schedule": "Weekschema", "select_zone_profile": "active", "sensors": { @@ -346,11 +331,7 @@ "secondary": [] }, "vendor": "Plugwise", - "zone_profiles": [ - "active", - "off", - "passive" - ] + "zone_profiles": ["active", "off", "passive"] }, "f871b8c4d63549319221e294e4f88074": { "active_preset": "vacation", @@ -366,13 +347,7 @@ "dev_class": "climate", "model": "ThermoZone", "name": "Bathroom", - "preset_modes": [ - "vacation", - "no_frost", - "asleep", - "home", - "away" - ], + "preset_modes": ["vacation", "no_frost", "asleep", "home", "away"], "select_schedule": "off", "select_zone_profile": "passive", "sensors": { @@ -387,18 +362,10 @@ "upper_bound": 99.9 }, "thermostats": { - "primary": [ - "e2f4322d57924fa090fbbc48b3a140dc" - ], - "secondary": [ - "1772a4ea304041adb83f357b751341ff" - ] + "primary": ["e2f4322d57924fa090fbbc48b3a140dc"], + "secondary": ["1772a4ea304041adb83f357b751341ff"] }, "vendor": "Plugwise", - "zone_profiles": [ - "active", - "off", - "passive" - ] + "zone_profiles": ["active", "off", "passive"] } } diff --git a/plugwise/common.py b/plugwise/common.py index 23ace5b7c..50a782276 100644 --- a/plugwise/common.py +++ b/plugwise/common.py @@ -208,7 +208,7 @@ def _get_groups(self) -> None: if group_id is None: continue # pragma: no cover - if (members := self._collect_members(group)): + if members := self._collect_members(group): self._new_groups.append(group_id) if ( From f37c619b587a9b6af91ffc9fb2de507efc8dc974 Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Sun, 28 Dec 2025 11:41:31 +0100 Subject: [PATCH 94/99] Add pragma-no-cover, remove unused code --- plugwise/data.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/plugwise/data.py b/plugwise/data.py index bfe1d7926..95bad38ef 100644 --- a/plugwise/data.py +++ b/plugwise/data.py @@ -106,10 +106,10 @@ def _detect_low_batteries(self) -> list[str]: def _add_or_update_notifications( self, entity_id: str, entity: GwEntityData ) -> None: - """Helper-function adding or updating the Plugwise notifications.""" + """Helper-function adding or updating the Plugwise notifications to the gateway.""" if entity_id != self._gateway_id: - return + return # pragma: no cover if self._is_thermostat or self.smile.type == "power": if "plugwise_notification" not in entity: @@ -119,12 +119,6 @@ def _add_or_update_notifications( entity.update({"notifications": self._notifications}) self._count += 2 - else: - entity["binary_sensors"]["plugwise_notification"] = bool( - self._notifications - ) - entity["notifications"] = self._notifications - def _update_for_cooling(self, entity: GwEntityData) -> None: """Helper-function for adding/updating various cooling-related values.""" # For Anna and heating + cooling, replace setpoint with setpoint_high/_low From 46bd4790344e7b61d50a56068ac88f7a9f59fad1 Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Sun, 28 Dec 2025 11:43:59 +0100 Subject: [PATCH 95/99] Bump to a6 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index d2be94356..e8480f10e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "plugwise" -version = "1.12.0a5" +version = "1.12.0a6" license = "MIT" description = "Plugwise Smile (Adam/Anna/P1) and Stretch module for Python 3." readme = "README.md" From 181e615c1d782af739b6e2979b9ee81b0cc26b34 Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Sun, 28 Dec 2025 11:52:46 +0100 Subject: [PATCH 96/99] Fix as suggested --- plugwise/data.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugwise/data.py b/plugwise/data.py index 95bad38ef..24e056930 100644 --- a/plugwise/data.py +++ b/plugwise/data.py @@ -112,7 +112,7 @@ def _add_or_update_notifications( return # pragma: no cover if self._is_thermostat or self.smile.type == "power": - if "plugwise_notification" not in entity: + if "plugwise_notification" not in entity["binary_sensors"]: entity["binary_sensors"].update( {"plugwise_notification": bool(self._notifications)} ) From d72087f2e1230e08eb3b14b422960ebd9c125e9b Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Sun, 28 Dec 2025 11:54:16 +0100 Subject: [PATCH 97/99] Bump to a7 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index e8480f10e..959b51f48 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "plugwise" -version = "1.12.0a6" +version = "1.12.0a7" license = "MIT" description = "Plugwise Smile (Adam/Anna/P1) and Stretch module for Python 3." readme = "README.md" From 10130a8af69182a6c39016b8803fcee8f75cb6bd Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Sun, 28 Dec 2025 13:02:39 +0100 Subject: [PATCH 98/99] Debug --- plugwise/common.py | 2 ++ plugwise/smile.py | 3 +++ 2 files changed, 5 insertions(+) diff --git a/plugwise/common.py b/plugwise/common.py index 50a782276..44b02522b 100644 --- a/plugwise/common.py +++ b/plugwise/common.py @@ -209,8 +209,10 @@ def _get_groups(self) -> None: continue # pragma: no cover if members := self._collect_members(group): + LOGGER.debug("HOI members: %s", members) self._new_groups.append(group_id) + LOGGER.debug("HOI get_existing_groups: %s", self._existing_groups) if ( group_id in self._existing_groups and self.gw_entities[group_id]["name"] == group_name diff --git a/plugwise/smile.py b/plugwise/smile.py index 7afccd445..6da306752 100644 --- a/plugwise/smile.py +++ b/plugwise/smile.py @@ -16,6 +16,7 @@ DOMAIN_OBJECTS, GATEWAY_REBOOT, LOCATIONS, + LOGGER. MAX_SETPOINT, MIN_SETPOINT, NONE, @@ -106,12 +107,14 @@ def get_all_gateway_entities(self) -> None: Collect and add switching- and/or pump-group entities. Finally, collect the data and states for each entity. """ + LOGGER.debug("HOI 1 get_all_gateway_entities data: %s", self.gw_entities) if self._get_appliances() and self._is_thermostat: self.therms_with_offset_func = ( self._get_appliances_with_offset_functionality() ) self._scan_thermostats() + LOGGER.debug("HOI 2 get_all_gateway_entities data: %s", self.gw_entities) self._get_groups() self._all_entity_data() From 21abad2b17f7069d8faa1c6773f231542b61e7a0 Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Sun, 28 Dec 2025 13:03:02 +0100 Subject: [PATCH 99/99] Bump to a8 --- plugwise/common.py | 1 + plugwise/smile.py | 2 +- pyproject.toml | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/plugwise/common.py b/plugwise/common.py index 44b02522b..686efe4c4 100644 --- a/plugwise/common.py +++ b/plugwise/common.py @@ -10,6 +10,7 @@ from plugwise.constants import ( ANNA, GROUP_TYPES, + LOGGER, NONE, PRIORITY_DEVICE_CLASSES, SPECIAL_PLUG_TYPES, diff --git a/plugwise/smile.py b/plugwise/smile.py index 6da306752..6313fc7a9 100644 --- a/plugwise/smile.py +++ b/plugwise/smile.py @@ -16,7 +16,7 @@ DOMAIN_OBJECTS, GATEWAY_REBOOT, LOCATIONS, - LOGGER. + LOGGER, MAX_SETPOINT, MIN_SETPOINT, NONE, diff --git a/pyproject.toml b/pyproject.toml index 959b51f48..98f91b3b2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "plugwise" -version = "1.12.0a7" +version = "1.12.0a8" license = "MIT" description = "Plugwise Smile (Adam/Anna/P1) and Stretch module for Python 3." readme = "README.md"