if not self.pins().door_locked:
logger.info("Door unlocked, space is about to open")
return StateMachine.StateAboutToOpen(self.state_machine)
+ if not self.old_pins().space_active and self.pins().space_active:
+ logger.info("Space toggled to active while it was closed - unlocking the door")
+ return StateMachine.StateUnlocking(self.state_machine)
return super().handle_pins_event()
class AbstractUnlockedState(AbstractNonStartState):
if self.pins().door_locked:
logger.info("Door locked, closing space")
if self.pins().space_active:
- # FIXME the same state can be reached by first locking the door, and then activating the space. What to do then?
logger.warning("StateMachine: door manually locked, but space switch is still on - going to StateZu")
play_sound("manual_lock")
return StateMachine.StateZu(self.state_machine)