merge changes into primary folder

This commit is contained in:
Adam Outler
2021-12-30 14:44:27 -05:00
parent 0a75b189b7
commit 621fea3042
29 changed files with 244 additions and 1467 deletions

View File

@@ -3,7 +3,7 @@ from .fplEntity import FplEntity
class ProjectedKWHSensor(FplEntity):
def __init__(self, coordinator, config, account):
super().__init__(coordinator, config, account, "Projected KWH")
super().__init__(coordinator, config, account, "Projected")
@property
def state(self):
@@ -12,11 +12,18 @@ class ProjectedKWHSensor(FplEntity):
@property
def icon(self):
return "mdi:flash"
def defineAttributes(self):
"""Return the state attributes."""
attributes = {}
attributes["friendly_name"] = "Projected KWH"
attributes["device_class"] = "energy"
attributes["state_class"] = "total_increasing"
attributes["unit_of_measurement"] = "kWh"
return attributes
class DailyAverageKWHSensor(FplEntity):
def __init__(self, coordinator, config, account):
super().__init__(coordinator, config, account, "Daily Average KWH")
super().__init__(coordinator, config, account, "Daily Average")
@property
def state(self):
@@ -26,10 +33,18 @@ class DailyAverageKWHSensor(FplEntity):
def icon(self):
return "mdi:flash"
def defineAttributes(self):
"""Return the state attributes."""
attributes = {}
attributes["friendly_name"] = "Daily Average"
attributes["device_class"] = "energy"
attributes["state_class"] = "total_increasing"
attributes["unit_of_measurement"] = "kWh"
return attributes
class BillToDateKWHSensor(FplEntity):
def __init__(self, coordinator, config, account):
super().__init__(coordinator, config, account, "Bill To Date KWH")
super().__init__(coordinator, config, account, "Bill To Date")
@property
def state(self):
@@ -39,9 +54,18 @@ class BillToDateKWHSensor(FplEntity):
def icon(self):
return "mdi:flash"
def defineAttributes(self):
"""Return the state attributes."""
attributes = {}
attributes["friendly_name"] = "Bill To Date"
attributes["device_class"] = "energy"
attributes["state_class"] = "total_increasing"
attributes["unit_of_measurement"] = "kWh"
return attributes
class NetReceivedKWHSensor(FplEntity):
def __init__(self, coordinator, config, account):
super().__init__(coordinator, config, account, "Received Meter Reading KWH")
super().__init__(coordinator, config, account, "Received Reading")
@property
def state(self):
@@ -51,9 +75,20 @@ class NetReceivedKWHSensor(FplEntity):
def icon(self):
return "mdi:flash"
def defineAttributes(self):
"""Return the state attributes."""
attributes = {}
attributes["friendly_name"] = "Meter Return to Grid"
attributes["device_class"] = "energy"
attributes["state_class"] = "total_increasing"
attributes["unit_of_measurement"] = "kWh"
attributes["last_reset"] = self.getData("billStartDate")
return attributes
class NetDeliveredKWHSensor(FplEntity):
def __init__(self, coordinator, config, account):
super().__init__(coordinator, config, account, "Delivered Meter Reading KWH")
super().__init__(coordinator, config, account, "Delivered Reading")
@property
def state(self):
@@ -62,3 +97,14 @@ class NetDeliveredKWHSensor(FplEntity):
@property
def icon(self):
return "mdi:flash"
def defineAttributes(self):
"""Return the state attributes."""
attributes = {}
attributes["friendly_name"] = "Meter Consumption"
attributes["device_class"] = "energy"
attributes["state_class"] = "total_increasing"
attributes["unit_of_measurement"] = "kWh"
attributes["last_reset"] = self.getData("billStartDate")
return attributes