From 980d2f34c4809d7b4150c1e87cb733c8f97f1309 Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Wed, 6 Nov 2024 19:57:45 +0100 Subject: [PATCH 01/16] Correct & cleanup P1 sensor items --- plugwise/constants.py | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/plugwise/constants.py b/plugwise/constants.py index ec19fb093..d676cf4ab 100644 --- a/plugwise/constants.py +++ b/plugwise/constants.py @@ -431,30 +431,28 @@ class SmileSensors(TypedDict, total=False): dhw_temperature: float domestic_hot_water_setpoint: float temperature: float - electricity_consumed: float - electricity_consumed_interval: float + electricity_consumed_interval:int electricity_consumed_off_peak_cumulative: float electricity_consumed_off_peak_interval: int electricity_consumed_off_peak_point: int electricity_consumed_peak_cumulative: float electricity_consumed_peak_interval: int electricity_consumed_peak_point: int - electricity_consumed_point: float - electricity_phase_one_consumed: float - electricity_phase_two_consumed: float - electricity_phase_three_consumed: float - electricity_phase_one_produced: float - electricity_phase_two_produced: float - electricity_phase_three_produced: float - electricity_produced: float - electricity_produced_interval: float + electricity_consumed_point: int + electricity_phase_one_consumed: int + electricity_phase_two_consumed: int + electricity_phase_three_consumed: int + electricity_phase_one_produced: int + electricity_phase_two_produced: int + electricity_phase_three_produced: int + electricity_produced_interval: int electricity_produced_off_peak_cumulative: float electricity_produced_off_peak_interval: int electricity_produced_off_peak_point: int electricity_produced_peak_cumulative: float electricity_produced_peak_interval: int electricity_produced_peak_point: int - electricity_produced_point: float + electricity_produced_point: int gas_consumed_cumulative: float gas_consumed_interval: float humidity: float From 1519d7093bb28ecbce9601e8469a7738cbe527ac Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Wed, 6 Nov 2024 20:04:17 +0100 Subject: [PATCH 02/16] Update CHANGELOG --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9eaf41230..ce6f8cc62 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## Ongoing +- Fix typing of P1 sensors. - Rename mode to climate_mode. ## v1.5.0 From 12e4b013e938e2f3a07f6354fb4a7ac665b5f146 Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Sat, 9 Nov 2024 19:40:59 +0100 Subject: [PATCH 03/16] Optimize energy_device-related code --- plugwise/helper.py | 90 +++++++++++++++++++++------------------------- plugwise/util.py | 2 +- 2 files changed, 42 insertions(+), 50 deletions(-) diff --git a/plugwise/helper.py b/plugwise/helper.py index 30dc04f59..d59259ce0 100644 --- a/plugwise/helper.py +++ b/plugwise/helper.py @@ -269,6 +269,10 @@ def _all_appliances(self) -> None: for appliance in self._domain_objects.findall("./appliance"): appl = Munch() appl.pwclass = appliance.find("type").text + # Don't collect data for the OpenThermGateway appliance + if appl.pwclass == "open_therm_gateway": + continue + # Extend device_class name of Plugs (Plugwise and Aqara) - Pw-Beta Issue #739 description = appliance.find("description").text if description is not None and ( @@ -291,6 +295,10 @@ def _all_appliances(self) -> None: elif appl.pwclass not in THERMOSTAT_CLASSES: appl.location = self._home_location + # Don't show orphaned thermostat-types + if appl.pwclass in THERMOSTAT_CLASSES and appl.location is None: + continue + appl.dev_id = appliance.attrib["id"] appl.name = appliance.find("name").text appl.model = None @@ -301,24 +309,22 @@ def _all_appliances(self) -> None: appl.zigbee_mac = None appl.vendor_name = None - # Determine class for this appliance - # Skip on heater_central when no active device present - if not (appl := self._appliance_info_finder(appl, appliance)): - continue + # Collect appliance info + appl = self._appliance_info_finder(appl, appliance) # Skip orphaned heater_central (Core Issue #104433) if appl.pwclass == "heater_central" and appl.dev_id != self._heater_id: continue + # Skip orphaned/removed plug-type + if "_plug" in appl.pwclass and appl.zigbee_mac is None: + continue + # P1: for gateway and smartmeter switch device_id - part 1 # This is done to avoid breakage in HA Core if appl.pwclass == "gateway" and self.smile_type == "power": appl.dev_id = appl.location - # Don't show orphaned thermostat-types or the OpenTherm Gateway. - if appl.pwclass in THERMOSTAT_CLASSES and appl.location is None: - continue - self._create_gw_devices(appl) # For P1 collect the connected SmartMeter info @@ -356,16 +362,22 @@ def _all_locations(self) -> None: def _p1_smartmeter_info_finder(self, appl: Munch) -> None: """Collect P1 DSMR Smartmeter info.""" loc_id = next(iter(self.loc_data.keys())) + location = self._domain_objects.find(f'./location[@id="{loc_id}"]') + locator = "./logs/point_log/electricity_point_meter" + mod_type = "electricity_point_meter" + module_data = self._get_module_data(location, locator, mod_type) + appl.dev_id = self.gateway_id + appl.firmware = module_data["firmware_version"] + appl.hardware = module_data["hardware_version"] appl.location = loc_id appl.mac = None - appl.model = None + appl.model = module_data["vendor_model"] # don't use model_id for Smartmeter appl.model_id = None appl.name = "P1" appl.pwclass = "smartmeter" + appl.vendor_name = module_data["vendor_name"] appl.zigbee_mac = None - location = self._domain_objects.find(f'./location[@id="{loc_id}"]') - appl = self._energy_device_info_finder(appl, location) self._create_gw_devices(appl) @@ -383,44 +395,24 @@ def _appliance_info_finder(self, appl: Munch, appliance: etree) -> Munch: self._appl_heater_central_info(appl, appliance, False) # False means non-legacy device self._appl_dhw_mode_info(appl, appliance) return appl - case _: - # Collect info from power-related devices (Plug, Aqara Smart Plug) - return self._energy_device_info_finder(appl, appliance) - - def _energy_device_info_finder(self, appl: Munch, appliance: etree) -> Munch: - """Helper-function for _appliance_info_finder(). - - Collect energy device info (Smartmeter): firmware, model and vendor name. - """ - if self.smile_type == "power": - locator = "./logs/point_log/electricity_point_meter" - mod_type = "electricity_point_meter" - module_data = self._get_module_data(appliance, locator, mod_type) - appl.hardware = module_data["hardware_version"] - appl.model = module_data["vendor_model"] # don't use model_id for Smartmeter - appl.vendor_name = module_data["vendor_name"] - appl.firmware = module_data["firmware_version"] - - return appl - - if self.smile(ADAM): - locator = "./logs/interval_log/electricity_interval_meter" - mod_type = "electricity_interval_meter" - module_data = self._get_module_data(appliance, locator, mod_type) - # Filter appliance without zigbee_mac, it's an orphaned device - appl.zigbee_mac = module_data["zigbee_mac_address"] - if appl.zigbee_mac is None: - return None - - appl.vendor_name = module_data["vendor_name"] - appl.model_id = module_data["vendor_model"] - appl.model = check_model(appl.model_id, appl.vendor_name) - appl.hardware = module_data["hardware_version"] - appl.firmware = module_data["firmware_version"] - - return appl - - return appl # pragma: no cover + case _ as s if s.endswith("_plug"): + # Collect info from plug-types (Plug, Aqara Smart Plug) + locator = "./logs/interval_log/electricity_interval_meter" + mod_type = "electricity_interval_meter" + module_data = self._get_module_data(appliance, locator, mod_type) + # A plug without module-data is orphaned/ no present + if not module_data["contents"]: + return appl + + appl.firmware = module_data["firmware_version"] + appl.hardware = module_data["hardware_version"] + appl.model_id = module_data["vendor_model"] + 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"] + return appl + case _: # pragma: no cover + return appl def _appl_gateway_info(self, appl: Munch, appliance: etree) -> Munch: """Helper-function for _appliance_info_finder().""" diff --git a/plugwise/util.py b/plugwise/util.py index d11f09739..665c79a53 100644 --- a/plugwise/util.py +++ b/plugwise/util.py @@ -115,7 +115,7 @@ def check_model(name: str | None, vendor_name: str | None) -> str | None: if name is not None and "lumi.plug" in name: return "Aqara Smart Plug" - return name + return name # pragma: no cover def common_match_cases( From fa6f812aebbf6b66d24d9c2181c40d2ab7dc0052 Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Sun, 10 Nov 2024 09:53:34 +0100 Subject: [PATCH 04/16] Update CHANGELOG --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ce6f8cc62..4081ccbaf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ ## Ongoing -- Fix typing of P1 sensors. +- Fix typing of P1 sensors, energy-device-related improvements. - Rename mode to climate_mode. ## v1.5.0 From 051c715938262dec3fd2e3f065cb90e85cf28745 Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Sun, 10 Nov 2024 09:54:07 +0100 Subject: [PATCH 05/16] Bump to v1.5.1a0 test-version --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 004ac1c1a..efdc05792 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "plugwise" -version = "1.5.0" +version = "1.5.1a0" license = {file = "LICENSE"} description = "Plugwise Smile (Adam/Anna/P1) and Stretch module for Python 3." readme = "README.md" From 00ce6785cef2dfe5182598b634a6727c70fcd52f Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Sun, 10 Nov 2024 09:59:17 +0100 Subject: [PATCH 06/16] Simplify/improve doc-string --- plugwise/helper.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/plugwise/helper.py b/plugwise/helper.py index d59259ce0..bbcca785d 100644 --- a/plugwise/helper.py +++ b/plugwise/helper.py @@ -360,7 +360,7 @@ def _all_locations(self) -> None: self.loc_data[loc.loc_id] = {"name": loc.name} def _p1_smartmeter_info_finder(self, appl: Munch) -> None: - """Collect P1 DSMR Smartmeter info.""" + """Collect P1 DSMR SmartMeter info.""" loc_id = next(iter(self.loc_data.keys())) location = self._domain_objects.find(f'./location[@id="{loc_id}"]') locator = "./logs/point_log/electricity_point_meter" @@ -372,8 +372,8 @@ def _p1_smartmeter_info_finder(self, appl: Munch) -> None: appl.hardware = module_data["hardware_version"] appl.location = loc_id appl.mac = None - appl.model = module_data["vendor_model"] # don't use model_id for Smartmeter - appl.model_id = None + appl.model = module_data["vendor_model"] + appl.model_id = None # don't use model_id for SmartMeter appl.name = "P1" appl.pwclass = "smartmeter" appl.vendor_name = module_data["vendor_name"] @@ -382,7 +382,7 @@ def _p1_smartmeter_info_finder(self, appl: Munch) -> None: self._create_gw_devices(appl) def _appliance_info_finder(self, appl: Munch, appliance: etree) -> Munch: - """Collect device info (Smile/Stretch, Thermostats, OpenTherm/On-Off): firmware, model and vendor name.""" + """Collect info for all appliances found.""" match appl.pwclass: case "gateway": # Collect gateway device info From 095cf0d24ebe73cf9a30e287821dcf87a8966207 Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Sun, 10 Nov 2024 10:04:06 +0100 Subject: [PATCH 07/16] Move handling of special cases to helper-function --- plugwise/helper.py | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/plugwise/helper.py b/plugwise/helper.py index bbcca785d..7fa3b9955 100644 --- a/plugwise/helper.py +++ b/plugwise/helper.py @@ -267,7 +267,7 @@ def _all_appliances(self) -> None: self._all_locations() for appliance in self._domain_objects.findall("./appliance"): - appl = Munch() + appl: Munch | None = Munch() appl.pwclass = appliance.find("type").text # Don't collect data for the OpenThermGateway appliance if appl.pwclass == "open_therm_gateway": @@ -310,14 +310,7 @@ def _all_appliances(self) -> None: appl.vendor_name = None # Collect appliance info - appl = self._appliance_info_finder(appl, appliance) - - # Skip orphaned heater_central (Core Issue #104433) - if appl.pwclass == "heater_central" and appl.dev_id != self._heater_id: - continue - - # Skip orphaned/removed plug-type - if "_plug" in appl.pwclass and appl.zigbee_mac is None: + if (appl := self._appliance_info_finder(appl, appliance)) is None: continue # P1: for gateway and smartmeter switch device_id - part 1 @@ -381,7 +374,7 @@ def _p1_smartmeter_info_finder(self, appl: Munch) -> None: self._create_gw_devices(appl) - def _appliance_info_finder(self, appl: Munch, appliance: etree) -> Munch: + def _appliance_info_finder(self, appl: Munch, appliance: etree) -> Munch | None: """Collect info for all appliances found.""" match appl.pwclass: case "gateway": @@ -394,6 +387,9 @@ def _appliance_info_finder(self, appl: Munch, appliance: etree) -> Munch: # Collect heater_central device info self._appl_heater_central_info(appl, appliance, False) # False means non-legacy device self._appl_dhw_mode_info(appl, appliance) + # Skip orphaned heater_central (Core Issue #104433) + if appl.dev_id != self._heater_id: + return None return appl case _ as s if s.endswith("_plug"): # Collect info from plug-types (Plug, Aqara Smart Plug) @@ -402,7 +398,7 @@ def _appliance_info_finder(self, appl: Munch, appliance: etree) -> Munch: module_data = self._get_module_data(appliance, locator, mod_type) # A plug without module-data is orphaned/ no present if not module_data["contents"]: - return appl + return None appl.firmware = module_data["firmware_version"] appl.hardware = module_data["hardware_version"] From fdf033955e6969e0aadfafd1aa24af205c950728 Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Sun, 10 Nov 2024 10:11:57 +0100 Subject: [PATCH 08/16] Bump to a1 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index efdc05792..acd40c20c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "plugwise" -version = "1.5.1a0" +version = "1.5.1a1" license = {file = "LICENSE"} description = "Plugwise Smile (Adam/Anna/P1) and Stretch module for Python 3." readme = "README.md" From 2d96dde380d141bfc5a67a8bcf522a4a903af265 Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Sun, 10 Nov 2024 10:32:55 +0100 Subject: [PATCH 09/16] Revert two typing removals --- plugwise/constants.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugwise/constants.py b/plugwise/constants.py index d676cf4ab..2b9a8f2a4 100644 --- a/plugwise/constants.py +++ b/plugwise/constants.py @@ -431,6 +431,7 @@ class SmileSensors(TypedDict, total=False): dhw_temperature: float domestic_hot_water_setpoint: float temperature: float + electricity_consumed: int electricity_consumed_interval:int electricity_consumed_off_peak_cumulative: float electricity_consumed_off_peak_interval: int @@ -445,6 +446,7 @@ class SmileSensors(TypedDict, total=False): electricity_phase_one_produced: int electricity_phase_two_produced: int electricity_phase_three_produced: int + electricity_produced: int electricity_produced_interval: int electricity_produced_off_peak_cumulative: float electricity_produced_off_peak_interval: int From e42388ae1afbbe557fc2c3df66223fbbc097b970 Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Sun, 10 Nov 2024 10:37:14 +0100 Subject: [PATCH 10/16] Fix use of Much-None --- plugwise/helper.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/plugwise/helper.py b/plugwise/helper.py index 7fa3b9955..9fb43c57f 100644 --- a/plugwise/helper.py +++ b/plugwise/helper.py @@ -267,7 +267,7 @@ def _all_appliances(self) -> None: self._all_locations() for appliance in self._domain_objects.findall("./appliance"): - appl: Munch | None = Munch() + appl = Munch() appl.pwclass = appliance.find("type").text # Don't collect data for the OpenThermGateway appliance if appl.pwclass == "open_therm_gateway": @@ -309,8 +309,8 @@ def _all_appliances(self) -> None: appl.zigbee_mac = None appl.vendor_name = None - # Collect appliance info - if (appl := self._appliance_info_finder(appl, appliance)) is None: + # Collect appliance info, skip orphaned/removed devices + if not (appl := self._appliance_info_finder(appl, appliance)): continue # P1: for gateway and smartmeter switch device_id - part 1 @@ -374,7 +374,7 @@ def _p1_smartmeter_info_finder(self, appl: Munch) -> None: self._create_gw_devices(appl) - def _appliance_info_finder(self, appl: Munch, appliance: etree) -> Munch | None: + def _appliance_info_finder(self, appl: Munch, appliance: etree) -> Munch: """Collect info for all appliances found.""" match appl.pwclass: case "gateway": @@ -389,7 +389,7 @@ def _appliance_info_finder(self, appl: Munch, appliance: etree) -> Munch | None: self._appl_dhw_mode_info(appl, appliance) # Skip orphaned heater_central (Core Issue #104433) if appl.dev_id != self._heater_id: - return None + return Munch() return appl case _ as s if s.endswith("_plug"): # Collect info from plug-types (Plug, Aqara Smart Plug) @@ -398,7 +398,7 @@ def _appliance_info_finder(self, appl: Munch, appliance: etree) -> Munch | None: module_data = self._get_module_data(appliance, locator, mod_type) # A plug without module-data is orphaned/ no present if not module_data["contents"]: - return None + return Munch() appl.firmware = module_data["firmware_version"] appl.hardware = module_data["hardware_version"] From 22e8750b13f8e01528e5d870597bd256468d3b69 Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Sun, 10 Nov 2024 10:41:28 +0100 Subject: [PATCH 11/16] Bump to a2 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index acd40c20c..3d21650f0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "plugwise" -version = "1.5.1a1" +version = "1.5.1a2" license = {file = "LICENSE"} description = "Plugwise Smile (Adam/Anna/P1) and Stretch module for Python 3." readme = "README.md" From affa950d862adbcd6f87e5f934cb08c6e897dc10 Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Sun, 10 Nov 2024 10:55:26 +0100 Subject: [PATCH 12/16] Implement coderabbitai suggestion --- plugwise/helper.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plugwise/helper.py b/plugwise/helper.py index 9fb43c57f..1aa2283ab 100644 --- a/plugwise/helper.py +++ b/plugwise/helper.py @@ -359,6 +359,9 @@ def _p1_smartmeter_info_finder(self, appl: Munch) -> None: locator = "./logs/point_log/electricity_point_meter" mod_type = "electricity_point_meter" module_data = self._get_module_data(location, locator, mod_type) + if not module_data["contents"]: + LOGGER.error("No module data found for SmartMeter") # pragma: no cover + return None # pragma: no cover appl.dev_id = self.gateway_id appl.firmware = module_data["firmware_version"] @@ -717,6 +720,7 @@ def _wireless_availability(self, appliance: etree, data: DeviceData) -> None: locator = "./logs/interval_log/electricity_interval_meter" mod_type = "electricity_interval_meter" module_data = self._get_module_data(appliance, locator, mod_type) + if module_data["reachable"] is None: # Collect for wireless thermostats locator = "./logs/point_log[type='thermostat']/thermostat" From 73b2e32cb7898f0f1ba11285de8a87206bd7ca6b Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Sun, 10 Nov 2024 11:01:39 +0100 Subject: [PATCH 13/16] Implement similar guarding --- plugwise/helper.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/plugwise/helper.py b/plugwise/helper.py index 1aa2283ab..0c298471a 100644 --- a/plugwise/helper.py +++ b/plugwise/helper.py @@ -716,16 +716,18 @@ def _wireless_availability(self, appliance: etree, data: DeviceData) -> None: Collect the availability-status for wireless connected devices. """ if self.smile(ADAM): - # Collect for Plugs + # Try collecting for a Plug locator = "./logs/interval_log/electricity_interval_meter" mod_type = "electricity_interval_meter" module_data = self._get_module_data(appliance, locator, mod_type) - - if module_data["reachable"] is None: - # Collect for wireless thermostats + if not module_data["contents"]: + # Try collecting for a wireless thermostat locator = "./logs/point_log[type='thermostat']/thermostat" mod_type = "thermostat" module_data = self._get_module_data(appliance, locator, mod_type) + if not module_data["contents"]: + LOGGER.error("No module data found for Plug or wireless thermostat") # pragma: no cover + return None # pragma: no cover if module_data["reachable"] is not None: data["available"] = module_data["reachable"] From 0544640155ba6e0ce877a38326acff23a3f956a8 Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Sun, 10 Nov 2024 11:33:53 +0100 Subject: [PATCH 14/16] Bump to a3 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 3d21650f0..5db5faff2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "plugwise" -version = "1.5.1a2" +version = "1.5.1a3" license = {file = "LICENSE"} description = "Plugwise Smile (Adam/Anna/P1) and Stretch module for Python 3." readme = "README.md" From f509d495623c80e4d51242993c439b89747f1835 Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Sun, 10 Nov 2024 13:44:17 +0100 Subject: [PATCH 15/16] Force update --- plugwise/util.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugwise/util.py b/plugwise/util.py index 665c79a53..d11f09739 100644 --- a/plugwise/util.py +++ b/plugwise/util.py @@ -115,7 +115,7 @@ def check_model(name: str | None, vendor_name: str | None) -> str | None: if name is not None and "lumi.plug" in name: return "Aqara Smart Plug" - return name # pragma: no cover + return name def common_match_cases( From 6c799b77b7b8b5592f62bebcf15532ff419fe3a3 Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk Date: Sun, 10 Nov 2024 13:51:10 +0100 Subject: [PATCH 16/16] Add pragma - no cover --- plugwise/util.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugwise/util.py b/plugwise/util.py index d11f09739..665c79a53 100644 --- a/plugwise/util.py +++ b/plugwise/util.py @@ -115,7 +115,7 @@ def check_model(name: str | None, vendor_name: str | None) -> str | None: if name is not None and "lumi.plug" in name: return "Aqara Smart Plug" - return name + return name # pragma: no cover def common_match_cases(