diff --git a/esphome/core/component.cpp b/esphome/core/component.cpp index decd080976d..2f61f7d1950 100644 --- a/esphome/core/component.cpp +++ b/esphome/core/component.cpp @@ -118,7 +118,10 @@ void Component::setup() {} void Component::loop() {} void Component::set_interval(const std::string &name, uint32_t interval, std::function &&f) { // NOLINT +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" App.scheduler.set_interval(this, name, interval, std::move(f)); +#pragma GCC diagnostic pop } void Component::set_interval(const char *name, uint32_t interval, std::function &&f) { // NOLINT @@ -126,7 +129,10 @@ void Component::set_interval(const char *name, uint32_t interval, std::function< } bool Component::cancel_interval(const std::string &name) { // NOLINT +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" return App.scheduler.cancel_interval(this, name); +#pragma GCC diagnostic pop } bool Component::cancel_interval(const char *name) { // NOLINT @@ -135,7 +141,10 @@ bool Component::cancel_interval(const char *name) { // NOLINT void Component::set_retry(const std::string &name, uint32_t initial_wait_time, uint8_t max_attempts, std::function &&f, float backoff_increase_factor) { // NOLINT +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" App.scheduler.set_retry(this, name, initial_wait_time, max_attempts, std::move(f), backoff_increase_factor); +#pragma GCC diagnostic pop } void Component::set_retry(const char *name, uint32_t initial_wait_time, uint8_t max_attempts, @@ -144,7 +153,10 @@ void Component::set_retry(const char *name, uint32_t initial_wait_time, uint8_t } bool Component::cancel_retry(const std::string &name) { // NOLINT +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" return App.scheduler.cancel_retry(this, name); +#pragma GCC diagnostic pop } bool Component::cancel_retry(const char *name) { // NOLINT @@ -152,7 +164,10 @@ bool Component::cancel_retry(const char *name) { // NOLINT } void Component::set_timeout(const std::string &name, uint32_t timeout, std::function &&f) { // NOLINT +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" App.scheduler.set_timeout(this, name, timeout, std::move(f)); +#pragma GCC diagnostic pop } void Component::set_timeout(const char *name, uint32_t timeout, std::function &&f) { // NOLINT @@ -160,7 +175,10 @@ void Component::set_timeout(const char *name, uint32_t timeout, std::function &&f) { // NOLINT App.scheduler.set_timeout(this, static_cast(nullptr), 0, std::move(f)); } bool Component::cancel_defer(const std::string &name) { // NOLINT +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" return App.scheduler.cancel_timeout(this, name); +#pragma GCC diagnostic pop } bool Component::cancel_defer(const char *name) { // NOLINT return App.scheduler.cancel_timeout(this, name); } void Component::defer(const std::string &name, std::function &&f) { // NOLINT +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" App.scheduler.set_timeout(this, name, 0, std::move(f)); +#pragma GCC diagnostic pop } void Component::defer(const char *name, std::function &&f) { // NOLINT App.scheduler.set_timeout(this, name, 0, std::move(f));