File tree Expand file tree Collapse file tree 2 files changed +9
-6
lines changed
Expand file tree Collapse file tree 2 files changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -76,6 +76,9 @@ def _appl_heater_central_info(
7676 xml_2 = return_valid (xml_2 , self ._domain_objects )
7777 self ._heater_id = check_heater_central (xml_2 )
7878
79+ if self ._heater_id is None :
80+ return appl
81+
7982 # Info for On-Off device
8083 if self ._on_off_device :
8184 appl .name = "OnOff" # pragma: no cover
Original file line number Diff line number Diff line change 1313 ELECTRIC_POTENTIAL_VOLT ,
1414 ENERGY_KILO_WATT_HOUR ,
1515 HW_MODELS ,
16+ NONE ,
1617 OBSOLETE_MEASUREMENTS ,
1718 PERCENTAGE ,
1819 POWER_WATT ,
@@ -95,16 +96,15 @@ def check_heater_central(xml: etree.Element) -> str:
9596 hc_list .append ({hc_id : has_actuators })
9697
9798 if not hc_list :
98- return # pragma: no cover
99+ return NONE # pragma: no cover
99100
100101 heater_central_id = list (hc_list [0 ].keys ())[0 ]
101102 if hc_count > 1 :
102103 for item in hc_list : # pragma: no cover
103- for key , value in item .items (): # pragma: no cover
104- if value : # pragma: no cover
105- heater_central_id = key # pragma: no cover
106- # Stop when a valid id is found
107- break # pragma: no cover
104+ if next (iter (item .values ())):
105+ heater_central_id = next (iter (item )) # pragma: no cover
106+ # Stop when a valid id is found
107+ break # pragma: no cover
108108
109109 return heater_central_id
110110
You can’t perform that action at this time.
0 commit comments