Browse Source

thermostat: use magnitude type not its index

fix #2585
network/test
Maxim Prokhorov 1 year ago
parent
commit
3be530553d
2 changed files with 4 additions and 2 deletions
  1. +1
    -0
      CHANGELOG.md
  2. +3
    -2
      code/espurna/thermostat.cpp

+ 1
- 0
CHANGELOG.md View File

@ -18,6 +18,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
- Sensor magnitude decimals / precision setting ([#2550](https://github.com/xoseperez/espurna/issues/2550), [8f1c44fe](https://github.com/xoseperez/espurna/commit/8f1c44fe69383e548cc94a50cccaae71f4ffe056))
- Fix DNS requests handling with no servers configured or when they are unavailable ([175c04ac](https://github.com/xoseperez/espurna/commit/175c04acc1afeacdd17f7a7721ebaa21ce5ef347))
- GPIO lock result stored with the request in the log; show WebUI notification when failures occur ([3a1e041f](https://github.com/xoseperez/espurna/commit/3a1e041f5166d4ae459f3ab1853996b2606ee01a))
- Fix thermostat remote sensor payload parser using incorrect keys ([#2585](https://github.com/xoseperez/espurna/issues/2585))
## [1.15.0-dev] Snapshot build 2023-01-12


+ 3
- 2
code/espurna/thermostat.cpp View File

@ -200,8 +200,9 @@ void thermostatMqttCallback(unsigned int type, espurna::StringView topic, espurn
// Check remote sensor temperature
if (topic == thermostat_remote_sensor_topic) {
if (root.containsKey(magnitudeTopic(MAGNITUDE_TEMPERATURE))) {
String remote_temp = root[magnitudeTopic(MAGNITUDE_TEMPERATURE)];
const auto key = magnitudeTypeTopic(MAGNITUDE_TEMPERATURE);
if (root.containsKey(key)) {
String remote_temp = root[key];
_remote_temp.temp = remote_temp.toFloat();
_remote_temp.last_update = millis();
_remote_temp.need_display_update = true;


Loading…
Cancel
Save