@@ -792,7 +792,6 @@ def _presets(self, loc_id: str) -> dict[str, list[float]]:
792792 directives : etree = self ._domain_objects .find (
793793 f'rule[@id="{ rule_id } "]/directives'
794794 )
795-
796795 for directive in directives :
797796 preset = directive .find ("then" ).attrib
798797 if "setpoint" in preset :
@@ -981,9 +980,11 @@ def _get_appliance_data(self, d_id: str) -> DeviceData:
981980 if all (item in data for item in ("cooling_ena_switch" , "cooling_enabled" )):
982981 data .pop ("cooling_enabled" )
983982
984- # Don't show cooling_state when no cooling present
985- if not self ._cooling_present and "cooling_state" in data :
986- data .pop ("cooling_state" )
983+ # Don't show cooling-related when no cooling present
984+ if not self ._cooling_present :
985+ for item in ("cooling_state" , "cooling_ena_switch" , "cooling_enabled" ):
986+ if item in data :
987+ data .pop (item )
987988
988989 return cast (DeviceData , data )
989990
@@ -1254,10 +1255,13 @@ def _schedules(
12541255 for rule_id , loc_id in rule_ids .items ():
12551256 name = self ._domain_objects .find (f'./rule[@id="{ rule_id } "]/name' ).text
12561257 schedule : dict [str , list [float ]] = {}
1258+ locator = f'./rule[@id="{ rule_id } "]/directives'
1259+ # Show an empty schedule as no schedule found
1260+ if not (directives := self ._domain_objects .find (locator )):
1261+ continue
1262+
12571263 # Only process the active schedule in detail for Adam or Anna with cooling
12581264 if self ._cooling_present and loc_id != NONE :
1259- locator = f'./rule[@id="{ rule_id } "]/directives'
1260- directives = self ._domain_objects .find (locator )
12611265 for directive in directives :
12621266 entry = directive .find ("then" ).attrib
12631267 if "setpoint" in entry :
0 commit comments