ESPHome  2024.12.2
http_request_update.h
Go to the documentation of this file.
1 #pragma once
2 
4 #include "esphome/core/helpers.h"
5 
9 
10 namespace esphome {
11 namespace http_request {
12 
14  public:
15  void setup() override;
16  void update() override;
17 
18  void perform(bool force) override;
19  void check() override { this->update(); }
20 
21  void set_source_url(const std::string &source_url) { this->source_url_ = source_url; }
22 
23  void set_request_parent(HttpRequestComponent *request_parent) { this->request_parent_ = request_parent; }
24  void set_ota_parent(OtaHttpRequestComponent *ota_parent) { this->ota_parent_ = ota_parent; }
25 
26  float get_setup_priority() const override { return setup_priority::AFTER_WIFI; }
27 
28  protected:
31  std::string source_url_;
32 };
33 
34 } // namespace http_request
35 } // namespace esphome
const float AFTER_WIFI
For components that should be initialized after WiFi is connected.
Definition: component.cpp:26
This class simplifies creating components that periodically check a state.
Definition: component.h:283
void set_ota_parent(OtaHttpRequestComponent *ota_parent)
Implementation of SPI Controller mode.
Definition: a01nyub.cpp:7
void set_source_url(const std::string &source_url)
void set_request_parent(HttpRequestComponent *request_parent)