Die on error
This commit is contained in:
parent
9358dfc74b
commit
4b275b0f43
|
@ -8,6 +8,8 @@ from .. import mqtt
|
|||
from .constants import state_names, state
|
||||
from . import constants
|
||||
|
||||
import sys
|
||||
|
||||
class Control(util.Loggable):
|
||||
def __init__(self, config, mqtt_client=None):
|
||||
super().__init__("door")
|
||||
|
@ -156,7 +158,8 @@ class Control(util.Loggable):
|
|||
self._comm.cmd_restart()
|
||||
sleep(5)
|
||||
self._comm.cmd_close()
|
||||
self.target(state.CLOSE)
|
||||
sleep(1)
|
||||
sys.exit(1)
|
||||
else:
|
||||
self._logger().debug("Reached wrong state")
|
||||
if timeouts < 3:
|
||||
|
|
Loading…
Reference in New Issue
Block a user