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 Otto winter
parent dfb96e4b7f
commit 6bdae55ee1
No known key found for this signature in database
GPG Key ID: 48ED2DDB96D7682C
6 changed files with 30 additions and 7 deletions

View File

@ -440,7 +440,11 @@ void Climate::set_visual_max_temperature_override(float visual_max_temperature_o
void Climate::set_visual_temperature_step_override(float visual_temperature_step_override) {
this->visual_temperature_step_override_ = visual_temperature_step_override;
}
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
Climate::Climate(const std::string &name) : EntityBase(name) {}
#pragma GCC diagnostic pop
Climate::Climate() : Climate("") {}
ClimateCall Climate::make_call() { return ClimateCall(this); }

View File

@ -88,9 +88,12 @@ void MQTTFanComponent::setup() {
if (this->state_->get_traits().supports_speed()) {
this->subscribe(this->get_speed_command_topic(), [this](const std::string &topic, const std::string &payload) {
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
this->state_->make_call()
.set_speed(payload.c_str()) // NOLINT(clang-diagnostic-deprecated-declarations)
.perform();
#pragma GCC diagnostic pop
});
}
@ -145,6 +148,8 @@ bool MQTTFanComponent::publish_state() {
}
if (traits.supports_speed()) {
const char *payload;
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
// NOLINTNEXTLINE(clang-diagnostic-deprecated-declarations)
switch (fan::speed_level_to_enum(this->state_->speed, traits.supported_speed_count())) {
case FAN_SPEED_LOW: { // NOLINT(clang-diagnostic-deprecated-declarations)
@ -161,6 +166,7 @@ bool MQTTFanComponent::publish_state() {
break;
}
}
#pragma GCC diagnostic pop
bool success = this->publish(this->get_speed_state_topic(), payload);
failed = failed || !success;
}

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

View File

@ -28,4 +28,4 @@ async def to_code(config):
cg.add_library("FS", None)
cg.add_library("Update", None)
# https://github.com/esphome/ESPAsyncWebServer/blob/master/library.json
cg.add_library("esphome/ESPAsyncWebServer-esphome", "1.3.1")
cg.add_library("esphome/ESPAsyncWebServer-esphome", "2.0.0")

View File

@ -46,24 +46,31 @@ IGNORE_LIB_WARNINGS = f"(?:{'|'.join(['Hash', 'Update'])})"
FILTER_PLATFORMIO_LINES = [
r"Verbose mode can be enabled via `-v, --verbose` option.*",
r"CONFIGURATION: https://docs.platformio.org/.*",
r"PLATFORM: .*",
r"DEBUG: Current.*",
r"PACKAGES: .*",
r"LDF Modes:.*",
r"LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf.*",
r"LDF Modes: Finder ~ chain, Compatibility ~ soft.*",
f"Looking for {IGNORE_LIB_WARNINGS} library in registry",
f"Warning! Library `.*'{IGNORE_LIB_WARNINGS}.*` has not been found in PlatformIO Registry.",
f"You can ignore this message, if `.*{IGNORE_LIB_WARNINGS}.*` is a built-in library.*",
r"Scanning dependencies...",
r"Found \d+ compatible libraries",
r"Memory Usage -> http://bit.ly/pio-memory-usage",
r"esptool.py v.*",
r"Found: https://platformio.org/lib/show/.*",
r"Using cache: .*",
r"Installing dependencies",
r".* @ .* is already installed",
r"Library Manager: Already installed, built-in library",
r"Building in .* mode",
r"Advanced Memory Usage is available via .*",
r"Merged .* ELF section",
r"esptool.py v.*",
r"Checking size .*",
r"Retrieving maximum program size .*",
r"PLATFORM: .*",
r"PACKAGES:.*",
r" - framework-arduinoespressif.* \(.*\)",
r" - tool-esptool.* \(.*\)",
r" - toolchain-.* \(.*\)",
r"Creating BIN file .*",
]

View File

@ -41,7 +41,7 @@ lib_deps =
${common.lib_deps}
ottowinter/AsyncMqttClient-esphome@0.8.6 ; mqtt
ottowinter/ArduinoJson-esphomelib@5.13.3 ; json
esphome/ESPAsyncWebServer-esphome@1.3.1 ; web_server_base
esphome/ESPAsyncWebServer-esphome@2.0.0 ; web_server_base
fastled/FastLED@3.3.2 ; fastled_base
mikalhart/TinyGPSPlus@1.0.2 ; gps
freekode/TM1651@1.0.1 ; tm1651