mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2023-10-10 13:36:59 +02:00
d3b3ce7630
Former-commit-id: b5fb724f5b07f1cd55fef620c02f285522680cf6
28 lines
705 B
Python
28 lines
705 B
Python
import hyperion
|
|
import time
|
|
import colorsys
|
|
|
|
# Get the parameters
|
|
sleepTime = float(hyperion.args.get('sleepTime', 1.0))
|
|
|
|
# Initialize the led data
|
|
ledDataOdd = bytearray()
|
|
for i in range(hyperion.ledCount):
|
|
if i%2 == 0:
|
|
ledDataOdd += bytearray((int(255), int(0), int(0)))
|
|
else:
|
|
ledDataOdd += bytearray((int(255), int(255), int(255)))
|
|
|
|
ledDataEven = bytearray()
|
|
for i in range(hyperion.ledCount):
|
|
if i%2 == 0:
|
|
ledDataEven += bytearray((int(255), int(255), int(255)))
|
|
else:
|
|
ledDataEven += bytearray((int(255), int(0), int(0)))
|
|
|
|
# Start the write data loop
|
|
while not hyperion.abort():
|
|
hyperion.setColor(ledDataOdd)
|
|
time.sleep(sleepTime)
|
|
hyperion.setColor(ledDataEven)
|
|
time.sleep(sleepTime) |