Fixing sensor metadata

This commit is contained in:
Adam Outler
2021-12-30 15:07:04 -05:00
parent 621fea3042
commit 485717d662
5 changed files with 48 additions and 28 deletions

View File

@@ -18,8 +18,8 @@ class FplProjectedBillSensor(FplEntity):
def defineAttributes(self):
"""Return the state attributes."""
attributes = {}
attributes["friendly_name"] = "Projected Bill"
attributes["device_class"] = "monitary"
attributes["friendly_name"] = "Projected Bill Payment Due"
attributes["device_class"] = "monetary"
attributes["state_class"] = "total"
attributes["unit_of_measurement"] = "$"
return attributes
@@ -32,12 +32,12 @@ class FplProjectedBillSensor(FplEntity):
# Defered Amount
class DeferedAmountSensor(FplEntity):
def __init__(self, coordinator, config, account):
super().__init__(coordinator, config, account, "Defered Amount")
super().__init__(coordinator, config, account, "Deferred Amount")
@property
def state(self):
if self.getData("defered_amount") is not None:
return self.getData("defered_amount")
if self.getData("deferred_amount") is not None:
return self.getData("deferred_amount")
return 0
@property
@@ -47,8 +47,8 @@ class DeferedAmountSensor(FplEntity):
def defineAttributes(self):
"""Return the state attributes."""
attributes = {}
attributes["friendly_name"] = "Defered Amount"
attributes["device_class"] = "monitary"
attributes["friendly_name"] = "Deferred Amount"
attributes["device_class"] = "monetary"
attributes["state_class"] = "total"
attributes["unit_of_measurement"] = "$"
return attributes