mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2023-10-10 13:36:59 +02:00
5b0e401ca5
* always output latest version of config file to webui * fix permissions after default config export * tune code * set permissions for exported effects * use qt setperm instead of chmod update effects code style a bit * add fallback when config is not readable
26 lines
693 B
Python
26 lines
693 B
Python
import hyperion, time, 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) |