removed animation

Signed-off-by: Ebbe Baß <ebbe@ping-mee.de>
master
Ebbe Baß 2022-07-02 10:31:26 +02:00
parent ff00a9c77d
commit 7c18a6e1c3
1 changed files with 3 additions and 5 deletions

View File

@ -35,20 +35,18 @@ def debug_print(message: str):
current_time = now.strftime("%H:%M:%S")
print('[DEBUG]['+current_time+'] '+message)
def wheel(client, pos):
def wheel(pos):
if pos < 85:
# client.publish("server-rack-led/rgb", str(pos * 3)+","+str(255 - pos * 3)+","+str(0))
return Color(pos * 3, 255 - pos * 3, 0)
elif pos < 170:
pos -= 85
# client.publish("server-rack-led/rgb", str(255 - pos * 3)+","+str(0)+","+str(pos * 3))
return Color(255 - pos * 3, 0, pos * 3)
else:
pos -= 170
client.publish("server-rack-led/rgb", str(0)+","+str(pos * 3)+","+str(255 - pos * 3))
return Color(0, pos * 3, 255 - pos * 3)
def rainbowCycle(client, strip, wait_ms=5, iterations=10):
def rainbowCycle( strip, wait_ms=5, iterations=10):
for j in range(256*iterations):
if mode > 0:
break
@ -126,7 +124,7 @@ if __name__ == '__main__':
while True:
if power == "True":
if mode == 0:
rainbowCycle(client, strip)
rainbowCycle(strip)
elif mode == 1:
setColor(strip, Color(int(r), int(g), int(b)))
time.sleep(1)