bug fixes

This commit is contained in:
Yordan Suarez
2021-06-05 18:37:17 -04:00
parent edff06c22d
commit dc2a97e404
17 changed files with 698 additions and 192 deletions

View File

@@ -0,0 +1,46 @@
from .fplEntity import FplEntity
class FplAverageDailySensor(FplEntity):
def __init__(self, coordinator, config, account):
super().__init__(coordinator, config, account, "Daily Average")
@property
def state(self):
budget = self.getData("budget_bill")
budget_billing_projected_bill = self.getData("budget_billing_daily_avg")
if budget == True and budget_billing_projected_bill is not None:
return self.getData("budget_billing_daily_avg")
return self.getData("daily_avg")
@property
def icon(self):
return "mdi:currency-usd"
class BudgetDailyAverageSensor(FplEntity):
def __init__(self, coordinator, config, account):
super().__init__(coordinator, config, account, "Budget Daily Average")
@property
def state(self):
return self.getData("budget_billing_daily_avg")
@property
def icon(self):
return "mdi:currency-usd"
class ActualDailyAverageSensor(FplEntity):
def __init__(self, coordinator, config, account):
super().__init__(coordinator, config, account, "Actual Daily Average")
@property
def state(self):
return self.getData("daily_avg")
@property
def icon(self):
return "mdi:currency-usd"