-
Couldn't load subscription status.
- Fork 2
Change energy to use energy_consumed and energy_delivered #20
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
Change energy to use energy_consumed and energy_delivered #20
Conversation
| consumption = ( | ||
| sum( | ||
| m2.value - m1.value | ||
| for m1, m2 in zip(consumption_samples, consumption_samples[1:]) |
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.
This should check that the diff is positive, because the energy can reset in between. Same for production
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.
Should I use something like max(0, m2.value - m1.value) to set it to 0 in case there is a reset?
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.
Yes, that's an option, or add a if m2.value > m1.value in the next line (same as for the power case).
bde35b8 to
99deaf4
Compare
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.
Just a bit more info in the release notes, code LGTM
RELEASE_NOTES.md
Outdated
| ## New Features | ||
|
|
||
| * Add Readme information | ||
| * Use energy_consumed and energy_delivered |
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.
This needs more context.
99deaf4 to
888da9a
Compare
Signed-off-by: Flora <[email protected]>
888da9a to
2ae6df7
Compare
Addresses issue #18.