mirror of
https://github.com/esphome/esphome.git
synced 2024-11-22 11:47:30 +01:00
Store app comment and compilation_time in flash (#4945)
This commit is contained in:
parent
62d2640c37
commit
b9f20b36cb
@ -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
|
||||
|
@ -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};
|
||||
|
Loading…
Reference in New Issue
Block a user