36 lines
1.0 KiB
Python
36 lines
1.0 KiB
Python
from homeassistant.components.sensor import STATE_CLASS_TOTAL_INCREASING
|
|
from .fplEntity import FplEnergyEntity
|
|
|
|
|
|
class ProjectedKWHSensor(FplEnergyEntity):
|
|
def __init__(self, coordinator, config, account):
|
|
super().__init__(coordinator, config, account, "Projected KWH")
|
|
|
|
@property
|
|
def state(self):
|
|
return self.getData("projectedKWH")
|
|
|
|
|
|
class DailyAverageKWHSensor(FplEnergyEntity):
|
|
def __init__(self, coordinator, config, account):
|
|
super().__init__(coordinator, config, account, "Daily Average KWH")
|
|
|
|
@property
|
|
def state(self):
|
|
return self.getData("dailyAverageKWH")
|
|
|
|
|
|
class BillToDateKWHSensor(FplEnergyEntity):
|
|
def __init__(self, coordinator, config, account):
|
|
super().__init__(coordinator, config, account, "Bill To Date KWH")
|
|
|
|
@property
|
|
def state(self):
|
|
return self.getData("billToDateKWH")
|
|
|
|
@property
|
|
def state_class(self) -> str:
|
|
"""Return the state class of this entity, from STATE_CLASSES, if any."""
|
|
|
|
return STATE_CLASS_TOTAL_INCREASING
|