[DISC] Add the capability to use the device BLE name (#1936)
This commit is contained in:
1 parent
55d9d87a77
commit
68fd4dc17e
4 files changed
+30
-18
No files matched your search
@@ -393,9 +393,9 @@ void createDiscovery(const char* sensor_type,
|
||||
device["mdl"] = device_model;
|
||||
}
|
||||
|
||||
// generate unique device name by adding the second half of the device_id only if device_name and device_id are different
|
||||
// generate unique device name by adding the second half of the device_id only if device_name and device_id are different and we don't want to use the BLE name
|
||||
if (device_name[0]) {
|
||||
if (strcmp(device_id, device_name) != 0 && device_id[0]) {
|
||||
if (strcmp(device_id, device_name) != 0 && device_id[0] && !ForceDeviceName) {
|
||||
device["name"] = device_name + String("-") + String(device_id + 6);
|
||||
} else {
|
||||
device["name"] = device_name;
|
||||
|
||||
Reference in new issue
Block a user