Created new sensor with specific data and group them by devices(account)
This commit is contained in:
15
custom_components/fpl/AverageDailySensor.py
Normal file
15
custom_components/fpl/AverageDailySensor.py
Normal file
@@ -0,0 +1,15 @@
|
||||
from .FplSensor import FplSensor
|
||||
|
||||
|
||||
class FplAverageDailySensor(FplSensor):
|
||||
def __init__(self, hass, config, account):
|
||||
FplSensor.__init__(self, hass, config, account, "Average Daily")
|
||||
|
||||
@property
|
||||
def state(self):
|
||||
return self.data["daily_avg"]
|
||||
|
||||
@property
|
||||
def device_state_attributes(self):
|
||||
"""Return the state attributes."""
|
||||
return self.attr
|
||||
Reference in New Issue
Block a user