Merge pull request #8659 from phildubach/development

Fix thermostat when using local sensor
This commit is contained in:
Theo Arends 2020-06-11 07:53:44 +02:00 committed by GitHub
commit 0b81563d57
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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)