ESPHome 2025.5.0
Loading...
Searching...
No Matches
update_entity.h
Go to the documentation of this file.
1#pragma once
2
6
7namespace esphome {
8namespace update {
9
10struct UpdateInfo {
11 std::string latest_version;
12 std::string current_version;
13 std::string title;
14 std::string summary;
15 std::string release_url;
16 std::string firmware_url;
17 std::string md5;
18 bool has_progress{false};
19 float progress;
20};
21
28
30 public:
31 bool has_state() const { return this->has_state_; }
32
33 void publish_state();
34
35 void perform() { this->perform(false); }
36 virtual void perform(bool force) = 0;
37 virtual void check() = 0;
38
41
42 void add_on_state_callback(std::function<void()> &&callback) { this->state_callback_.add(std::move(callback)); }
43
44 protected:
47 bool has_state_{false};
48
50};
51
52} // namespace update
53} // namespace esphome
const UpdateState & state
CallbackManager< void()> state_callback_
virtual void perform(bool force)=0
void add_on_state_callback(std::function< void()> &&callback)
const UpdateInfo & update_info
Providing packet encoding functions for exchanging data with a remote host.
Definition a01nyub.cpp:7