Skip to content

Commit d8ce80f

Browse files
committed
Implement another suggest and adapt
1 parent 326956f commit d8ce80f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

plugwise/util.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
ELECTRIC_POTENTIAL_VOLT,
1414
ENERGY_KILO_WATT_HOUR,
1515
HW_MODELS,
16+
LOGGER,
1617
OBSOLETE_MEASUREMENTS,
1718
PERCENTAGE,
1819
POWER_WATT,
@@ -28,7 +29,7 @@
2829
SpecialType,
2930
SwitchType,
3031
)
31-
32+
from plugwise.exceptions import DataMissingError
3233
from defusedxml import ElementTree as etree
3334
from munch import Munch
3435

@@ -93,6 +94,9 @@ def check_heater_central(xml: etree.Element) -> str:
9394
if heater_central.find("name").text == "Central heating boiler":
9495
hc_list.append({hc_id: has_actuators})
9596

97+
if not hc_list:
98+
raise DataMissingError("No Central heating boiler found, please create an Issue")
99+
96100
heater_central_id = list(hc_list[0].keys())[0]
97101
if hc_count > 1:
98102
for item in hc_list: # pragma: no cover

0 commit comments

Comments
 (0)