mirror of
https://github.com/openhab/openhab-addons.git
synced 2025-01-10 15:11:59 +01:00
[radiothermostat] Ignore updates if thermostat data is invalid (#13394)
* Ignore updates if data is invalid Signed-off-by: Michael Lobstein <michael.lobstein@gmail.com>
This commit is contained in:
parent
7dfb963f92
commit
8a9c66a567
@ -371,14 +371,18 @@ public class RadioThermostatHandler extends BaseThingHandler implements RadioThe
|
||||
switch (evtKey) {
|
||||
case DEFAULT_RESOURCE:
|
||||
rthermData.setThermostatData(gson.fromJson(evtVal, RadioThermostatTstatDTO.class));
|
||||
updateAllChannels();
|
||||
// if thermostat returned -1 for temperature, skip this update
|
||||
if (rthermData.getThermostatData().getTemperature() >= 0) {
|
||||
updateAllChannels();
|
||||
}
|
||||
break;
|
||||
case HUMIDITY_RESOURCE:
|
||||
RadioThermostatHumidityDTO dto = gson.fromJson(evtVal, RadioThermostatHumidityDTO.class);
|
||||
if (dto != null) {
|
||||
// if thermostat returned -1 for humidity, skip this update
|
||||
if (dto != null && dto.getHumidity() >= 0) {
|
||||
rthermData.setHumidity(dto.getHumidity());
|
||||
updateChannel(HUMIDITY, rthermData);
|
||||
}
|
||||
updateChannel(HUMIDITY, rthermData);
|
||||
break;
|
||||
case RUNTIME_RESOURCE:
|
||||
rthermData.setRuntime(gson.fromJson(evtVal, RadioThermostatRuntimeDTO.class));
|
||||
|
Loading…
Reference in New Issue
Block a user