mirror of
https://github.com/esphome/esphome.git
synced 2026-02-20 16:35:37 -07:00
overload
This commit is contained in:
@@ -258,13 +258,14 @@ bool ESP32BLE::ble_setup_() {
|
||||
|
||||
std::string name;
|
||||
if (this->name_ != nullptr) {
|
||||
name = this->name_;
|
||||
if (App.is_name_add_mac_suffix_enabled()) {
|
||||
// MAC address suffix length (last 6 characters of 12-char MAC address string)
|
||||
constexpr size_t mac_address_suffix_len = 6;
|
||||
const std::string mac_addr = get_mac_address();
|
||||
const char *mac_suffix_ptr = mac_addr.c_str() + mac_address_suffix_len;
|
||||
name = make_name_with_suffix(name, '-', mac_suffix_ptr, mac_address_suffix_len);
|
||||
name = make_name_with_suffix(this->name_, '-', mac_suffix_ptr, mac_address_suffix_len);
|
||||
} else {
|
||||
name = this->name_;
|
||||
}
|
||||
} else {
|
||||
name = App.get_name();
|
||||
|
||||
Reference in New Issue
Block a user