Tibber, correct generate a 0-timestamp (#52165)

* Tibber, correct generate a 0-timestamp

* import

Signed-off-by: Daniel Hjelseth Høyer <github@dahoiv.net>
This commit is contained in:
Daniel Hjelseth Høyer 2021-06-24 21:18:46 +02:00 committed by GitHub
parent a2be9a487f
commit e039a9d37b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,6 +1,6 @@
"""Support for Tibber sensors.""" """Support for Tibber sensors."""
import asyncio import asyncio
from datetime import datetime, timedelta from datetime import timedelta
import logging import logging
from random import randrange from random import randrange
@ -311,7 +311,7 @@ class TibberSensorRT(TibberSensor):
"last meter consumption", "last meter consumption",
"last meter production", "last meter production",
]: ]:
self._attr_last_reset = datetime.fromtimestamp(0) self._attr_last_reset = dt_util.utc_from_timestamp(0)
elif self._sensor_name in [ elif self._sensor_name in [
"accumulated consumption", "accumulated consumption",
"accumulated production", "accumulated production",