Skip to content
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 TypeError #21734

Merged
merged 5 commits into from Mar 9, 2019
Merged
Diff settings

Always

Just for now

@@ -351,7 +351,7 @@ def state(self):
# Recalculate the rate
diff = current_reading - self._previous_reading
timediff = timestamp - self._previous_timestamp
self._state = diff / timediff * 3600
self._state = diff / timediff.total_seconds() * 3600

self._previous_reading = current_reading
self._previous_timestamp = timestamp
@@ -12,6 +12,7 @@
import asynctest
from homeassistant.bootstrap import async_setup_component
from homeassistant.components.sensor.dsmr import DerivativeDSMREntity
import datetime
import pytest
from tests.common import assert_setup_component

@@ -104,7 +105,7 @@ def test_derivative():

entity.telegram = {
'1.0.0': MBusObject([
{'value': 1551642213},
{'value': datetime.datetime.fromtimestamp(1551642213)},
{'value': 745.695, 'unit': 'm3'},
])
}
@@ -115,7 +116,7 @@ def test_derivative():

entity.telegram = {
'1.0.0': MBusObject([
{'value': 1551642543},
{'value': datetime.datetime.fromtimestamp(1551642543)},
{'value': 745.698, 'unit': 'm3'},
])
}
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.