Skip to content

Commit

Permalink
Sleep for a short while between reads
Browse files Browse the repository at this point in the history
  • Loading branch information
kylegordon committed Oct 22, 2012
1 parent ce85adf commit 47ceb4f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions mqtt-gpio-trigger.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ def main_loop():
logging.debug("Publishing state change. Pin %s changed from %s to %s", str(PINS[index][0]), str(PINS[index][1]), str(state))
PINS[index][1] = state
mqttc.publish("/raw/" + socket.getfqdn() + "/gpio/" + str(PINS[index][0]), str(state))
time.sleep(1)

# Use the signal module to handle signals
signal.signal(signal.SIGTERM, cleanup)
Expand Down

0 comments on commit 47ceb4f

Please sign in to comment.