mirror of
				https://github.com/esphome/esphome.git
				synced 2025-11-04 09:01:49 +00:00 
			
		
		
		
	Fix web server transition length truncated (#807)
Fixes https://github.com/esphome/issues/issues/772
This commit is contained in:
		@@ -416,11 +416,15 @@ void WebServer::handle_light_request(AsyncWebServerRequest *request, UrlMatch ma
 | 
				
			|||||||
      if (request->hasParam("color_temp"))
 | 
					      if (request->hasParam("color_temp"))
 | 
				
			||||||
        call.set_color_temperature(request->getParam("color_temp")->value().toFloat());
 | 
					        call.set_color_temperature(request->getParam("color_temp")->value().toFloat());
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      if (request->hasParam("flash"))
 | 
					      if (request->hasParam("flash")) {
 | 
				
			||||||
        call.set_flash_length((uint32_t) request->getParam("flash")->value().toFloat() * 1000);
 | 
					        float length_s = request->getParam("flash")->value().toFloat();
 | 
				
			||||||
 | 
					        call.set_flash_length(static_cast<uint32_t>(length_s * 1000));
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      if (request->hasParam("transition"))
 | 
					      if (request->hasParam("transition")) {
 | 
				
			||||||
        call.set_transition_length((uint32_t) request->getParam("transition")->value().toFloat() * 1000);
 | 
					        float length_s = request->getParam("transition")->value().toFloat();
 | 
				
			||||||
 | 
					        call.set_transition_length(static_cast<uint32_t>(length_s * 1000));
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      if (request->hasParam("effect")) {
 | 
					      if (request->hasParam("effect")) {
 | 
				
			||||||
        const char *effect = request->getParam("effect")->value().c_str();
 | 
					        const char *effect = request->getParam("effect")->value().c_str();
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user