Skip to content

Commit

Permalink
revert to larger sleep when sending commands
Browse files Browse the repository at this point in the history
  • Loading branch information
gytisgreitai committed Dec 13, 2020
1 parent c72f190 commit 76ec17e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from time import sleep

def on_mqtt_connect(client, userdata, flags, rc):
logger.info('ubscribing to comfoair/action')
logger.info('subscribing to comfoair/action')
client.subscribe('comfoair/action')

def on_mqtt_message(client, userdata, msg):
Expand All @@ -17,9 +17,9 @@ def on_mqtt_message(client, userdata, msg):
command = mapping.commands[action]
logger.info('action ok, executing: %s', action)
try:
for i in range(2):
for i in range(3):
can.send(command)
sleep(0.5)
sleep(1)
except Exception as e:
logger.error('failed in send %s', e)
else:
Expand Down

0 comments on commit 76ec17e

Please sign in to comment.