1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-09 14:52:20 +01:00

Introduce parse_number() helper function (#2659)

This commit is contained in:
Oxan van Leeuwen
2021-11-10 19:15:06 +01:00
committed by GitHub
parent 219b225ac0
commit 15f9677d33
15 changed files with 70 additions and 36 deletions

View File

@@ -458,7 +458,7 @@ void WebServer::handle_fan_request(AsyncWebServerRequest *request, const UrlMatc
}
if (request->hasParam("speed_level")) {
String speed_level = request->getParam("speed_level")->value();
auto val = parse_int(speed_level.c_str());
auto val = parse_number<int>(speed_level.c_str());
if (!val.has_value()) {
ESP_LOGW(TAG, "Can't convert '%s' to number!", speed_level.c_str());
return;