Skip to content

Commit e6236ac

Browse files
committed
Skip HEATER_CENTRAL_MEASUREMENTS when no active_device_present
1 parent 74ab399 commit e6236ac

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

plugwise/helper.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
DOMAIN_OBJECTS,
2424
ENERGY_KILO_WATT_HOUR,
2525
ENERGY_WATT_HOUR,
26+
HEATER_CENTRAL_MEASUREMENTS,
2627
HOME_MEASUREMENTS,
2728
LOCATIONS,
2829
MODULES,
@@ -528,7 +529,10 @@ def appliance_data(self, dev_id):
528529
appliances = search.findall(f'.//appliance[@id="{dev_id}"]')
529530

530531
for appliance in appliances:
531-
for measurement, attrs in DEVICE_MEASUREMENTS.items():
532+
measurements = DEVICE_MEASUREMENTS.items()
533+
if self.active_device_present:
534+
measurements = {**DEVICE_MEASUREMENTS, **HEATER_CENTRAL_MEASUREMENTS}.items()
535+
for measurement, attrs in measurements:
532536

533537
p_locator = (
534538
f'.//logs/point_log[type="{measurement}"]/period/measurement'

0 commit comments

Comments
 (0)