mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 13:17:32 +00:00
Return native timestamps for home connect (#61116)
This commit is contained in:
parent
d802f3a82f
commit
e712b80650
@ -63,16 +63,14 @@ class HomeConnectSensor(HomeConnectEntity, SensorEntity):
|
||||
elif (
|
||||
self._state is not None
|
||||
and self._sign == 1
|
||||
and dt_util.parse_datetime(self._state) < dt_util.utcnow()
|
||||
and self._state < dt_util.utcnow()
|
||||
):
|
||||
# if the date is supposed to be in the future but we're
|
||||
# already past it, set state to None.
|
||||
self._state = None
|
||||
else:
|
||||
seconds = self._sign * float(status[self._key][ATTR_VALUE])
|
||||
self._state = (
|
||||
dt_util.utcnow() + timedelta(seconds=seconds)
|
||||
).isoformat()
|
||||
self._state = dt_util.utcnow() + timedelta(seconds=seconds)
|
||||
else:
|
||||
self._state = status[self._key].get(ATTR_VALUE)
|
||||
if self._key == BSH_OPERATION_STATE:
|
||||
|
Loading…
x
Reference in New Issue
Block a user