add "fan_mode" and "swing_mode" to REST API (#7476)

This commit is contained in:
Tarik2142 2024-09-23 00:35:57 +03:00 committed by GitHub
parent 5f7bde2a2c
commit c287673947
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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())