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

Add temperature scaling for Tuya lights #17

Open
wants to merge 21 commits into
base: master
Choose a base branch
from

Conversation

louisjennings
Copy link

This is a pull request to resolve issue #16.

As far as I can tell, rather than using the CTL Temperature field to directly set the temperature of the light, it maps the value of temperature from 800 to 20,000 K to a temperature between its own minimum and maximum (say 3,000 and 6,000 K for simplicity). As an equation:

light_temperature = 3000 + (message_temperature-800) * (6000-3000) / (20,000-800)

In effect this means that changing the temperature within the 3000 K to 6000 K exposed in the UI results in negligible change in the output colour (~3340 to ~3810 K).

The fix applies the inverse scaling function when a configuration variable is set to true. The pull request also includes changes from another fork (upon which my fork is based).

@louisjennings louisjennings changed the title Temperature scaling Add temperature scaling for Tuya lights Aug 11, 2023
@dominikberse
Copy link
Owner

Sorry for the late reply, I did not have the time to look into this project lately.

I would like to merge this if possible, but I currently don't have the time to look into the conflict. If you are still interested in merging this, I would appreciate it, if you had a look at this. Also, I assume this will use the python-bluetooth-mesh branch by Minims?

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