mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-07 00:09:51 +03:00
Merge branch 'dev' of https://github.com/emsesp/EMS-ESP32 into dev
This commit is contained in:
@@ -451,7 +451,12 @@ void AnalogSensor::publish_values(const bool force) {
|
||||
}
|
||||
config["val_tpl"] = str;
|
||||
|
||||
snprintf(str, sizeof(str), "%s_analogsensor_%d", Mqtt::basename().c_str(), sensor.gpio());
|
||||
if (Mqtt::multiple_instances()) {
|
||||
snprintf(str, sizeof(str), "%s_analogsensor_%d", Mqtt::basename().c_str(), sensor.gpio());
|
||||
} else {
|
||||
snprintf(str, sizeof(str), "analogsensor_%d", sensor.gpio());
|
||||
}
|
||||
|
||||
config["object_id"] = str;
|
||||
config["uniq_id"] = str; // same as object_id
|
||||
|
||||
|
||||
Reference in New Issue
Block a user