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

Fix inversed colour temperature. #135

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

Conversation

levidhuyvetter
Copy link

The colour temperature was inversed so when you picked warm in the ui the lightbulb would turn cold and vice versa. This is because the range of 140-500 in homekit is inverse to the 0-1000 range of the lightbulb, in fact the values 140-500 are micro-reciprocal degrees (mired), which is 1,000,000 divided by the color temperature in kelvins.

I've adjusted the range conversions for colour temperature to convert to and from the range 2000K-14285K which when converted to mireds corresponds to about 70-500 inversed.

I've also added a little trick extending the colour temperature characteristics range to 70-500 in order to show a ui that has a nice orange-blue gradient. Hence I used the values 70-500 in the calculations as well.

The colour temperature was inversed so when you picked warm in the ui the lightbulb would turn cold and vice versa. This is because the range of 140-500 in homekit is inverse to the 0-1000 range of the lightbulb, in fact the values 140-500 are micro-reciprocal degrees (mired), which is 1,000,000 divided by the color temperature in kelvins.

I've adjusted the range conversions for colour temperature to convert to and from the range 2000K-14285K which when converted to mireds corresponds to about 70-500 inversed.

I've also added a little trick extending the colour temperature characteristics range to 70-500 in order to show a ui that has a nice orange-blue gradient. Hence I used the values 70-500 in the calculations as well.
@boris-dimitrov
Copy link

I look forward to seeing this fix in the release. I have noticed the same problem.

@Torpidlittle
Copy link

I also see this problem on my side!

Copy link

@Torpidlittle Torpidlittle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like a nice improvement for those who are having issue with inversed color temp. That is actually my case!

When will it be merged?

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

Successfully merging this pull request may close these issues.

3 participants