sensors mini rework

This commit is contained in:
Yordan Suarez
2021-12-13 12:02:39 -05:00
parent c4623d8234
commit ef2516ada4
6 changed files with 104 additions and 89 deletions

View File

@@ -1,7 +1,7 @@
from .fplEntity import FplEntity
from .fplEntity import FplDateEntity
class CurrentBillDateSensor(FplEntity):
class CurrentBillDateSensor(FplDateEntity):
def __init__(self, coordinator, config, account):
super().__init__(coordinator, config, account, "Current Bill Date")
@@ -9,12 +9,8 @@ class CurrentBillDateSensor(FplEntity):
def state(self):
return self.getData("current_bill_date")
@property
def icon(self):
return "mdi:calendar"
class NextBillDateSensor(FplEntity):
class NextBillDateSensor(FplDateEntity):
def __init__(self, coordinator, config, account):
super().__init__(coordinator, config, account, "Next Bill Date")
@@ -22,12 +18,8 @@ class NextBillDateSensor(FplEntity):
def state(self):
return self.getData("next_bill_date")
@property
def icon(self):
return "mdi:calendar"
class ServiceDaysSensor(FplEntity):
class ServiceDaysSensor(FplDateEntity):
def __init__(self, coordinator, config, account):
super().__init__(coordinator, config, account, "Service Days")
@@ -35,12 +27,8 @@ class ServiceDaysSensor(FplEntity):
def state(self):
return self.getData("service_days")
@property
def icon(self):
return "mdi:calendar"
class AsOfDaysSensor(FplEntity):
class AsOfDaysSensor(FplDateEntity):
def __init__(self, coordinator, config, account):
super().__init__(coordinator, config, account, "As Of Days")
@@ -48,19 +36,11 @@ class AsOfDaysSensor(FplEntity):
def state(self):
return self.getData("as_of_days")
@property
def icon(self):
return "mdi:calendar"
class RemainingDaysSensor(FplEntity):
class RemainingDaysSensor(FplDateEntity):
def __init__(self, coordinator, config, account):
super().__init__(coordinator, config, account, "Remaining Days")
@property
def state(self):
return self.getData("remaining_days")
@property
def icon(self):
return "mdi:calendar"