Skip to content

Commit

Permalink
Adding optional flag to disable the blinking on connect, error, disco…
Browse files Browse the repository at this point in the history
…nnect and reconnect
  • Loading branch information
gr8kingg committed Feb 4, 2024
1 parent ecf47c9 commit bafeea7
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions listener_clients/blink1-listener/blink1-listener.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@
parser.add_argument(
"--disable-flash", action="store_true", help="Disable client listener flash"
)
parser.add_argument(
"--disable-status-blink", action="store_true", help="Disable all status light blinks"
)
parser.add_argument(
"--skip-blink1",
action="store_true",
Expand Down Expand Up @@ -155,6 +158,8 @@ def connect():
"supportsChat": False,
},
)
if args.disable_status_blink:
return
repeatNumber = 2
while repeatNumber:
repeatNumber = repeatNumber - 1
Expand All @@ -167,6 +172,8 @@ def connect():
@sio.event
def connect_error(data):
print("Unable to connect to Tally Arbiter server:", args.host, args.port)
if args.disable_status_blink:
return
doBlink(150, 150, 150)
time.sleep(0.3)
doBlink(0, 0, 0)
Expand All @@ -176,6 +183,8 @@ def connect_error(data):
@sio.event
def disconnect():
print("Disconnected from Tally Arbiter server:", args.host, args.port)
if args.disable_status_blink:
return
doBlink(255, 255, 255)
time.sleep(0.3)
doBlink(0, 0, 0)
Expand All @@ -185,6 +194,8 @@ def disconnect():
@sio.event
def reconnect():
print("Reconnected to Tally Arbiter server:", args.host, args.port)
if args.disable_status_blink:
return
repeatNumber = 2
while repeatNumber:
repeatNumber = repeatNumber - 1
Expand Down

0 comments on commit bafeea7

Please sign in to comment.