Store app comment and compilation_time in flash (#4945)

This commit is contained in:
J. Nick Koston 2023-06-18 18:35:47 -05:00 committed by GitHub
parent 62d2640c37
commit b9f20b36cb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 6 deletions

View file

@ -99,7 +99,7 @@ void Application::loop() {
if (this->dump_config_at_ < this->components_.size()) {
if (this->dump_config_at_ == 0) {
ESP_LOGI(TAG, "ESPHome version " ESPHOME_VERSION " compiled on %s", this->compilation_time_.c_str());
ESP_LOGI(TAG, "ESPHome version " ESPHOME_VERSION " compiled on %s", this->compilation_time_);
#ifdef ESPHOME_PROJECT_NAME
ESP_LOGI(TAG, "Project " ESPHOME_PROJECT_NAME " version " ESPHOME_PROJECT_VERSION);
#endif

View file

@ -56,7 +56,7 @@ namespace esphome {
class Application {
public:
void pre_setup(const std::string &name, const std::string &friendly_name, const std::string &comment,
void pre_setup(const std::string &name, const std::string &friendly_name, const char *comment,
const char *compilation_time, bool name_add_mac_suffix) {
arch_init();
this->name_add_mac_suffix_ = name_add_mac_suffix;
@ -154,11 +154,11 @@ class Application {
/// Get the friendly name of this Application set by pre_setup().
const std::string &get_friendly_name() const { return this->friendly_name_; }
/// Get the comment of this Application set by pre_setup().
const std::string &get_comment() const { return this->comment_; }
std::string get_comment() const { return this->comment_; }
bool is_name_add_mac_suffix_enabled() const { return this->name_add_mac_suffix_; }
const std::string &get_compilation_time() const { return this->compilation_time_; }
std::string get_compilation_time() const { return this->compilation_time_; }
/** Set the target interval with which to run the loop() calls.
* If the loop() method takes longer than the target interval, ESPHome won't
@ -376,8 +376,8 @@ class Application {
std::string name_;
std::string friendly_name_;
std::string comment_;
std::string compilation_time_;
const char *comment_{nullptr};
const char *compilation_time_{nullptr};
bool name_add_mac_suffix_;
uint32_t last_loop_{0};
uint32_t loop_interval_{16};