kusti8 / hue-plus

A Windows and Linux driver in Python for the NZXT Hue+
GNU General Public License v3.0
229 stars 18 forks source link

Slow reaction time #31

Open 2Kreeper opened 6 years ago

2Kreeper commented 6 years ago

To be clear: I absolutely love this API. But there is one slight problem when using it: Every time you change colors, you have to wait about a second before colors change, which makes it impossible to react quickly to events like keystrokes.

But I was able to find the issue and fix it:

  1. Go to the create_command function and remove the line strips = [0, strips_info(ser, 1)-1, strips_info(ser, 2)-1]
  2. Go to the init function and add the following code at the very top:
    
    if not "INITED" in globals():
        global INITED
        INITED = False
    if INITED:
        return
    global strips
    strips = [0, strips_info(ser, 1)-1, strips_info(ser, 2)-1]```
    This stops a pretty time-intensive initialization from being called every time you change the LEDs and instead only calls it once