add error handling for iterate-lights
This commit is contained in:
parent
8ba6fcfa82
commit
a6e3d6a742
1 changed files with 14 additions and 7 deletions
9
bin/rzr
9
bin/rzr
|
|
@ -121,7 +121,7 @@ def iterate_lights():
|
|||
device.fx.none()
|
||||
device.fx.advanced.draw()
|
||||
|
||||
# Iterate through device matrices and turn on one light every second
|
||||
# Iterate through all devices
|
||||
for device in device_manager.devices:
|
||||
|
||||
# Wait five seconds
|
||||
|
|
@ -129,6 +129,9 @@ def iterate_lights():
|
|||
print("{} will be iterated in {} seconds".format(device.name, i))
|
||||
time.sleep(1)
|
||||
|
||||
try:
|
||||
|
||||
# Turn on one light every second
|
||||
for i in range(device.fx.advanced.rows):
|
||||
for j in range(device.fx.advanced.cols):
|
||||
device.fx.advanced.matrix[i, j] = (255, 255, 255)
|
||||
|
|
@ -136,6 +139,10 @@ def iterate_lights():
|
|||
print("{}: [{}, {}]".format(device.name, i, j))
|
||||
time.sleep(1)
|
||||
|
||||
except Exception as e:
|
||||
error("failed to iterate device '{}': {}".format(device.name, e))
|
||||
exit(1)
|
||||
|
||||
|
||||
def list_devices():
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue