mirror of
https://github.com/esphome/esphome.git
synced 2024-11-13 02:37:47 +01:00
Fix web server transition length truncated (#807)
Fixes https://github.com/esphome/issues/issues/772
This commit is contained in:
parent
847fe5adca
commit
82a30558e1
1 changed files with 8 additions and 4 deletions
|
@ -416,11 +416,15 @@ void WebServer::handle_light_request(AsyncWebServerRequest *request, UrlMatch ma
|
|||
if (request->hasParam("color_temp"))
|
||||
call.set_color_temperature(request->getParam("color_temp")->value().toFloat());
|
||||
|
||||
if (request->hasParam("flash"))
|
||||
call.set_flash_length((uint32_t) request->getParam("flash")->value().toFloat() * 1000);
|
||||
if (request->hasParam("flash")) {
|
||||
float length_s = request->getParam("flash")->value().toFloat();
|
||||
call.set_flash_length(static_cast<uint32_t>(length_s * 1000));
|
||||
}
|
||||
|
||||
if (request->hasParam("transition"))
|
||||
call.set_transition_length((uint32_t) request->getParam("transition")->value().toFloat() * 1000);
|
||||
if (request->hasParam("transition")) {
|
||||
float length_s = request->getParam("transition")->value().toFloat();
|
||||
call.set_transition_length(static_cast<uint32_t>(length_s * 1000));
|
||||
}
|
||||
|
||||
if (request->hasParam("effect")) {
|
||||
const char *effect = request->getParam("effect")->value().c_str();
|
||||
|
|
Loading…
Reference in a new issue