mirror of
https://github.com/arendst/Tasmota.git
synced 2025-08-02 07:27:42 +00:00
Fixed wrong ct results when initializing device
This commit is contained in:
parent
d2f1657e68
commit
599306a81f
@ -657,7 +657,7 @@ uint16_t LightGetColorTemp(void)
|
||||
|
||||
// for Alexa, send back the original CT value if close enough
|
||||
// avoids rounding errors
|
||||
if ((ct > _light_ct ? ct - _light_ct : _light_ct - ct) < 5)
|
||||
if ((ct > _light_ct ? ct - _light_ct : _light_ct - ct) > 5)
|
||||
_light_ct = ct;
|
||||
return _light_ct;
|
||||
}
|
||||
|
@ -592,7 +592,8 @@ void HueLightStatus1(uint8_t device, String *response)
|
||||
light_status += "\"sat\":" + String((uint8_t)(254.0f * sat + 0.5f)) + ",";
|
||||
}
|
||||
if (LST_COLDWARM == light_subtype || LST_RGBWC == light_subtype) { // white temp
|
||||
light_status += "\"ct\":" + String(ct) + ",";
|
||||
// ct = 0 is non valid, so we put 284 as default value (medium white)
|
||||
light_status += "\"ct\":" + String( (ct < 100) ? 284 : ct) + ",";
|
||||
}
|
||||
response->replace("{light_status}", light_status);
|
||||
response->replace("{m}", g_gotct?"ct":"hs");
|
||||
|
Loading…
x
Reference in New Issue
Block a user