mirror of
https://github.com/esphome/esphome.git
synced 2026-09-17 01:58:39 +00:00
its always on
This commit is contained in:
@@ -20,13 +20,8 @@ static const char *const TAG = "http_request.update";
|
||||
|
||||
static const size_t MAX_READ_SIZE = 256;
|
||||
|
||||
void HttpRequestUpdate::setup() {
|
||||
#ifdef USE_OTA_STATE_LISTENER
|
||||
this->ota_parent_->add_state_listener(this);
|
||||
#endif
|
||||
}
|
||||
void HttpRequestUpdate::setup() { this->ota_parent_->add_state_listener(this); }
|
||||
|
||||
#ifdef USE_OTA_STATE_LISTENER
|
||||
void HttpRequestUpdate::on_ota_state(ota::OTAState state, float progress, uint8_t error) {
|
||||
if (state == ota::OTAState::OTA_IN_PROGRESS) {
|
||||
this->state_ = update::UPDATE_STATE_INSTALLING;
|
||||
@@ -39,7 +34,6 @@ void HttpRequestUpdate::on_ota_state(ota::OTAState state, float progress, uint8_
|
||||
this->publish_state();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
void HttpRequestUpdate::update() {
|
||||
#ifdef USE_ESP32
|
||||
|
||||
@@ -15,11 +15,7 @@
|
||||
namespace esphome {
|
||||
namespace http_request {
|
||||
|
||||
#ifdef USE_OTA_STATE_LISTENER
|
||||
class HttpRequestUpdate final : public update::UpdateEntity, public PollingComponent, public ota::OTAStateListener {
|
||||
#else
|
||||
class HttpRequestUpdate final : public update::UpdateEntity, public PollingComponent {
|
||||
#endif
|
||||
public:
|
||||
void setup() override;
|
||||
void update() override;
|
||||
@@ -34,9 +30,7 @@ class HttpRequestUpdate final : public update::UpdateEntity, public PollingCompo
|
||||
|
||||
float get_setup_priority() const override { return setup_priority::AFTER_WIFI; }
|
||||
|
||||
#ifdef USE_OTA_STATE_LISTENER
|
||||
void on_ota_state(ota::OTAState state, float progress, uint8_t error) override;
|
||||
#endif
|
||||
|
||||
protected:
|
||||
HttpRequestComponent *request_parent_;
|
||||
|
||||
Reference in New Issue
Block a user