mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2023-10-10 13:36:59 +02:00
1161748013
Former-commit-id: b951ab714019518cfcbb1550e49b41de649b535c
25 lines
616 B
Python
25 lines
616 B
Python
import hyperion
|
|
import time
|
|
import colorsys
|
|
|
|
# Get the rotation time
|
|
color = hyperion.args.get('color', (255,255,255))
|
|
frequency = float(hyperion.args.get('frequency', 10.0))
|
|
|
|
# Check parameters
|
|
frequency = min(100.0, frequency)
|
|
|
|
# Compute the strobe interval
|
|
sleepTime = 1.0 / frequency
|
|
|
|
# Initialize the led data
|
|
blackLedsData = bytearray(hyperion.ledCount * ( 0, 0, 0))
|
|
whiteLedsData = bytearray(hyperion.ledCount * color)
|
|
|
|
# Start the write data loop
|
|
while not hyperion.abort():
|
|
hyperion.setColor(blackLedsData)
|
|
time.sleep(sleepTime)
|
|
hyperion.setColor(whiteLedsData)
|
|
time.sleep(sleepTime)
|