mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
ledConfig in config, report creation and upload (#398)
* update effects * fix * try * . * Update clock.py * Update clock.py * upd * impl ledConfig * upd * fix * update * update js * fix pacman * change order of priorities
This commit is contained in:
@@ -4,10 +4,11 @@ import colorsys
|
||||
from random import randint
|
||||
|
||||
#get args
|
||||
sleepTime = float(hyperion.args.get('sleep-time', 0.3))
|
||||
rotationTime = int(hyperion.args.get('rotationTime', 8))
|
||||
marginPos = float(hyperion.args.get('margin-pos', 1.5))
|
||||
|
||||
# define pacman
|
||||
pacman = bytearray((255, 255, 1))
|
||||
pacman = bytearray((255, 255, 0))
|
||||
|
||||
# define ghosts
|
||||
redGuy = bytearray((255, 0, 0))
|
||||
@@ -18,18 +19,29 @@ slowGuy = bytearray((255, 184, 81))
|
||||
light = bytearray((255, 184, 174))
|
||||
background = bytearray((0, 0, 0))
|
||||
|
||||
#helper
|
||||
posPac = 1
|
||||
diffPac = 6*marginPos
|
||||
diffGuys = 3*marginPos
|
||||
sleepTime = rotationTime/ledCount
|
||||
|
||||
posPinkGuy = posPac + diffPac
|
||||
posBlueGuy = posPinkGuy + diffGuys
|
||||
posSlowGuy = posBlueGuy + diffGuys
|
||||
posRedGuy = posSlowGuy + diffGuys
|
||||
|
||||
# initialize the led data
|
||||
ledDataEscape = bytearray()
|
||||
for i in range(hyperion.ledCount):
|
||||
if i == 1:
|
||||
ledDataEscape += pacman
|
||||
elif i == 7:
|
||||
elif i == posPinkGuy:
|
||||
ledDataEscape += pinkGuy
|
||||
elif i == 10:
|
||||
elif i == posBlueGuy:
|
||||
ledDataEscape += blueGuy
|
||||
elif i == 13:
|
||||
elif i == posSlowGuy:
|
||||
ledDataEscape += slowGuy
|
||||
elif i == 16:
|
||||
elif i == posRedGuy:
|
||||
ledDataEscape += redGuy
|
||||
else:
|
||||
ledDataEscape += background
|
||||
@@ -38,7 +50,7 @@ ledDataChase = bytearray()
|
||||
for i in range(hyperion.ledCount):
|
||||
if i == 1:
|
||||
ledDataChase += pacman
|
||||
elif i in [7, 10, 13, 16]:
|
||||
elif i in [posPinkGuy, posBlueGuy, posSlowGuy, posRedGuy]:
|
||||
ledDataChase += bytearray((33, 33, 255))
|
||||
else:
|
||||
ledDataChase += background
|
||||
|
Reference in New Issue
Block a user