its always on

This commit is contained in:
J. Nick Koston
2025-11-28 13:48:19 -06:00
parent 8fe981b9f1
commit 515cdf9b9f
2 changed files with 1 additions and 13 deletions
@@ -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_;