1
0
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:
Otto Winter
2021-10-22 16:52:43 +02:00
committed by GitHub
parent 83bef85415
commit 6db9d1122f
6 changed files with 30 additions and 7 deletions

View File

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