temporal fpl1 folder
This commit is contained in:
28
custom_components/fpl1/TestSensor.py
Normal file
28
custom_components/fpl1/TestSensor.py
Normal file
@@ -0,0 +1,28 @@
|
||||
from .fplEntity import FplEntity
|
||||
import pprint
|
||||
|
||||
|
||||
class TestSensor(FplEntity):
|
||||
def __init__(self, coordinator, config, account):
|
||||
super().__init__(coordinator, config, account, "Test Sensor")
|
||||
|
||||
@property
|
||||
def state(self):
|
||||
pprint.pprint(self.coordinator.data)
|
||||
|
||||
return self.getData("projected_bill")
|
||||
|
||||
def defineAttributes(self):
|
||||
"""Return the state attributes."""
|
||||
attributes = {}
|
||||
try:
|
||||
if self.getData("budget_bill"):
|
||||
attributes["budget_bill"] = self.getData("budget_bill")
|
||||
except:
|
||||
pass
|
||||
|
||||
return attributes
|
||||
|
||||
@property
|
||||
def icon(self):
|
||||
return "mdi:currency-usd"
|
||||
Reference in New Issue
Block a user