diff --git a/main.py b/main.py index 8f03a64..044c538 100644 --- a/main.py +++ b/main.py @@ -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)