fixes building the sensor names in case of multiple channel thermostat function (#18248)

now it will follow SetOption64 (hyphen vs underscore)
hyphen is the standard - underscore the much safer option in my cases
as many user user underscore the mistake was not detected till now

Co-authored-by: Fabian Steger <git@fabian-steger.de>
This commit is contained in:
stegerfa 2023-03-24 14:54:23 +01:00 committed by GitHub
parent 7abff936cd
commit 0081022543
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1368,7 +1368,10 @@ void ThermostatGetLocalSensor(uint8_t ctr_output) {
if ( (THERMOSTAT_SENSOR_NUMBER > 1)
&&(THERMOSTAT_CONTROLLER_OUTPUTS > 1)
&&(ctr_output < THERMOSTAT_SENSOR_NUMBER)) {
sensor_name.concat("_" + (ctr_output + 1));
char temp[4];
temp[0] = IndexSeparator();
snprintf(&temp[1], 4, "%u", (ctr_output + 1));
sensor_name.concat(temp);
}
JsonParserToken value_token = root[sensor_name].getObject()[PSTR("Temperature")];
if (value_token.isNum()) {