Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable long-term statistics #8

Merged
merged 1 commit into from
Mar 8, 2023
Merged

Enable long-term statistics #8

merged 1 commit into from
Mar 8, 2023

Conversation

prestomation
Copy link
Contributor

Set state_class to 'measurement' so long-term statistics are generated

Fixes #7

Testing:
I made this on my local copy and noticed this sensor was now an option in the statistics card

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
@dreed47 dreed47 merged commit b7c6c16 into dreed47:main Mar 8, 2023
@broyuken
Copy link

@dreed47 Can you please create a release so that this gets pushed out via a hacs update?

@broyuken
Copy link

@prestomation I added in your changes and am getting the following when I reboot HA

Logger: homeassistant.components.sensor
Source: custom_components/redfin/sensor.py:80
Integration: Sensor (documentation, issues)
First occurred: 4:28:11 PM (2 occurrences)
Last logged: 4:28:11 PM

Error adding entities for domain sensor with platform redfin
Error while setting up redfin platform for sensor
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 442, in async_add_entities
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 629, in _async_add_entity
    capabilities=entity.capability_attributes,
  File "/usr/src/homeassistant/homeassistant/components/sensor/__init__.py", line 319, in capability_attributes
    if state_class := self.state_class:
  File "/config/custom_components/redfin/sensor.py", line 80, in state_class
    return STATE_CLASS_MEASUREMENT
NameError: name 'STATE_CLASS_MEASUREMENT' is not defined

any ideas?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Long term statistics
3 participants