ESPHome 2025.12.0-dev
Loading...
Searching...
No Matches
update_entity.cpp
Go to the documentation of this file.
1#include "update_entity.h"
4#include "esphome/core/log.h"
5
6namespace esphome {
7namespace update {
8
9static const char *const TAG = "update";
10
12 ESP_LOGD(TAG, "'%s' - Publishing:", this->name_.c_str());
13 ESP_LOGD(TAG, " Current Version: %s", this->update_info_.current_version.c_str());
14
15 if (!this->update_info_.md5.empty()) {
16 ESP_LOGD(TAG, " Latest Version: %s", this->update_info_.latest_version.c_str());
17 }
18 if (!this->update_info_.firmware_url.empty()) {
19 ESP_LOGD(TAG, " Firmware URL: %s", this->update_info_.firmware_url.c_str());
20 }
21
22 ESP_LOGD(TAG, " Title: %s", this->update_info_.title.c_str());
23 if (!this->update_info_.summary.empty()) {
24 ESP_LOGD(TAG, " Summary: %s", this->update_info_.summary.c_str());
25 }
26 if (!this->update_info_.release_url.empty()) {
27 ESP_LOGD(TAG, " Release URL: %s", this->update_info_.release_url.c_str());
28 }
29
30 if (this->update_info_.has_progress) {
31 ESP_LOGD(TAG, " Progress: %.0f%%", this->update_info_.progress);
32 }
33
34 this->set_has_state(true);
35 this->state_callback_.call();
36#if defined(USE_UPDATE) && defined(USE_CONTROLLER_REGISTRY)
38#endif
39}
40
41} // namespace update
42} // namespace esphome
static void notify_update(update::UpdateEntity *obj)
void set_has_state(bool state)
Definition entity_base.h:93
constexpr const char * c_str() const
Definition string_ref.h:69
CallbackManager< void()> state_callback_
const char *const TAG
Definition spi.cpp:8
Providing packet encoding functions for exchanging data with a remote host.
Definition a01nyub.cpp:7