benknight / hue-alfred-workflow

An Alfred workflow for controlling Philips Hue lights.
367 stars 34 forks source link

Colorpicker claims hex code is invalid #44

Closed samling closed 4 years ago

samling commented 6 years ago

Just installed this workflow and I love it so far, but I've run into an issue with the colorpicker. When I enter any hex or name value for an individual lamp's color, I get back Error: Invalid color. Please use a 6-digit hex color. Setting the color for a group seems to work fine.

I don't know much about making Alfred workflows, particularly which python it's using, but I've got 3.7 as my default, installed via Homebrew. Scenes work fine, and I tried to dig through colors.py and actions.py to figure out where the issue may be, but everything looks ok to me. Debugger didn't yield much. If there's anything else I can provide that'll help diagnose the issue, please let me know.

benknight commented 6 years ago

This is usually because the script filter is too slow to keep up with your keystrokes. Can you see if typing the color name, then waiting a moment before hitting and enter solves the issue?

If that does end up being why, then it's a known bug.

samling commented 6 years ago

@benknight Unfortunately I've already tested this, I found a closed issue that referenced the bug and waited a good 10-15 seconds after typing before hitting enter. I tried again just now to double-check, but still the same issue.

brichards commented 6 years ago

Firstly, what a cool utility! Thanks for maintaining it, @benknight!

I'm adding my voice to say I'm experiencing this, too. I'm running OS X 10.14.1, Alfred 3.7, and Python 2.7.10.

I don't strictly need this feature at the moment, since my current use case will allow me to simply change the scene, but I did want to add a +1 to the bug occurring and offer up my time to help troubleshoot and debug if that's useful to you @benknight.

brichards commented 6 years ago

Breakthrough!

After poking around a bit in colors.py and changing get_light_gamut() to manually return each of the different gamuts in turn I realized the issue is that my light isn't among any of the definitions.

I have an LCT016 bulb, which belongs to Gamut C according to https://developers.meethue.com/develop/hue-api/supported-devices/. I'm going to submit a PR to account for this bulb and double check the other gamuts to look for other newer bulbs.

@samling Do you happen to know which bulb(s) you are trying to color change?

samling commented 6 years ago

@brichards I am indeed using LCT016 bulbs. Great find!

benknight commented 5 years ago

Thanks for the help guys, I'll cut a new version

benknight commented 5 years ago

@brichards @samling can you guys try out this prerelease and tell me if it fixes the issue:

https://github.com/benknight/hue-alfred-workflow/releases/tag/v3.0.1

Thanks!