removed some unused files
This commit is contained in:
@@ -1,20 +0,0 @@
|
|||||||
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):
|
|
||||||
try:
|
|
||||||
if "daily_avg" in self.data:
|
|
||||||
self._state = self.data["daily_avg"]
|
|
||||||
except:
|
|
||||||
pass
|
|
||||||
return self._state
|
|
||||||
|
|
||||||
@property
|
|
||||||
def device_state_attributes(self):
|
|
||||||
"""Return the state attributes."""
|
|
||||||
return self.attr
|
|
||||||
@@ -1,31 +0,0 @@
|
|||||||
from .FplSensor import FplSensor
|
|
||||||
|
|
||||||
|
|
||||||
class FplDailyUsageSensor(FplSensor):
|
|
||||||
def __init__(self, hass, config, account):
|
|
||||||
FplSensor.__init__(self, hass, config, account, "Daily Usage")
|
|
||||||
|
|
||||||
@property
|
|
||||||
def state(self):
|
|
||||||
try:
|
|
||||||
if "daily_usage" in self.data:
|
|
||||||
if len(self.data["daily_usage"]) > 0:
|
|
||||||
if "cost" in self.data["daily_usage"][-1]:
|
|
||||||
self._state = self.data["daily_usage"][-1]["cost"]
|
|
||||||
except:
|
|
||||||
pass
|
|
||||||
|
|
||||||
return self._state
|
|
||||||
|
|
||||||
@property
|
|
||||||
def device_state_attributes(self):
|
|
||||||
"""Return the state attributes."""
|
|
||||||
try:
|
|
||||||
if "daily_usage" in self.data:
|
|
||||||
if len(self.data["daily_usage"]) > 0:
|
|
||||||
if "date" in self.data["daily_usage"][-1]:
|
|
||||||
self.attr["date"] = self.data["daily_usage"][-1]["date"]
|
|
||||||
except:
|
|
||||||
pass
|
|
||||||
|
|
||||||
return self.attr
|
|
||||||
@@ -1,37 +0,0 @@
|
|||||||
from .FplSensor import FplSensor
|
|
||||||
|
|
||||||
|
|
||||||
class FplProjectedBillSensor(FplSensor):
|
|
||||||
def __init__(self, hass, config, account):
|
|
||||||
FplSensor.__init__(self, hass, config, account, "Projected Bill")
|
|
||||||
|
|
||||||
@property
|
|
||||||
def state(self):
|
|
||||||
data = self.data
|
|
||||||
try:
|
|
||||||
if "budget_bill" in data.keys():
|
|
||||||
if data["budget_bill"]:
|
|
||||||
if "budget_billing_projected_bill" in data.keys():
|
|
||||||
self._state = data["budget_billing_projected_bill"]
|
|
||||||
else:
|
|
||||||
if "projected_bill" in data.keys():
|
|
||||||
self._state = data["projected_bill"]
|
|
||||||
except:
|
|
||||||
pass
|
|
||||||
|
|
||||||
return self._state
|
|
||||||
|
|
||||||
@property
|
|
||||||
def device_state_attributes(self):
|
|
||||||
"""Return the state attributes."""
|
|
||||||
try:
|
|
||||||
if "budget_bill" in self.data.keys():
|
|
||||||
self.attr["budget_bill"] = self.data["budget_bill"]
|
|
||||||
except:
|
|
||||||
pass
|
|
||||||
|
|
||||||
return self.attr
|
|
||||||
|
|
||||||
@property
|
|
||||||
def icon(self):
|
|
||||||
return "mdi:currency-usd"
|
|
||||||
@@ -26,7 +26,6 @@ from .sensor_AverageDailySensor import (
|
|||||||
from .sensor_DailyUsageSensor import FplDailyUsageKWHSensor, FplDailyUsageSensor
|
from .sensor_DailyUsageSensor import FplDailyUsageKWHSensor, FplDailyUsageSensor
|
||||||
from .const import DOMAIN
|
from .const import DOMAIN
|
||||||
|
|
||||||
from .sensor_AllData import AllDataSensor
|
|
||||||
from .TestSensor import TestSensor
|
from .TestSensor import TestSensor
|
||||||
|
|
||||||
|
|
||||||
@@ -40,8 +39,6 @@ async def async_setup_entry(hass, entry, async_add_devices):
|
|||||||
for account in accounts:
|
for account in accounts:
|
||||||
# Test Sensor
|
# Test Sensor
|
||||||
# fpl_accounts.append(TestSensor(coordinator, entry, account))
|
# fpl_accounts.append(TestSensor(coordinator, entry, account))
|
||||||
# All data sensor
|
|
||||||
# fpl_accounts.append(AllDataSensor(coordinator, entry, account))
|
|
||||||
|
|
||||||
# bill sensors
|
# bill sensors
|
||||||
fpl_accounts.append(FplProjectedBillSensor(coordinator, entry, account))
|
fpl_accounts.append(FplProjectedBillSensor(coordinator, entry, account))
|
||||||
|
|||||||
@@ -1,24 +0,0 @@
|
|||||||
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