Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -10,34 +10,55 @@ class FplProjectedBillSensor(FplMoneyEntity):
|
||||
budget = self.getData("budget_bill")
|
||||
budget_billing_projected_bill = self.getData("budget_billing_projected_bill")
|
||||
|
||||
if budget == True and budget_billing_projected_bill is not None:
|
||||
return self.getData("budget_billing_projected_bill")
|
||||
|
||||
return self.getData("projected_bill")
|
||||
try:
|
||||
if budget == True and budget_billing_projected_bill is not None:
|
||||
self._state = self.getData("budget_billing_projected_bill")
|
||||
else:
|
||||
self._state = self.getData("projected_bill")
|
||||
except:
|
||||
self._state = None
|
||||
return self._state
|
||||
|
||||
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 Payment Due"
|
||||
attributes["device_class"] = "monetary"
|
||||
attributes["state_class"] = "total"
|
||||
attributes["unit_of_measurement"] = "$"
|
||||
return attributes
|
||||
|
||||
|
||||
# Defered Amount
|
||||
class DeferedAmountSensor(FplMoneyEntity):
|
||||
def __init__(self, coordinator, config, account):
|
||||
super().__init__(coordinator, config, account, "Defered Amount")
|
||||
super().__init__(coordinator, config, account, "Deferred Amount")
|
||||
|
||||
@property
|
||||
def state(self):
|
||||
if self.getData("budget_bill") == True:
|
||||
return self.getData("defered_amount")
|
||||
return 0
|
||||
try:
|
||||
self._state = self.getData("deferred_amount")
|
||||
except:
|
||||
self._state = 0
|
||||
pass
|
||||
return self._state
|
||||
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
@property
|
||||
def icon(self):
|
||||
return "mdi:currency-usd"
|
||||
|
||||
def defineAttributes(self):
|
||||
"""Return the state attributes."""
|
||||
attributes = {}
|
||||
attributes["friendly_name"] = "Deferred Amount"
|
||||
attributes["device_class"] = "monetary"
|
||||
attributes["state_class"] = "total"
|
||||
attributes["unit_of_measurement"] = "$"
|
||||
return attributes
|
||||
|
||||
>>>>>>> master
|
||||
|
||||
class ProjectedBudgetBillSensor(FplMoneyEntity):
|
||||
def __init__(self, coordinator, config, account):
|
||||
@@ -45,8 +66,28 @@ class ProjectedBudgetBillSensor(FplMoneyEntity):
|
||||
|
||||
@property
|
||||
def state(self):
|
||||
return self.getData("budget_billing_projected_bill")
|
||||
try:
|
||||
self._state = self.getData("budget_billing_projected_bill")
|
||||
except:
|
||||
pass
|
||||
return self._state
|
||||
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
@property
|
||||
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
|
||||
|
||||
>>>>>>> master
|
||||
|
||||
class ProjectedActualBillSensor(FplMoneyEntity):
|
||||
def __init__(self, coordinator, config, account):
|
||||
@@ -54,4 +95,26 @@ class ProjectedActualBillSensor(FplMoneyEntity):
|
||||
|
||||
@property
|
||||
def state(self):
|
||||
<<<<<<< HEAD
|
||||
return self.getData("projected_bill")
|
||||
=======
|
||||
try:
|
||||
self._state = self.getData("projected_bill")
|
||||
except:
|
||||
pass
|
||||
return self._state
|
||||
|
||||
@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
|
||||
>>>>>>> master
|
||||
|
||||
Reference in New Issue
Block a user