parent
fdc9860363
commit
5f8ab10325
7
main.py
7
main.py
|
@ -87,7 +87,7 @@ if __name__ == '__main__':
|
|||
mode = 0
|
||||
elif payload == "Custom Color":
|
||||
mode = 1
|
||||
|
||||
client.publish("server-rack-led/rgb", "255,255,255")
|
||||
|
||||
strip = Adafruit_NeoPixel(LED_COUNT, LED_PIN, LED_FREQ_HZ, LED_DMA, LED_INVERT, LED_BRIGHTNESS, LED_CHANNEL)
|
||||
strip.begin()
|
||||
|
@ -118,7 +118,10 @@ if __name__ == '__main__':
|
|||
if power == "True":
|
||||
if mode == 0:
|
||||
rainbowCycle(client, strip)
|
||||
|
||||
animation_r = 255
|
||||
animation_g = 0
|
||||
animation_b = 0
|
||||
client.publish("server-rack-led/rgb", str(animation_r)+","+str(animation_g)+","+str(animation_b))
|
||||
elif mode == 1:
|
||||
setColor(strip, Color(int(r), int(g), int(b)))
|
||||
time.sleep(1)
|
||||
|
|
Loading…
Reference in New Issue