fill in missing gaps with previous state

This commit is contained in:
Adam Outler
2022-01-01 12:17:37 -05:00
parent ba77a5e2c2
commit 0b4f5abb5b
9 changed files with 159 additions and 61 deletions

View File

@@ -24,13 +24,12 @@ class FplProjectedBillSensor(FplSensor):
@property
def device_state_attributes(self):
"""Return the state attributes."""
try:
if "budget_bill" in self.data.keys():
self.attr["budget_bill"] = self.data["budget_bill"]
except:
pass
return self.attr
if "budget_bill" in self.data.keys():
self.attr["budget_bill"] = self.data["budget_bill"]
return self._state
@property
def icon(self):