diff --git a/custom_components/irrigation_unlimited/irrigation_unlimited.py b/custom_components/irrigation_unlimited/irrigation_unlimited.py index 23f5ee3..3eb7d14 100644 --- a/custom_components/irrigation_unlimited/irrigation_unlimited.py +++ b/custom_components/irrigation_unlimited/irrigation_unlimited.py @@ -538,7 +538,7 @@ def find_last_by_id(self, id: int) -> IURun: last_time: datetime = None last_index: int = None for i, run in enumerate(self): - if run.parent.id == id: + if run.parent is not None and run.parent.id == id: if last_time is None or run.end_time > last_time: last_time = run.end_time last_index = i