Abort bed wait after storm ends during daytime
This commit is contained in:
1 parent
31ace76365
commit
5c016e961c
1 file changed
+4
-7
@@ -47,7 +47,6 @@ class SleepWithBedStates(WorkBoundaryReturnMixin):
|
|||||||
self.waiting_for_time_update = False
|
self.waiting_for_time_update = False
|
||||||
|
|
||||||
current_time = self.g.get('time')
|
current_time = self.g.get('time')
|
||||||
self.sleep_attempt_started_at = current_time
|
|
||||||
if ((current_time is None or current_time < 12000) and
|
if ((current_time is None or current_time < 12000) and
|
||||||
not self._is_thunderstorm()):
|
not self._is_thunderstorm()):
|
||||||
print('Aborting sleep, not night or thunderstorm')
|
print('Aborting sleep, not night or thunderstorm')
|
||||||
@@ -463,13 +462,12 @@ class SleepWithBedStates(WorkBoundaryReturnMixin):
|
|||||||
print('Bed became occupied before use:', self.area)
|
print('Bed became occupied before use:', self.area)
|
||||||
self.state = self.choose_bed
|
self.state = self.choose_bed
|
||||||
return
|
return
|
||||||
if current_time < 12550 and not self._is_thunderstorm():
|
if (current_time < 12000 and not self._is_thunderstorm()):
|
||||||
if (self.sleep_attempt_started_at is not None and
|
print('Daytime without a thunderstorm before bed use; '
|
||||||
self.sleep_attempt_started_at >= 12000 and
|
'resuming the job')
|
||||||
current_time < 12000):
|
|
||||||
print('Night ended before bed use; resuming the job')
|
|
||||||
self.state = self.cleanup
|
self.state = self.cleanup
|
||||||
return
|
return
|
||||||
|
if current_time < 12550 and not self._is_thunderstorm():
|
||||||
if not getattr(self, 'waiting_for_night', False):
|
if not getattr(self, 'waiting_for_night', False):
|
||||||
print('Bed reached; waiting until sleep time (time={})'.format(
|
print('Bed reached; waiting until sleep time (time={})'.format(
|
||||||
current_time))
|
current_time))
|
||||||
@@ -619,7 +617,6 @@ class SleepWithBedStates(WorkBoundaryReturnMixin):
|
|||||||
self.sleep_confirmed = False
|
self.sleep_confirmed = False
|
||||||
self.work_policies = []
|
self.work_policies = []
|
||||||
self.sleep_deadline = 0
|
self.sleep_deadline = 0
|
||||||
self.sleep_attempt_started_at = None
|
|
||||||
self.refuge_sign = None
|
self.refuge_sign = None
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
|
|||||||
Reference in new issue
Block a user