Skip to content
This repository was archived by the owner on Jan 13, 2023. It is now read-only.

Commit

Permalink
Remove magic numbers
Browse files Browse the repository at this point in the history
  • Loading branch information
weshouman committed Sep 5, 2019
1 parent 5e5abaf commit 4eaeee2
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions roles/leds-blinkstick/templates/dramble-node-monitor.j2
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@ import urllib2
import time
import sys, signal

# Follow https://www.blinkstick.com/help/tutorials/blinkstick-pro-modes
NORMAL_MODE = 0
INVERSE_MODE = 1
WS2812_MODE = 2

# Turn-on per second
PERIODICIY = 0.05

# Class to handle SIGINT/SIGTERM gracefully.
class GracefulKiller:
kill_now = False
Expand Down Expand Up @@ -55,8 +63,8 @@ def update_blinkenlights(nano):

# Main.
nano = blinkstick.find_first()
nano.set_mode(3)
time.sleep(0.05)
nano.set_mode(NORMAL_MODE)
time.sleep(PERIODICIY)
killer = GracefulKiller()
while True:
try:
Expand Down

0 comments on commit 4eaeee2

Please sign in to comment.