merge changes into primary folder

This commit is contained in:
Adam Outler
2021-12-30 14:44:27 -05:00
parent 0a75b189b7
commit 621fea3042
29 changed files with 244 additions and 1467 deletions

View File

@@ -18,12 +18,10 @@ class FplProjectedBillSensor(FplEntity):
def defineAttributes(self):
"""Return the state attributes."""
attributes = {}
try:
if self.getData("budget_bill") == True:
attributes["budget_bill"] = self.getData("budget_bill")
except:
pass
attributes["friendly_name"] = "Projected Bill"
attributes["device_class"] = "monitary"
attributes["state_class"] = "total"
attributes["unit_of_measurement"] = "$"
return attributes
@property
@@ -38,7 +36,7 @@ class DeferedAmountSensor(FplEntity):
@property
def state(self):
if self.getData("budget_bill") == True:
if self.getData("defered_amount") is not None:
return self.getData("defered_amount")
return 0
@@ -46,6 +44,15 @@ class DeferedAmountSensor(FplEntity):
def icon(self):
return "mdi:currency-usd"
def defineAttributes(self):
"""Return the state attributes."""
attributes = {}
attributes["friendly_name"] = "Defered Amount"
attributes["device_class"] = "monitary"
attributes["state_class"] = "total"
attributes["unit_of_measurement"] = "$"
return attributes
class ProjectedBudgetBillSensor(FplEntity):
def __init__(self, coordinator, config, account):
@@ -59,6 +66,15 @@ class ProjectedBudgetBillSensor(FplEntity):
def icon(self):
return "mdi:currency-usd"
def defineAttributes(self):
"""Return the state attributes."""
attributes = {}
attributes["friendly_name"] = "Projected Budget Bill"
attributes["device_class"] = "monitary"
attributes["state_class"] = "total"
attributes['unit_of_measurement'] = "$"
return attributes
class ProjectedActualBillSensor(FplEntity):
def __init__(self, coordinator, config, account):
@@ -71,3 +87,13 @@ class ProjectedActualBillSensor(FplEntity):
@property
def icon(self):
return "mdi:currency-usd"
def defineAttributes(self):
"""Return the state attributes."""
attributes = {}
attributes["friendly_name"] = "Projected Actual Bill"
attributes["device_class"] = "monitary"
attributes["state_class"] = "total"
attributes['unit_of_measurement'] = "$"
return attributes