add error handling for iterate-lights
This commit is contained in:
parent
8ba6fcfa82
commit
a6e3d6a742
1 changed files with 14 additions and 7 deletions
21
bin/rzr
21
bin/rzr
|
|
@ -121,7 +121,7 @@ def iterate_lights():
|
||||||
device.fx.none()
|
device.fx.none()
|
||||||
device.fx.advanced.draw()
|
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:
|
for device in device_manager.devices:
|
||||||
|
|
||||||
# Wait five seconds
|
# Wait five seconds
|
||||||
|
|
@ -129,12 +129,19 @@ def iterate_lights():
|
||||||
print("{} will be iterated in {} seconds".format(device.name, i))
|
print("{} will be iterated in {} seconds".format(device.name, i))
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
|
|
||||||
for i in range(device.fx.advanced.rows):
|
try:
|
||||||
for j in range(device.fx.advanced.cols):
|
|
||||||
device.fx.advanced.matrix[i, j] = (255, 255, 255)
|
# Turn on one light every second
|
||||||
device.fx.advanced.draw()
|
for i in range(device.fx.advanced.rows):
|
||||||
print("{}: [{}, {}]".format(device.name, i, j))
|
for j in range(device.fx.advanced.cols):
|
||||||
time.sleep(1)
|
device.fx.advanced.matrix[i, j] = (255, 255, 255)
|
||||||
|
device.fx.advanced.draw()
|
||||||
|
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():
|
def list_devices():
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue