names for entityFormat and discoveryType

This commit is contained in:
MichaelDvP
2023-03-14 15:17:16 +01:00
parent 0b0ae2fbc2
commit 4ba9f6f330
5 changed files with 11 additions and 8 deletions

View File

@@ -497,7 +497,7 @@ void AnalogSensor::publish_values(const bool force) {
config["val_tpl"] = (std::string) "{{" + val_obj + " if " + val_cond + " else " + sample_val + "}}";
char uniq_s[70];
if (Mqtt::entity_format() == 2) {
if (Mqtt::entity_format() == Mqtt::entitiyFormat::MULTI_SHORT) {
snprintf(uniq_s, sizeof(uniq_s), "%s_analogsensor_%02d", Mqtt::basename().c_str(), sensor.gpio());
} else {
snprintf(uniq_s, sizeof(uniq_s), "analogsensor_%02d", sensor.gpio());