Fix Thermostat sensor status corruption

Fix Thermostat sensor status corruption regression from 8.5.0.1 (#9449)
This commit is contained in:
Theo Arends 2020-10-10 15:19:11 +02:00
parent 0949dda650
commit b8e55203b6
4 changed files with 84 additions and 78 deletions

View File

@ -32,6 +32,7 @@ All notable changes to this project will be documented in this file.
- Shutter timing problem due to buffer overflow in calibration matrix (#9458) - Shutter timing problem due to buffer overflow in calibration matrix (#9458)
- Light wakeup exception 0 (divide by zero) when ``WakeupDuration`` is not initialised (#9466) - Light wakeup exception 0 (divide by zero) when ``WakeupDuration`` is not initialised (#9466)
- ADC initalization sequence (#9473) - ADC initalization sequence (#9473)
- Thermostat sensor status corruption regression from 8.5.0.1 (#9449)
### Removed ### Removed
- Support for direct upgrade from Tasmota versions before 7.0 - Support for direct upgrade from Tasmota versions before 7.0

View File

@ -86,6 +86,7 @@ The attached binaries can also be downloaded from http://ota.tasmota.com/tasmota
- Shutter timing problem due to buffer overflow in calibration matrix (#9458) - Shutter timing problem due to buffer overflow in calibration matrix (#9458)
- Light wakeup exception 0 (divide by zero) when ``WakeupDuration`` is not initialised (#9466) - Light wakeup exception 0 (divide by zero) when ``WakeupDuration`` is not initialised (#9466)
- ADC initalization sequence (#9473) - ADC initalization sequence (#9473)
- Thermostat sensor status corruption regression from 8.5.0.1 (#9449)
### Removed ### Removed
- Support for direct upgrade from Tasmota versions before 7.0 - Support for direct upgrade from Tasmota versions before 7.0

View File

@ -473,8 +473,11 @@ bool SettingsUpdateText(uint32_t index, const char* replace_me) {
settings_text_mutex = false; settings_text_mutex = false;
} }
// AddLog_P2(LOG_LEVEL_DEBUG, PSTR(D_LOG_CONFIG "CR %d/%d, Busy %d, Id %d = \"%s\""), GetSettingsTextLen(), settings_text_size, settings_text_busy_count, index_save, replace); #ifdef DEBUG_FUNC_SETTINGSUPDATETEXT
AddLog_P2(LOG_LEVEL_DEBUG, PSTR(D_LOG_CONFIG "CR %d/%d, Busy %d, Id %02d = \"%s\""), GetSettingsTextLen(), settings_text_size, settings_text_busy_count, index_save, replace);
#else
AddLog_P2(LOG_LEVEL_DEBUG, PSTR(D_LOG_CONFIG "CR %d/%d, Busy %d"), GetSettingsTextLen(), settings_text_size, settings_text_busy_count); AddLog_P2(LOG_LEVEL_DEBUG, PSTR(D_LOG_CONFIG "CR %d/%d, Busy %d"), GetSettingsTextLen(), settings_text_size, settings_text_busy_count);
#endif
return true; return true;
} }

View File

@ -1328,7 +1328,8 @@ void ThermostatDebug(uint8_t ctr_output)
#endif // DEBUG_THERMOSTAT #endif // DEBUG_THERMOSTAT
void ThermostatGetLocalSensor(uint8_t ctr_output) { void ThermostatGetLocalSensor(uint8_t ctr_output) {
JsonParser parser(mqtt_data); String buf = mqtt_data; // copy the string into a new buffer that will be modified
JsonParser parser((char*)buf.c_str());
JsonParserObject root = parser.getRootObject(); JsonParserObject root = parser.getRootObject();
if (root) { if (root) {
JsonParserToken value_token = root[PSTR(THERMOSTAT_SENSOR_NAME)].getObject()[PSTR("Temperature")]; JsonParserToken value_token = root[PSTR(THERMOSTAT_SENSOR_NAME)].getObject()[PSTR("Temperature")];