Fix display of update state in webinterfae (#7045)

Co-authored-by: Leo Schelvis <leo.schelvis@gmail.com>
This commit is contained in:
leejoow
2024-07-06 06:57:30 +02:00
committed by GitHub
parent 6ca7b30f75
commit dd1e480142
2 changed files with 6 additions and 10 deletions

View File

@@ -116,19 +116,18 @@ void HttpRequestUpdate::update() {
}
}
std::string current_version = this->current_version_;
if (current_version.empty()) {
std::string current_version;
#ifdef ESPHOME_PROJECT_VERSION
current_version = ESPHOME_PROJECT_VERSION;
current_version = ESPHOME_PROJECT_VERSION;
#else
current_version = ESPHOME_VERSION;
current_version = ESPHOME_VERSION;
#endif
}
this->update_info_.current_version = current_version;
if (this->update_info_.latest_version.empty()) {
if (this->update_info_.latest_version.empty() || this->update_info_.latest_version == update_info_.current_version) {
this->state_ = update::UPDATE_STATE_NO_UPDATE;
} else if (this->update_info_.latest_version != this->current_version_) {
} else {
this->state_ = update::UPDATE_STATE_AVAILABLE;
}