mirror of
https://github.com/esphome/esphome.git
synced 2025-09-24 22:22:22 +01:00
Add option to suffix name with mac address (#1615)
* Add option to suffix name with mac address * Rename and add to test file
This commit is contained in:
@@ -37,8 +37,12 @@ namespace esphome {
|
||||
|
||||
class Application {
|
||||
public:
|
||||
void pre_setup(const std::string &name, const char *compilation_time) {
|
||||
this->name_ = name;
|
||||
void pre_setup(const std::string &name, const char *compilation_time, bool name_add_mac_suffix) {
|
||||
if (name_add_mac_suffix) {
|
||||
this->name_ = name + "_" + get_mac_address().substr(6);
|
||||
} else {
|
||||
this->name_ = name;
|
||||
}
|
||||
this->compilation_time_ = compilation_time;
|
||||
global_preferences.begin();
|
||||
}
|
||||
|
Reference in New Issue
Block a user