mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-23 10:46:31 +00:00
Fix thermostat when using local sensor
Macros are not expanded in string constants, so the thermostat driver never managed to obtain the current temperature from the local sensor (SensorInputSet 1).
This commit is contained in:
parent
127254b283
commit
440219fd91
@ -1331,7 +1331,7 @@ void ThermostatGetLocalSensor(uint8_t ctr_output) {
|
||||
DynamicJsonBuffer jsonBuffer;
|
||||
JsonObject& root = jsonBuffer.parseObject((const char*)mqtt_data);
|
||||
if (root.success()) {
|
||||
const char* value_c = root["THERMOSTAT_SENSOR_NAME"]["Temperature"];
|
||||
const char* value_c = root[THERMOSTAT_SENSOR_NAME]["Temperature"];
|
||||
if (value_c != NULL && strlen(value_c) > 0 && (isdigit(value_c[0]) || (value_c[0] == '-' && isdigit(value_c[1])) ) ) {
|
||||
int16_t value = (int16_t)(CharToFloat(value_c) * 10);
|
||||
if ( (value >= -1000)
|
||||
|
Loading…
x
Reference in New Issue
Block a user