mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2023-10-10 13:36:59 +02:00
simplify effects
Former-commit-id: bbb8dc4c3852d0651eb2f4e9999e426db4a905d0
This commit is contained in:
parent
8732ffacf4
commit
e5b802c01d
@ -1,4 +1,4 @@
|
|||||||
import hyperion, time, colorsys, random, subprocess
|
import hyperion, time, subprocess
|
||||||
|
|
||||||
def setPixel(x,y,rgb):
|
def setPixel(x,y,rgb):
|
||||||
global imageData, width
|
global imageData, width
|
||||||
@ -17,8 +17,6 @@ width = 12
|
|||||||
height = 10
|
height = 10
|
||||||
|
|
||||||
imageData = bytearray(height * width * (0,0,0))
|
imageData = bytearray(height * width * (0,0,0))
|
||||||
imageDataBlack = bytearray(height * width * (0,0,0))
|
|
||||||
imageDataRed = bytearray(height * width * alarmColor)
|
|
||||||
|
|
||||||
# Start the write data loop
|
# Start the write data loop
|
||||||
for i in range(6):
|
for i in range(6):
|
||||||
@ -26,9 +24,9 @@ for i in range(6):
|
|||||||
off = False
|
off = False
|
||||||
break
|
break
|
||||||
if i % 2:
|
if i % 2:
|
||||||
hyperion.setImage(width, height, imageDataRed)
|
hyperion.setColor(alarmColor[0], alarmColor[1], alarmColor[2])
|
||||||
else:
|
else:
|
||||||
hyperion.setImage(width, height, imageDataBlack)
|
hyperion.setColor(0, 0, 0)
|
||||||
time.sleep(sleepTime)
|
time.sleep(sleepTime)
|
||||||
|
|
||||||
for y in range(height,0,-1):
|
for y in range(height,0,-1):
|
||||||
|
@ -1,6 +1,4 @@
|
|||||||
import hyperion
|
import hyperion, time
|
||||||
import time
|
|
||||||
import colorsys
|
|
||||||
|
|
||||||
# Get the rotation time
|
# Get the rotation time
|
||||||
color = hyperion.args.get('color', (255,255,255))
|
color = hyperion.args.get('color', (255,255,255))
|
||||||
@ -12,13 +10,9 @@ frequency = min(100.0, frequency)
|
|||||||
# Compute the strobe interval
|
# Compute the strobe interval
|
||||||
sleepTime = 1.0 / frequency
|
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
|
# Start the write data loop
|
||||||
while not hyperion.abort():
|
while not hyperion.abort():
|
||||||
hyperion.setColor(blackLedsData)
|
hyperion.setColor(0, 0, 0)
|
||||||
time.sleep(sleepTime)
|
time.sleep(sleepTime)
|
||||||
hyperion.setColor(whiteLedsData)
|
hyperion.setColor(color[0], color[1], color[2])
|
||||||
time.sleep(sleepTime)
|
time.sleep(sleepTime)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user