Skip to content

Commit

Permalink
Simplify initial event retrieval
Browse files Browse the repository at this point in the history
  • Loading branch information
bachya committed Feb 5, 2020
1 parent b885bd9 commit 1d89126
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions homeassistant/components/simplisafe/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -440,12 +440,12 @@ async def async_init(self):
# websocket doesn't provide the most recent event, we grab it from the REST
# API to ensure event-related attributes aren't empty on startup:
try:
most_recent_event = await system.get_latest_event()
self.initial_event_to_use[
system.system_id
] = await system.get_latest_event()
except SimplipyError as err:
_LOGGER.error("Error while fetching initial event: %s", err)
self.initial_event_to_use[system.system_id] = {}
else:
self.initial_event_to_use[system.system_id] = most_recent_event

async def refresh(event_time):
"""Refresh data from the SimpliSafe account."""
Expand Down

0 comments on commit 1d89126

Please sign in to comment.