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

use HSV for reading back RGB rather than HSL #10

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

treellama
Copy link

The plugin currently converts HomeKit's HSV to RGB when setting the light, but when reading it back it uses HSL. This causes round trip errors.

For instance, setting hue 120, saturation 100, brightness 100 from HomeKit converts to RGB 00ff00. But on read, using HSL, the brightness drops to 50% ( (max - min) / 2).

This pull request uses HSV for read conversions instead, which correctly converts the brightness back to 100%.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant