diff --git a/esphome/components/ota/automation.h b/esphome/components/ota/automation.h index 31d71a213f..7e1a60f3ce 100644 --- a/esphome/components/ota/automation.h +++ b/esphome/components/ota/automation.h @@ -22,7 +22,7 @@ class OTAStartTrigger : public Trigger<> { public: explicit OTAStartTrigger(OTAComponent *parent) { parent->add_on_state_callback([this, parent](OTAState state, float progress, uint8_t error) { - if (state == ota::OTA_STARTED && !parent->is_failed()) { + if (state == OTA_STARTED && !parent->is_failed()) { trigger(); } }); @@ -33,7 +33,7 @@ class OTAProgressTrigger : public Trigger { public: explicit OTAProgressTrigger(OTAComponent *parent) { parent->add_on_state_callback([this, parent](OTAState state, float progress, uint8_t error) { - if (state == ota::OTA_IN_PROGRESS && !parent->is_failed()) { + if (state == OTA_IN_PROGRESS && !parent->is_failed()) { trigger(progress); } }); @@ -44,7 +44,7 @@ class OTAEndTrigger : public Trigger<> { public: explicit OTAEndTrigger(OTAComponent *parent) { parent->add_on_state_callback([this, parent](OTAState state, float progress, uint8_t error) { - if (state == ota::OTA_COMPLETED && !parent->is_failed()) { + if (state == OTA_COMPLETED && !parent->is_failed()) { trigger(); } }); @@ -55,7 +55,7 @@ class OTAAbortTrigger : public Trigger<> { public: explicit OTAAbortTrigger(OTAComponent *parent) { parent->add_on_state_callback([this, parent](OTAState state, float progress, uint8_t error) { - if (state == ota::OTA_ABORT && !parent->is_failed()) { + if (state == OTA_ABORT && !parent->is_failed()) { trigger(); } }); @@ -66,7 +66,7 @@ class OTAErrorTrigger : public Trigger { public: explicit OTAErrorTrigger(OTAComponent *parent) { parent->add_on_state_callback([this, parent](OTAState state, float progress, uint8_t error) { - if (state == ota::OTA_ERROR && !parent->is_failed()) { + if (state == OTA_ERROR && !parent->is_failed()) { trigger(error); } }); diff --git a/esphome/components/ota/ota_backend.cpp b/esphome/components/ota/ota_backend.cpp index e7d2a2bcce..30de4ec4b3 100644 --- a/esphome/components/ota/ota_backend.cpp +++ b/esphome/components/ota/ota_backend.cpp @@ -3,8 +3,6 @@ namespace esphome { namespace ota { -// The make_ota_backend() implementation is provided by each platform-specific backend - #ifdef USE_OTA_STATE_CALLBACK OTAGlobalCallback *global_ota_callback{nullptr}; // NOLINT(cppcoreguidelines-avoid-non-const-global-variables)