Skip to content

Commit 664cf19

Browse files
authored
Enable long-term statistics
Set state_class to 'measurement' so long-term statistics are generated Testing: I made this on my local copy and noticed this sensor was now an option in the statistics card
1 parent 56bcb52 commit 664cf19

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

custom_components/redfin/sensor.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,11 @@ def state(self):
7474
except ValueError:
7575
return None
7676

77+
@property
78+
def state_class(self):
79+
# set state_class to 'measurement' so long-term statistics are generated
80+
return STATE_CLASS_MEASUREMENT
81+
7782
@property
7883
def extra_state_attributes(self):
7984
"""Return the state attributes."""

0 commit comments

Comments
 (0)