mirror of
https://github.com/esphome/esphome.git
synced 2025-09-06 21:32:21 +01:00
Separate OTABackend
from OTA component (#6459)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
This commit is contained in:
@@ -18,7 +18,7 @@
|
||||
#include <cinttypes>
|
||||
|
||||
#ifdef USE_OTA
|
||||
#include "esphome/components/ota/ota_component.h"
|
||||
#include "esphome/components/ota/ota_backend.h"
|
||||
#endif
|
||||
|
||||
#ifdef USE_ARDUINO
|
||||
@@ -61,11 +61,12 @@ void ESP32BLETracker::setup() {
|
||||
this->scanner_idle_ = true;
|
||||
|
||||
#ifdef USE_OTA
|
||||
ota::global_ota_component->add_on_state_callback([this](ota::OTAState state, float progress, uint8_t error) {
|
||||
if (state == ota::OTA_STARTED) {
|
||||
this->stop_scan();
|
||||
}
|
||||
});
|
||||
ota::get_global_ota_callback()->add_on_state_callback(
|
||||
[this](ota::OTAState state, float progress, uint8_t error, ota::OTAComponent *comp) {
|
||||
if (state == ota::OTA_STARTED) {
|
||||
this->stop_scan();
|
||||
}
|
||||
});
|
||||
#endif
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user