Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[radiothermostat] Ignore updates if thermostat data is invalid #13394

Merged
merged 2 commits into from
Sep 17, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -371,14 +371,18 @@ public void onNewMessageEvent(RadioThermostatEvent event) {
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));
Expand Down