mirror of
				https://github.com/esphome/esphome.git
				synced 2025-10-30 22:53:59 +00:00 
			
		
		
		
	add "fan_mode" and "swing_mode" to REST API (#7476)
This commit is contained in:
		| @@ -1012,6 +1012,16 @@ void WebServer::handle_climate_request(AsyncWebServerRequest *request, const Url | |||||||
|       call.set_mode(mode.c_str()); |       call.set_mode(mode.c_str()); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  |     if (request->hasParam("fan_mode")) { | ||||||
|  |       auto mode = request->getParam("fan_mode")->value(); | ||||||
|  |       call.set_fan_mode(mode.c_str()); | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     if (request->hasParam("swing_mode")) { | ||||||
|  |       auto mode = request->getParam("swing_mode")->value(); | ||||||
|  |       call.set_swing_mode(mode.c_str()); | ||||||
|  |     } | ||||||
|  |  | ||||||
|     if (request->hasParam("target_temperature_high")) { |     if (request->hasParam("target_temperature_high")) { | ||||||
|       auto target_temperature_high = parse_number<float>(request->getParam("target_temperature_high")->value().c_str()); |       auto target_temperature_high = parse_number<float>(request->getParam("target_temperature_high")->value().c_str()); | ||||||
|       if (target_temperature_high.has_value()) |       if (target_temperature_high.has_value()) | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user