Skip to content

Commit 9b912a6

Browse files
committed
Improve logic
1 parent ad76b78 commit 9b912a6

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

plugwise/helper.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1192,7 +1192,9 @@ def _power_data_peak_value(self, direct_data: DeviceData, loc: Munch) -> Munch:
11921192
# If locator not found look for gas_consumed or phase data (without tariff)
11931193
if loc.logs.find(loc.locator) is None:
11941194
LOGGER.debug("HOI1 not found")
1195-
if "gas" in loc.measurement or "phase" in loc.measurement:
1195+
if "log" in loc.log_type and (
1196+
"gas" in loc.measurement or "phase" in loc.measurement
1197+
):
11961198
LOGGER.debug("HOI no tarrifs")
11971199
# Avoid double processing by skipping one peak-list option
11981200
if loc.peak_select == "nl_offpeak":
@@ -1206,8 +1208,10 @@ def _power_data_peak_value(self, direct_data: DeviceData, loc: Munch) -> Munch:
12061208
loc.found = False
12071209
return loc
12081210
# P1 legacy point_meter has no tariff_indicator
1209-
elif "point" in loc.log_type:
1210-
LOGGER.debug("HOI point_meter")
1211+
elif "meter" in loc.log_type and (
1212+
"point" in loc.log_type or "gas" in loc.measurement
1213+
):
1214+
LOGGER.debug("HOI point_meter or gas")
12111215
# Avoid double processing by skipping one peak-list option
12121216
if loc.peak_select == "nl_offpeak":
12131217
loc.found = False

0 commit comments

Comments
 (0)