hyperion.ng/effects/x-mas.py
redPanther 5b0e401ca5 always output latest version of config file to webui (#307)
* 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
2016-12-03 21:11:52 +01:00

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)