Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error on Hue White bulbs #1

Closed
scruffles opened this issue Nov 23, 2019 · 9 comments
Closed

Error on Hue White bulbs #1

scruffles opened this issue Nov 23, 2019 · 9 comments
Labels
bug Something isn't working

Comments

@scruffles
Copy link

I had a bit a trouble getting huebert running without modification. It appears that three of my bulbs don't have some information expected by utils.convertHSBToColor. It returns undefined. I got it running by having it return '#ff0000' at the end of the function as a fall through. From the debugger, I can see the state passed into convertHSBToColor by LightItem includes values like this:

alert: "none"
bri: 254
mode: "homeautomation"
on: true
reachable: true

obviously no values for hue and state. This happens for 4 bulbs, and I believe they are my only white ambiance bulbs (no color to query).

@rektdeckard rektdeckard added the bug Something isn't working label Nov 23, 2019
@rektdeckard
Copy link
Owner

Thanks for that! It looks like it's an issue converting Hue's silly "Mired" color temperature scale used for non-RGB bulbs to an RGB value for the color picker, and vice versa. I though I worked this out a while ago, but I'll take another pass at it.

@rektdeckard
Copy link
Owner

rektdeckard commented Nov 23, 2019

@scruffles wait, are these bulbs Hue White bulbs, or Hue Ambiance White bulbs?

@rektdeckard
Copy link
Owner

rektdeckard commented Nov 23, 2019

I can see the state passed into convertHSBToColor by LightItem includes values like this:

alert: "none"
bri: 254
mode: "homeautomation"
on: true
reachable: true

Is this the whole state object? If not, can you post it?

@scruffles
Copy link
Author

ah.. it looks like the bulbs its having trouble with are Hue White A19. Yes, that was the whole state object

@rektdeckard
Copy link
Owner

rektdeckard commented Nov 23, 2019

Gotcha! Yeah I hadn't even thought to test this since I don't own any Hue White bulbs, but the color picker should obviously not be shown at all in this case. Hotfix incoming in the next few minutes.

@scruffles
Copy link
Author

there seems to be a related issue in RoomItem. Line 8 filters everything without a hue. If the room is all Hue White bulbs, the array is empty and line 13 throws an exception. Giving it a default keeps it running:

const textColor = compatibleText(colors[0] || '#FF0000');

@rektdeckard
Copy link
Owner

Yessir. I'll do a pass through for any other cases related to Hue White bulbs with no color or CT value.

@rektdeckard
Copy link
Owner

@scruffles Just pushed a patch, let me know if it's working for you.

@rektdeckard rektdeckard changed the title Error on Hue White Ambiance Error on Hue White bulbs Nov 23, 2019
@scruffles
Copy link
Author

looks good

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants