ESPHome 2025.5.0
Loading...
Searching...
No Matches
http_request_update.h
Go to the documentation of this file.
1#pragma once
2
5
9
10#ifdef USE_ESP32
11#include <freertos/FreeRTOS.h>
12#endif
13
14namespace esphome {
15namespace http_request {
16
18 public:
19 void setup() override;
20 void update() override;
21
22 void perform(bool force) override;
23 void check() override { this->update(); }
24
25 void set_source_url(const std::string &source_url) { this->source_url_ = source_url; }
26
27 void set_request_parent(HttpRequestComponent *request_parent) { this->request_parent_ = request_parent; }
28 void set_ota_parent(OtaHttpRequestComponent *ota_parent) { this->ota_parent_ = ota_parent; }
29
30 float get_setup_priority() const override { return setup_priority::AFTER_WIFI; }
31
32 protected:
35 std::string source_url_;
36
37 static void update_task(void *params);
38#ifdef USE_ESP32
39 TaskHandle_t update_task_handle_{nullptr};
40#endif
41};
42
43} // namespace http_request
44} // namespace esphome
This class simplifies creating components that periodically check a state.
Definition component.h:301
void set_source_url(const std::string &source_url)
void set_request_parent(HttpRequestComponent *request_parent)
void set_ota_parent(OtaHttpRequestComponent *ota_parent)
const float AFTER_WIFI
For components that should be initialized after WiFi is connected.
Definition component.cpp:26
Providing packet encoding functions for exchanging data with a remote host.
Definition a01nyub.cpp:7