mirror of
https://github.com/esphome/esphome.git
synced 2025-10-06 20:03:46 +01:00
Fix compiler warnings and update platformio line filter (#2607)
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user