Fix rate of change calculation of statistics sensor (#32597)

* Fix rate of change of statistics sensor

* Fix test
This commit is contained in:
Florian Werner authored and GitHub committed 2020-03-11 09:33:00 -07:00
1 parent 440c837eb6
commit 5216dc0ae1
2 files changed
+2 -2

No files matched your search

+1 -1
View File
@@ -36,7 +36,7 @@ class TestStatisticsSensor(unittest.TestCase):
self.variance = round(statistics.variance(self.values), 2)
self.change = round(self.values[-1] - self.values[0], 2)
self.average_change = round(self.change / (len(self.values) - 1), 2)
self.change_rate = round(self.average_change / (60 * (self.count - 1)), 2)
self.change_rate = round(self.change / (60 * (self.count - 1)), 2)
def teardown_method(self, method):
"""Stop everything that was started."""