testing native value property
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
"""Projected bill sensors"""
|
"""Projected bill sensors"""
|
||||||
from homeassistant.components.sensor import (
|
from homeassistant.components.sensor import (
|
||||||
STATE_CLASS_TOTAL_INCREASING,
|
# STATE_CLASS_TOTAL_INCREASING,
|
||||||
STATE_CLASS_TOTAL,
|
STATE_CLASS_TOTAL,
|
||||||
)
|
)
|
||||||
from .fplEntity import FplMoneyEntity
|
from .fplEntity import FplMoneyEntity
|
||||||
@@ -12,6 +12,17 @@ class FplProjectedBillSensor(FplMoneyEntity):
|
|||||||
def __init__(self, coordinator, config, account):
|
def __init__(self, coordinator, config, account):
|
||||||
super().__init__(coordinator, config, account, "Projected Bill")
|
super().__init__(coordinator, config, account, "Projected Bill")
|
||||||
|
|
||||||
|
@property
|
||||||
|
def native_value(self):
|
||||||
|
budget = self.getData("budget_bill")
|
||||||
|
budget_billing_projected_bill = self.getData("budget_billing_projected_bill")
|
||||||
|
|
||||||
|
if budget and budget_billing_projected_bill is not None:
|
||||||
|
return self.getData("budget_billing_projected_bill")
|
||||||
|
|
||||||
|
return self.getData("projected_bill")
|
||||||
|
|
||||||
|
"""
|
||||||
@property
|
@property
|
||||||
def state(self):
|
def state(self):
|
||||||
budget = self.getData("budget_bill")
|
budget = self.getData("budget_bill")
|
||||||
@@ -21,6 +32,7 @@ class FplProjectedBillSensor(FplMoneyEntity):
|
|||||||
return self.getData("budget_billing_projected_bill")
|
return self.getData("budget_billing_projected_bill")
|
||||||
|
|
||||||
return self.getData("projected_bill")
|
return self.getData("projected_bill")
|
||||||
|
"""
|
||||||
|
|
||||||
def customAttributes(self):
|
def customAttributes(self):
|
||||||
"""Return the state attributes."""
|
"""Return the state attributes."""
|
||||||
|
|||||||
Reference in New Issue
Block a user