ESPHome  2024.10.2
update_entity.cpp
Go to the documentation of this file.
1 #include "update_entity.h"
2 
3 #include "esphome/core/log.h"
4 
5 namespace esphome {
6 namespace update {
7 
8 static const char *const TAG = "update";
9 
11  ESP_LOGD(TAG, "'%s' - Publishing:", this->name_.c_str());
12  ESP_LOGD(TAG, " Current Version: %s", this->update_info_.current_version.c_str());
13 
14  if (!this->update_info_.md5.empty()) {
15  ESP_LOGD(TAG, " Latest Version: %s", this->update_info_.latest_version.c_str());
16  }
17  if (!this->update_info_.firmware_url.empty()) {
18  ESP_LOGD(TAG, " Firmware URL: %s", this->update_info_.firmware_url.c_str());
19  }
20 
21  ESP_LOGD(TAG, " Title: %s", this->update_info_.title.c_str());
22  if (!this->update_info_.summary.empty()) {
23  ESP_LOGD(TAG, " Summary: %s", this->update_info_.summary.c_str());
24  }
25  if (!this->update_info_.release_url.empty()) {
26  ESP_LOGD(TAG, " Release URL: %s", this->update_info_.release_url.c_str());
27  }
28 
29  if (this->update_info_.has_progress) {
30  ESP_LOGD(TAG, " Progress: %.0f%%", this->update_info_.progress);
31  }
32 
33  this->has_state_ = true;
34  this->state_callback_.call();
35 }
36 
37 } // namespace update
38 } // namespace esphome
const char *const TAG
Definition: spi.cpp:8
CallbackManager< void()> state_callback_
Definition: update_entity.h:49
constexpr const char * c_str() const
Definition: string_ref.h:68
Implementation of SPI Controller mode.
Definition: a01nyub.cpp:7