Guard against missing data in 1st generation RainMachine controllers (#72632)

This commit is contained in:
Aaron Bach
2022-05-30 15:36:58 -06:00
committed by GitHub
parent 8c16ac2e47
commit 8e75547ca4
3 changed files with 35 additions and 26 deletions

View File

@@ -198,7 +198,7 @@ class UniversalRestrictionsSensor(RainMachineEntity, SensorEntity):
def update_from_latest_data(self) -> None:
"""Update the state."""
if self.entity_description.key == TYPE_FREEZE_TEMP:
self._attr_native_value = self.coordinator.data["freezeProtectTemp"]
self._attr_native_value = self.coordinator.data.get("freezeProtectTemp")
class ZoneTimeRemainingSensor(RainMachineEntity, SensorEntity):