+ def handle_cmd_lock_event(self,arg):
+ arg("412 Precondition Failed: If not in fallback mode, use the hardware switch to lock the space.")
+ def handle_cmd_fallback_on_event(self,arg):
+ arg("200 okay: Entering fallback mode and notifying admins.")
+ logger.critical("Entering fallback mode. Somebody thinks, the hardware sensors are broken.")
+ return StateMachine.StateFallback(self.state_machine)
+ def handle_cmd_fallback_off_event(self,arg):
+ arg("412 Precondition Failed: Not in fallback mode!")
+ def handle_cmd_status_event(self,arg):
+ # TODO use a proper JSON lib
+ arg('200 okay: {state:\"%s\"}' % self.__class__.__name__)