Die on error

main
Valentin Ochs 2022-11-24 17:23:16 +01:00
parent 9358dfc74b
commit 4b275b0f43
1 changed files with 4 additions and 1 deletions

View File

@ -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: