1
0
Fork 0

driver: Wait for a sec after hard rst cmd is sent

This commit is contained in:
linuswck 2024-04-19 15:02:46 +08:00
parent 4a06a7579f
commit b73eacd234
1 changed files with 7 additions and 1 deletions

View File

@ -254,8 +254,14 @@ class Device:
""" """
Hard Reset Kirdy. The socket connection will be closed by Kirdy. Hard Reset Kirdy. The socket connection will be closed by Kirdy.
Laser diode power and Tec power will be turned off. Laser diode power and Tec power will be turned off.
Kirdy will send out a json({'msg_type': 'HardReset'}) to all sockets indicating. The device is being reset.
""" """
return await self._send_cmd(TARGET_DEVICE, "HardReset") response = await self._send_cmd(TARGET_DEVICE, "HardReset")
if response is not None:
if response["msg_type"] == "Acknowledge":
# Delay for a second to wait for the hard reset message being sent out on Kirdy
await asyncio.sleep(1.0)
return response
class Laser: class Laser:
def __init__(self, send_cmd_handler, cmd_lock): def __init__(self, send_cmd_handler, cmd_lock):