sensors mini rework
This commit is contained in:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user