[ecobee] fix NullPointerException in EcobeeAccountBridgeHandler.refreshThermostats() (#16442)

Signed-off-by: Rob Nielsen <rob.nielsen@yahoo.com>
Signed-off-by: Ciprian Pascu <contact@ciprianpascu.ro>
This commit is contained in:
robnielsen 2024-02-22 01:45:55 -06:00 committed by Ciprian Pascu
parent 6e8f57b3d3
commit 90ffee03c6

View File

@ -220,10 +220,13 @@ public class EcobeeAccountBridgeHandler extends BaseBridgeHandler {
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);
}
}
}
}