-
-
Notifications
You must be signed in to change notification settings - Fork 29.9k
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
Added 'change' field to statistics sensor #7820
Conversation
Hello @jminn, When attempting to inspect the commits of your pull request for CLA signature status among all authors we encountered commit(s) which were not linked to a GitHub account, thus not allowing us to determine their status(es). The commits that are missing a linked GitHub account are the following:
Unfortunately, we are unable to accept this pull request until this situation is corrected. Here are your options:
We apologize for this inconvenience, especially since it usually bites new contributors to Home Assistant. We hope you understand the need for us to protect ourselves and the great community we all have built legally. The best thing to come out of this is that you only need to fix this once and it benefits the entire Home Assistant and GitHub community. Thanks, I look forward to checking this PR again soon! ❤️ |
@@ -74,6 +76,8 @@ def test_sensor_source(self): | |||
self.assertEqual(self.count, state.attributes.get('count')) | |||
self.assertEqual(self.total, state.attributes.get('total')) | |||
self.assertEqual('°C', state.attributes.get('unit_of_measurement')) | |||
self.assertEqual(self.change, state.attributes.get('change')) | |||
self.assertEqual(self.average_change, state.attributes.get('average_change')) |
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.
line too long (85 > 79 characters)
@@ -74,6 +76,8 @@ def test_sensor_source(self): | |||
self.assertEqual(self.count, state.attributes.get('count')) | |||
self.assertEqual(self.total, state.attributes.get('total')) | |||
self.assertEqual('°C', state.attributes.get('unit_of_measurement')) | |||
self.assertEqual(self.change, state.attributes.get('change')) | |||
self.assertEqual(self.average_change, state.attributes.get('average_change')) |
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.
line too long (85 > 79 characters)
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.
Leave a comment
Description:
Add 'change' field to statistics sensor to provide basic rate-of-change info. Also added an 'average_change' field to provide the average change between samples in case 'sampling_rate' is > 2.
Use case: I have a sensor that just reads a counter and I want to see the rate of change over the last update interval.
Checklist:
If the code does not interact with devices:
tox
run successfully. Your PR cannot be merged unless tests pass