ESPHome 2026.1.4
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,
13 "'%s' >>\n"
14 " Current Version: %s",
15 this->name_.c_str(), this->update_info_.current_version.c_str());
16
17 if (!this->update_info_.md5.empty()) {
18 ESP_LOGD(TAG, " Latest Version: %s", this->update_info_.latest_version.c_str());
19 }
20 if (!this->update_info_.firmware_url.empty()) {
21 ESP_LOGD(TAG, " Firmware URL: %s", this->update_info_.firmware_url.c_str());
22 }
23
24 ESP_LOGD(TAG, " Title: %s", this->update_info_.title.c_str());
25 if (!this->update_info_.summary.empty()) {
26 ESP_LOGD(TAG, " Summary: %s", this->update_info_.summary.c_str());
27 }
28 if (!this->update_info_.release_url.empty()) {
29 ESP_LOGD(TAG, " Release URL: %s", this->update_info_.release_url.c_str());
30 }
31
32 if (this->update_info_.has_progress) {
33 ESP_LOGD(TAG, " Progress: %.0f%%", this->update_info_.progress);
34 }
35
36 this->set_has_state(true);
37 this->state_callback_.call();
38#if defined(USE_UPDATE) && defined(USE_CONTROLLER_REGISTRY)
40#endif
41}
42
43} // namespace update
44} // namespace esphome
static void notify_update(update::UpdateEntity *obj)
void set_has_state(bool state)
constexpr const char * c_str() const
Definition string_ref.h:73
LazyCallbackManager< void()> state_callback_
const char *const TAG
Definition spi.cpp:7
Providing packet encoding functions for exchanging data with a remote host.
Definition a01nyub.cpp:7