Use multi-byte commands to enable position reporting
This commit is contained in:
parent
eccf936f6c
commit
69c823ec52
|
@ -160,7 +160,7 @@ class DoorControl:
|
|||
"""Opens the serial port controlling the door opener. config must have a serial_port member."""
|
||||
try:
|
||||
self.serial_port = serial.Serial(config.serial_port, timeout=2)
|
||||
self._send_door_cmd(b'r')
|
||||
self._send_door_cmd(b'>r1\n')
|
||||
except:
|
||||
self.serial_port = None
|
||||
return self.serial_port
|
||||
|
@ -224,7 +224,7 @@ class DoorControl:
|
|||
def _check_reporting(self, current: int):
|
||||
if current == 0:
|
||||
self.logger.info("Turning position reporting on")
|
||||
self._send_door_cmd(b'r')
|
||||
self._send_door_cmd(b'>r1\n')
|
||||
else:
|
||||
self.logger.info("Position reporting is on")
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user