fix mis-order (#19769)

* fix mis-order

* fix mis-order on esp32 too
This commit is contained in:
Barbudor 2023-10-16 21:47:31 +02:00 committed by GitHub
parent d05d76b481
commit 8e9299ec97
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 0 deletions

View File

@ -483,6 +483,7 @@ void Ds18x20Name(uint8_t sensor) {
} }
snprintf_P(DS18X20Data.name, sizeof(DS18X20Data.name), PSTR("%s%c%s"), DS18X20Data.name, IndexSeparator(), address); snprintf_P(DS18X20Data.name, sizeof(DS18X20Data.name), PSTR("%s%c%s"), DS18X20Data.name, IndexSeparator(), address);
#elif defined(DS18x20_USE_ID_ALIAS) #elif defined(DS18x20_USE_ID_ALIAS)
sensor = ds18x20_sensor[sensor].index;
if (ds18x20_sensor[sensor].alias[0] != '0') { if (ds18x20_sensor[sensor].alias[0] != '0') {
if (isdigit(ds18x20_sensor[sensor].alias[0])) { if (isdigit(ds18x20_sensor[sensor].alias[0])) {
snprintf_P(DS18X20Data.name, sizeof(DS18X20Data.name), PSTR("DS18Sens%c%d"), IndexSeparator(), atoi(ds18x20_sensor[sensor].alias)); snprintf_P(DS18X20Data.name, sizeof(DS18X20Data.name), PSTR("DS18Sens%c%d"), IndexSeparator(), atoi(ds18x20_sensor[sensor].alias));

View File

@ -227,6 +227,7 @@ void Ds18x20Name(uint8_t sensor) {
} }
snprintf_P(DS18X20Data.name, sizeof(DS18X20Data.name), PSTR("%s%c%s"), DS18X20Data.name, IndexSeparator(), address); snprintf_P(DS18X20Data.name, sizeof(DS18X20Data.name), PSTR("%s%c%s"), DS18X20Data.name, IndexSeparator(), address);
#elif defined(DS18x20_USE_ID_ALIAS) #elif defined(DS18x20_USE_ID_ALIAS)
sensor = ds18x20_sensor[sensor].index;
if (ds18x20_sensor[sensor].alias[0] != '0') { if (ds18x20_sensor[sensor].alias[0] != '0') {
if (isdigit(ds18x20_sensor[sensor].alias[0])) { if (isdigit(ds18x20_sensor[sensor].alias[0])) {
snprintf_P(DS18X20Data.name, sizeof(DS18X20Data.name), PSTR("DS18Sens%c%d"), IndexSeparator(), atoi(ds18x20_sensor[sensor].alias)); snprintf_P(DS18X20Data.name, sizeof(DS18X20Data.name), PSTR("DS18Sens%c%d"), IndexSeparator(), atoi(ds18x20_sensor[sensor].alias));