Try not to show unknown

This commit is contained in:
Yordan Suarez
2020-11-08 22:47:37 +00:00
parent 8c644d35f1
commit cd9aef5f31
2 changed files with 6 additions and 8 deletions

View File

@@ -80,19 +80,18 @@ class FplSensor(Entity):
@property
def state(self):
state = self._state
data = self._data
if type(data) is dict:
if "budget_bill" in data.keys():
if data["budget_bill"]:
if "budget_billing_projected_bill" in data.keys():
state = data["budget_billing_projected_bill"]
self._state = data["budget_billing_projected_bill"]
else:
if "projected_bill" in data.keys():
state = data["projected_bill"]
self._state = data["projected_bill"]
return state
return self._state
# @property
# def unit_of_measurement(self):