merge changes into primary folder
This commit is contained in:
@@ -1,35 +1,47 @@
|
||||
from .fplEntity import FplEntity
|
||||
|
||||
import datetime
|
||||
|
||||
class CurrentBillDateSensor(FplEntity):
|
||||
def __init__(self, coordinator, config, account):
|
||||
super().__init__(coordinator, config, account, "Current Bill Date")
|
||||
super().__init__(coordinator, config, account, "Billing Current Date")
|
||||
|
||||
@property
|
||||
def state(self):
|
||||
return self.getData("current_bill_date")
|
||||
return datetime.date.fromisoformat(self.getData("current_bill_date"))
|
||||
|
||||
@property
|
||||
def icon(self):
|
||||
return "mdi:calendar"
|
||||
|
||||
def defineAttributes(self):
|
||||
"""Return the state attributes."""
|
||||
attributes = {}
|
||||
attributes["device_class"] = "date"
|
||||
attributes["friendly_name"] = "Billing Current"
|
||||
return attributes
|
||||
|
||||
class NextBillDateSensor(FplEntity):
|
||||
def __init__(self, coordinator, config, account):
|
||||
super().__init__(coordinator, config, account, "Next Bill Date")
|
||||
super().__init__(coordinator, config, account, "Billing Next")
|
||||
|
||||
@property
|
||||
def state(self):
|
||||
return self.getData("next_bill_date")
|
||||
return datetime.date.fromisoformat(self.getData("next_bill_date"))
|
||||
|
||||
@property
|
||||
def icon(self):
|
||||
return "mdi:calendar"
|
||||
|
||||
def defineAttributes(self):
|
||||
"""Return the state attributes."""
|
||||
attributes = {}
|
||||
attributes["device_class"] = "date"
|
||||
attributes["friendly_name"] = "Billing Next"
|
||||
return attributes
|
||||
|
||||
class ServiceDaysSensor(FplEntity):
|
||||
def __init__(self, coordinator, config, account):
|
||||
super().__init__(coordinator, config, account, "Service Days")
|
||||
super().__init__(coordinator, config, account, "Billing Total Days")
|
||||
|
||||
@property
|
||||
def state(self):
|
||||
@@ -39,10 +51,16 @@ class ServiceDaysSensor(FplEntity):
|
||||
def icon(self):
|
||||
return "mdi:calendar"
|
||||
|
||||
def defineAttributes(self):
|
||||
"""Return the state attributes."""
|
||||
attributes = {}
|
||||
attributes["unit_of_measurement"] = "days"
|
||||
attributes["friendly_name"] = "Billing Total"
|
||||
return attributes
|
||||
|
||||
class AsOfDaysSensor(FplEntity):
|
||||
def __init__(self, coordinator, config, account):
|
||||
super().__init__(coordinator, config, account, "As Of Days")
|
||||
super().__init__(coordinator, config, account, "Billing As Of")
|
||||
|
||||
@property
|
||||
def state(self):
|
||||
@@ -52,10 +70,16 @@ class AsOfDaysSensor(FplEntity):
|
||||
def icon(self):
|
||||
return "mdi:calendar"
|
||||
|
||||
def defineAttributes(self):
|
||||
"""Return the state attributes."""
|
||||
attributes = {}
|
||||
attributes["unit_of_measurement"] = "days"
|
||||
attributes["friendly_name"] = "Billing As Of"
|
||||
return attributes
|
||||
|
||||
class RemainingDaysSensor(FplEntity):
|
||||
def __init__(self, coordinator, config, account):
|
||||
super().__init__(coordinator, config, account, "Remaining Days")
|
||||
super().__init__(coordinator, config, account, "Billing Remaining")
|
||||
|
||||
@property
|
||||
def state(self):
|
||||
@@ -64,3 +88,10 @@ class RemainingDaysSensor(FplEntity):
|
||||
@property
|
||||
def icon(self):
|
||||
return "mdi:calendar"
|
||||
|
||||
def defineAttributes(self):
|
||||
"""Return the state attributes."""
|
||||
attributes = {}
|
||||
attributes["unit_of_measurement"] = "days"
|
||||
attributes["friendly_name"] = "Billing Remaining"
|
||||
return attributes
|
||||
|
||||
Reference in New Issue
Block a user