-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
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
fix derived rate, fixes #20097 #21620
Conversation
…ome-assistant into fix-derived-rate-dsmr
…ome-assistant into fix-derived-rate-dsmr
…ome-assistant into fix-derived-rate-dsmr
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for clicking around, in fact I had one more comment.
Took values from my own smart meter for the test
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, thank you 🎉
by chance I added this component as a custom_component to already use my changes in advance. But I'm getting an error after this PR;
|
@leeuwte Thanks for testing 👍. Please file a GitHub issue to track this regression. |
Description:
The rate (m3/h) was calculated as current_reading - previous_reading. So time was not considered.
This PR fixes the rate by calculating the time between the readings and converting that to m3/h.
Related issue (if applicable): fixes #20097
Pull request in home-assistant.io with documentation (if applicable): home-assistant/home-assistant.io#<home-assistant.io PR number goes here>
Example entry for
configuration.yaml
(if applicable):Checklist:
tox
. Your PR cannot be merged unless tests passIf user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
REQUIREMENTS
variable (example).requirements_all.txt
by runningscript/gen_requirements_all.py
..coveragerc
.If the code does not interact with devices: