bug fixes
This commit is contained in:
24
custom_components/fpl/sensor_AllData.py
Normal file
24
custom_components/fpl/sensor_AllData.py
Normal file
@@ -0,0 +1,24 @@
|
||||
from .fplEntity import FplEntity
|
||||
|
||||
|
||||
class AllDataSensor(FplEntity):
|
||||
def __init__(self, coordinator, config, account):
|
||||
super().__init__(coordinator, config, account, "")
|
||||
|
||||
@property
|
||||
def state(self):
|
||||
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")
|
||||
|
||||
def defineAttributes(self):
|
||||
"""Return the state attributes."""
|
||||
return self.coordinator.data.get(self.account)
|
||||
|
||||
@property
|
||||
def icon(self):
|
||||
return "mdi:currency-usd"
|
||||
Reference in New Issue
Block a user