jfarmer08/ha-sengledapi

[Question] Possible kelvin conversion issue?

Closed this issue · 1 comments

Here, kelvin is being translated back into a percent value for the Sengled API, I believe:

async def async_color_temperature(self, color_temperature):
"""Set Color Temperature"""
color_temperature_precentage = round(
self.translate(int(color_temperature), 200, 6500, 1, 100)
)

Was the 200 actually supposed to be 2000, as shown here?

if self._support_color_temp:
self._color_temperature = round(
self.translate(
int(items.color_temperature), 0, 100, 2000, 6500
)
)

I am not a HomeAssistant user, but I am writing a similar plugin for Homebridge. This plugin's code has been tremendously helpful, so I thought I might point this out and see if it was an oversight or by design (in which case I should implement the same).

I seem to be having some color temp issues...