refreshThermostatsCounter.set(refreshIntervalNormal);
SummaryResponseDTO summary = api.performThermostatSummaryQuery();
if (summary != null && summary.hasChanged(previousSummary) && !thermostatIds.isEmpty()) {
- for (ThermostatDTO thermostat : api.performThermostatQuery(thermostatIds)) {
- EcobeeThermostatBridgeHandler handler = thermostatHandlers.get(thermostat.identifier);
- if (handler != null) {
- handler.updateChannels(thermostat);
+ List<ThermostatDTO> thermostats = api.performThermostatQuery(thermostatIds);
+ if (thermostats != null) {
+ for (ThermostatDTO thermostat : thermostats) {
+ EcobeeThermostatBridgeHandler handler = thermostatHandlers.get(thermostat.identifier);
+ if (handler != null) {
+ handler.updateChannels(thermostat);
+ }
}
}
}