Added reconnect

This commit is contained in:
2022-10-02 18:53:54 +02:00
parent b881ca159f
commit d067c2344c

View File

@@ -39,6 +39,9 @@ def command():
if request.args.get('opts'):
opts = request.args.get('opts')
if not client.is_connected():
print("reconnection to mqtt server...")
client.connect("192.168.178.76",1884,keepalive=60)
client.publish(command,opts)
content = f"Command: {command} triggered with opts: {opts}"