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 round() to translate between mired and kelvin #1207

Conversation

JonathanKang
Copy link
Contributor

The color temperature range for my light is 2700 - 6500. With previous kelvin to mired translation, color temperature range shown in the entity is 2702 - 6535. The max color temperature has exceeded what the device is capable of.

Using round() for the translation, the end result is 2702 - 6493. So it seems to be reasonable to use round() instead of int().

@AlexxIT
Copy link
Owner

AlexxIT commented Nov 9, 2023

As I remember, Hass uses int for this calculations. This situation should be investigate more carefully.

@JonathanKang
Copy link
Contributor Author

Right. Hass uses Math.floor() for the translation. Xiaomi Miot Auto uses round() though. It's sure this needs more investigation. Closing this.

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.

2 participants