diff --git a/custom_components/fpl/fplEntity.py b/custom_components/fpl/fplEntity.py index ecb6728..22f585f 100644 --- a/custom_components/fpl/fplEntity.py +++ b/custom_components/fpl/fplEntity.py @@ -60,7 +60,11 @@ class FplEntity(CoordinatorEntity, SensorEntity): def getData(self, field): """call this method to retrieve sensor data""" - return self.coordinator.data.get(self.account).get(field, None) + if self.coordinator.data is not None: + account = self.coordinator.data.get(self.account) + if account is not None: + return account.get(field, None) + return None class FplEnergyEntity(FplEntity):