Skip to content

Commit 61e99f5

Browse files
committed
Implement coderabnitai suggestion
1 parent 22e8750 commit 61e99f5

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

plugwise/helper.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,9 @@ def _p1_smartmeter_info_finder(self, appl: Munch) -> None:
359359
locator = "./logs/point_log/electricity_point_meter"
360360
mod_type = "electricity_point_meter"
361361
module_data = self._get_module_data(location, locator, mod_type)
362+
if not module_data["contents"]:
363+
LOGGER.error("No module data found for SmartMeter") # pragma: no cover
364+
return None # pragma: no cover
362365

363366
appl.dev_id = self.gateway_id
364367
appl.firmware = module_data["firmware_version"]
@@ -717,6 +720,7 @@ def _wireless_availability(self, appliance: etree, data: DeviceData) -> None:
717720
locator = "./logs/interval_log/electricity_interval_meter"
718721
mod_type = "electricity_interval_meter"
719722
module_data = self._get_module_data(appliance, locator, mod_type)
723+
720724
if module_data["reachable"] is None:
721725
# Collect for wireless thermostats
722726
locator = "./logs/point_log[type='thermostat']/thermostat"

0 commit comments

Comments
 (0)