Skip to content

Add additional characteristics to the statistics integration#62631

Merged
emontnemery merged 6 commits intohome-assistant:devfrom
ThomDietrich:statistics-new-characteristics
May 4, 2022
Merged

Add additional characteristics to the statistics integration#62631
emontnemery merged 6 commits intohome-assistant:devfrom
ThomDietrich:statistics-new-characteristics

Conversation

@ThomDietrich
Copy link
Copy Markdown
Contributor

@ThomDietrich ThomDietrich commented Dec 22, 2021

Proposed change

Adds characteristics:

  • datetime_value_max / datetime_value_min for numeric sensors
  • datetime_oldest / datetime_newest for binary sensors
  • count_on / count_off for binary sensors

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New integration (thank you!)
  • New feature (which adds functionality to an existing integration)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

Checklist

  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • The code has been formatted using Black (black --fast homeassistant tests)
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly.
    Updated and included derived files by running: python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • For the updated dependencies - a link to the changelog, or at minimum a diff between library versions is added to the PR description.
  • Untested files have been added to .coveragerc.

The integration reached or maintains the following Integration Quality Scale:

  • No score or internal
  • 🥈 Silver
  • 🥇 Gold
  • 🏆 Platinum

To help with the load of incoming pull requests:

@probot-home-assistant
Copy link
Copy Markdown

Hey there @fabaff, mind taking a look at this pull request as it has been labeled with an integration (statistics) you are listed as a code owner for? Thanks!
(message by CodeOwnersMention)

@emufan
Copy link
Copy Markdown
Contributor

emufan commented Jan 6, 2022

Like to see this merged. Tested without problems locally.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 6, 2022

There hasn't been any activity on this pull request recently. This pull request has been automatically marked as stale because of that and will be closed if no further activity occurs within 7 days.
Thank you for your contributions.

@github-actions github-actions bot added the stale label Apr 6, 2022
@emufan
Copy link
Copy Markdown
Contributor

emufan commented Apr 6, 2022

Up.

@github-actions github-actions bot removed the stale label Apr 6, 2022
@ThomDietrich
Copy link
Copy Markdown
Contributor Author

Thanks @emufan. I did reserve this evening for next steps with all open PRs.

@ThomDietrich
Copy link
Copy Markdown
Contributor Author

@emontnemery ready for review. Thanks!

@emontnemery
Copy link
Copy Markdown
Contributor

Just a question about:
datetime_value_max / datetime_value_min for numeric sensors

I think that should be:
datetime_value_max / datetime_value_min for timestamp sensors

@emufan
Copy link
Copy Markdown
Contributor

emufan commented Apr 29, 2022

Just a question about: datetime_value_max / datetime_value_min for numeric sensors

I think that should be: datetime_value_max / datetime_value_min for timestamp sensors

It is providing the time, when the numeric sensors had their max and min. E.g. Min temperature of a thermometer. state_characteristic: value_min delivers 4 (°C) and the new state_characteristic: datetime_value_min delivers the additional, very valuable info 2022-04-29T02:35:49+00:00

And it is working for longer time here tested locally.

@ThomDietrich
Copy link
Copy Markdown
Contributor Author

@emufan 👌

@emontnemery the description is talking about "numeric source sensors", i.e. the observed sensor provides a numeric value and the statistic produces the datetime of its maximum/minimum value.

@emontnemery emontnemery merged commit f2d6a06 into home-assistant:dev May 4, 2022
@ThomDietrich ThomDietrich deleted the statistics-new-characteristics branch May 4, 2022 21:24
@github-actions github-actions bot locked and limited conversation to collaborators May 5, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants