1
mirror of https://github.com/home-assistant/core synced 2024-08-02 23:40:32 +02:00

Strip microseconds on state.last_updated

This commit is contained in:
Paulus Schoutsen 2015-04-29 08:18:53 -07:00
parent 10a5db7924
commit 040dd3c409

View File

@ -496,7 +496,8 @@ class State(object):
self.entity_id = entity_id.lower()
self.state = state
self.attributes = attributes or {}
self.last_updated = last_updated or date_util.utcnow()
self.last_updated = date_util.strip_microseconds(
last_updated or date_util.utcnow())
# Strip microsecond from last_changed else we cannot guarantee
# state == State.from_dict(state.as_dict())