Skip to content

Commit fd22caf

Browse files
committed
Return on an empty schedule
1 parent b568504 commit fd22caf

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

plugwise/helper.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -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:
@@ -1259,7 +1258,10 @@ def _schedules(
12591258
# Only process the active schedule in detail for Adam or Anna with cooling
12601259
if self._cooling_present and loc_id != NONE:
12611260
locator = f'./rule[@id="{rule_id}"]/directives'
1262-
directives = self._domain_objects.find(locator)
1261+
# Show an empty schedule as no schedule found
1262+
if not (directives := self._domain_objects.find(locator)):
1263+
return available, selected, schedule_temperatures, None
1264+
12631265
for directive in directives:
12641266
entry = directive.find("then").attrib
12651267
if "setpoint" in entry:

0 commit comments

Comments
 (0)