From 00810225434b7e5e5d3efdb4257660c8e7ffcb41 Mon Sep 17 00:00:00 2001 From: stegerfa <128254543+stegerfa@users.noreply.github.com> Date: Fri, 24 Mar 2023 14:54:23 +0100 Subject: [PATCH] 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 --- tasmota/tasmota_xdrv_driver/xdrv_39_thermostat.ino | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tasmota/tasmota_xdrv_driver/xdrv_39_thermostat.ino b/tasmota/tasmota_xdrv_driver/xdrv_39_thermostat.ino index a2f9dfcca..93de7efb9 100644 --- a/tasmota/tasmota_xdrv_driver/xdrv_39_thermostat.ino +++ b/tasmota/tasmota_xdrv_driver/xdrv_39_thermostat.ino @@ -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()) {