Merge branch 'master' into dev

This commit is contained in:
Yordan Suarez
2022-07-21 20:46:49 -04:00
12 changed files with 975 additions and 29 deletions

View File

@@ -17,14 +17,36 @@ class DailyAverageSensor(FplMoneyEntity):
if budget and budget_billing_projected_bill is not None:
return self.getData("budget_billing_daily_avg")
return self.getData("daily_avg")
try:
self._state=self.getData("daily_avg")
except:
pass
return self._state
<<<<<<< HEAD
=======
@property
def icon(self):
return "mdi:currency-usd"
<<<<<<< HEAD:custom_components/fpl1/sensor_AverageDailySensor.py
def customAttributes(self):
"""Return the state attributes."""
attributes = {}
attributes["state_class"] = STATE_CLASS_TOTAL
return attributes
=======
def defineAttributes(self):
"""Return the state attributes."""
attributes = {}
attributes["friendly_name"] = "Daily Average"
attributes["device_class"] = "monetary"
attributes["state_class"] = "total"
attributes["unit_of_measurement"] = "$"
return attributes
>>>>>>> master
>>>>>>> master:custom_components/fpl/sensor_AverageDailySensor.py
class BudgetDailyAverageSensor(FplMoneyEntity):
"""budget daily average sensor"""
@@ -34,14 +56,22 @@ class BudgetDailyAverageSensor(FplMoneyEntity):
@property
def state(self):
return self.getData("budget_billing_daily_avg")
try:
self._state= self.getData("budget_billing_daily_avg")
except:
pass
return self._state
<<<<<<< HEAD:custom_components/fpl1/sensor_AverageDailySensor.py
def customAttributes(self):
"""Return the state attributes."""
attributes = {}
attributes["state_class"] = STATE_CLASS_TOTAL
return attributes
=======
<<<<<<< HEAD
>>>>>>> master:custom_components/fpl/sensor_AverageDailySensor.py
class ActualDailyAverageSensor(FplMoneyEntity):
"""Actual daily average sensor"""
@@ -52,9 +82,27 @@ class ActualDailyAverageSensor(FplMoneyEntity):
@property
def state(self):
return self.getData("daily_avg")
<<<<<<< HEAD:custom_components/fpl1/sensor_AverageDailySensor.py
def customAttributes(self):
"""Return the state attributes."""
attributes = {}
attributes["state_class"] = STATE_CLASS_TOTAL
return attributes
=======
=======
@property
def icon(self):
return "mdi:currency-usd"
def defineAttributes(self):
"""Return the state attributes."""
attributes = {}
attributes["friendly_name"] = "Budget Daily Average"
attributes["device_class"] = "monitary"
attributes["state_class"] = "total"
attributes["unit_of_measurement"] = "$"
return attributes
>>>>>>> master
>>>>>>> master:custom_components/fpl/sensor_AverageDailySensor.py