Abort bed wait after storm ends during daytime

This commit is contained in:
Tanner committed 2026-11-19 19:48:15 +00:00
1 parent 31ace76365
commit 5c016e961c
1 file changed
+5 -8
+5 -8
View File
@@ -47,7 +47,6 @@ class SleepWithBedStates(WorkBoundaryReturnMixin):
self.waiting_for_time_update = False
current_time = self.g.get('time')
self.sleep_attempt_started_at = current_time
if ((current_time is None or current_time < 12000) and
not self._is_thunderstorm()):
print('Aborting sleep, not night or thunderstorm')
@@ -463,13 +462,12 @@ class SleepWithBedStates(WorkBoundaryReturnMixin):
print('Bed became occupied before use:', self.area)
self.state = self.choose_bed
return
if (current_time < 12000 and not self._is_thunderstorm()):
print('Daytime without a thunderstorm before bed use; '
'resuming the job')
self.state = self.cleanup
return
if current_time < 12550 and not self._is_thunderstorm():
if (self.sleep_attempt_started_at is not None and
self.sleep_attempt_started_at >= 12000 and
current_time < 12000):
print('Night ended before bed use; resuming the job')
self.state = self.cleanup
return
if not getattr(self, 'waiting_for_night', False):
print('Bed reached; waiting until sleep time (time={})'.format(
current_time))
@@ -619,7 +617,6 @@ class SleepWithBedStates(WorkBoundaryReturnMixin):
self.sleep_confirmed = False
self.work_policies = []
self.sleep_deadline = 0
self.sleep_attempt_started_at = None
self.refuge_sign = None
def run(self):