mirror of
https://github.com/UtilitechAS/amsreader-firmware.git
synced 2026-01-15 00:12:07 +00:00
Moved from postfix to prefix on HA sensor name tag
This commit is contained in:
parent
71e0f13f0e
commit
81fedaaa6a
@ -17,11 +17,11 @@ public:
|
||||
if(strlen(config.discoveryNameTag) > 0) {
|
||||
snprintf_P(buf, 128, PSTR("AMS reader (%s)"), config.discoveryNameTag);
|
||||
deviceName = String(buf);
|
||||
snprintf_P(buf, 128, PSTR(" (%s)"), config.discoveryNameTag);
|
||||
sensorNamePostFix = String(buf);
|
||||
snprintf_P(buf, 128, PSTR("[%s] "), config.discoveryNameTag);
|
||||
sensorNamePrefix = String(buf);
|
||||
} else {
|
||||
deviceName = "AMS reader";
|
||||
sensorNamePostFix = "";
|
||||
sensorNamePrefix = "";
|
||||
}
|
||||
deviceModel = boardTypeToString(boardType);
|
||||
manufacturer = boardManufacturerToString(boardType);
|
||||
@ -82,7 +82,7 @@ private:
|
||||
String deviceUrl;
|
||||
|
||||
String discoveryTopic;
|
||||
String sensorNamePostFix;
|
||||
String sensorNamePrefix;
|
||||
|
||||
bool l1Init, l2Init, l2eInit, l3Init, l3eInit, l4Init, l4eInit, rtInit, rteInit, pInit, sInit;
|
||||
bool tInit[32] = {false};
|
||||
|
||||
@ -310,8 +310,8 @@ void HomeAssistantMqttHandler::publishSensor(const HomeAssistantSensor& sensor)
|
||||
uid.replace("]", "");
|
||||
uid.replace("'", "");
|
||||
snprintf_P(json, BufferSize, HADISCOVER_JSON,
|
||||
sensorNamePrefix.c_str(),
|
||||
sensor.name,
|
||||
sensorNamePostFix.c_str(),
|
||||
topic.c_str(), sensor.topic,
|
||||
deviceUid.c_str(), uid.c_str(),
|
||||
deviceUid.c_str(), uid.c_str(),
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user