mirror of
https://github.com/esphome/esphome.git
synced 2025-09-09 23:02:23 +01:00
Fix compiler warnings and update platformio line filter (#2607)
This commit is contained in:
@@ -414,6 +414,8 @@ std::string WebServer::fan_json(fan::FanState *obj) {
|
||||
const auto traits = obj->get_traits();
|
||||
if (traits.supports_speed()) {
|
||||
root["speed_level"] = obj->speed;
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
||||
// NOLINTNEXTLINE(clang-diagnostic-deprecated-declarations)
|
||||
switch (fan::speed_level_to_enum(obj->speed, traits.supported_speed_count())) {
|
||||
case fan::FAN_SPEED_LOW: // NOLINT(clang-diagnostic-deprecated-declarations)
|
||||
@@ -426,6 +428,7 @@ std::string WebServer::fan_json(fan::FanState *obj) {
|
||||
root["speed"] = "high";
|
||||
break;
|
||||
}
|
||||
#pragma GCC diagnostic pop
|
||||
}
|
||||
if (obj->get_traits().supports_oscillation())
|
||||
root["oscillation"] = obj->oscillating;
|
||||
@@ -448,7 +451,10 @@ void WebServer::handle_fan_request(AsyncWebServerRequest *request, const UrlMatc
|
||||
auto call = obj->turn_on();
|
||||
if (request->hasParam("speed")) {
|
||||
String speed = request->getParam("speed")->value();
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
||||
call.set_speed(speed.c_str()); // NOLINT(clang-diagnostic-deprecated-declarations)
|
||||
#pragma GCC diagnostic pop
|
||||
}
|
||||
if (request->hasParam("speed_level")) {
|
||||
String speed_level = request->getParam("speed_level")->value();
|
||||
|
Reference in New Issue
Block a user