mirror of
https://github.com/esphome/esphome.git
synced 2024-11-21 22:48:10 +01:00
add "fan_mode" and "swing_mode" to REST API (#7476)
This commit is contained in:
parent
5f7bde2a2c
commit
c287673947
1 changed files with 10 additions and 0 deletions
|
@ -1012,6 +1012,16 @@ void WebServer::handle_climate_request(AsyncWebServerRequest *request, const Url
|
|||
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")) {
|
||||
auto target_temperature_high = parse_number<float>(request->getParam("target_temperature_high")->value().c_str());
|
||||
if (target_temperature_high.has_value())
|
||||
|
|
Loading…
Reference in a new issue