From 23082ed1e9ca7d025c7d3b3f2efaf12c0e479059 Mon Sep 17 00:00:00 2001 From: Lukas Baecker Date: Fri, 29 Nov 2024 14:17:40 +0100 Subject: [PATCH] fixing bumper condition --- field_friend/automations/automation_watcher.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/field_friend/automations/automation_watcher.py b/field_friend/automations/automation_watcher.py index ddd043b7..ba6580cd 100644 --- a/field_friend/automations/automation_watcher.py +++ b/field_friend/automations/automation_watcher.py @@ -86,8 +86,9 @@ def stop(self, reason: str) -> None: def try_resume(self) -> None: # Set conditions to True by default, which means they don't block the process if the watch is not active - if self.field_friend.bumper is not None: - bumper_condition = not bool(self.field_friend.bumper.active_bumpers) if self.bumper_watch_active else True + bumper_condition = True + if self.field_friend.bumper is not None and self.bumper_watch_active: + bumper_condition = not bool(self.field_friend.bumper.active_bumpers) gnss_condition = (self.gnss.current is not None and ('R' in self.gnss.current.mode or self.gnss.current.mode == 'SSSS')) \ if self.gnss_watch_active else True