Skip to content

Commit

Permalink
Merge pull request #329 from dvd-dev/missing_await
Browse files Browse the repository at this point in the history
Missing await and replacing another instance of non-cached
  • Loading branch information
valleedelisle authored Dec 8, 2023
2 parents f56ddab + e546198 commit 596e1bd
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions custom_components/hilo/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -582,10 +582,7 @@ async def _async_update(self):
# No point updating events for previously completed events, they won't change.
event = current_history_event
else:
# Either it is an unknown event, one that is still in progress or a recent one, get the details.
details = await self._hilo._api.get_gd_events(
self._hilo.devices.location_id, event_id=raw_event["id"]
)
details = await self._hilo.get_event_details(raw_event["id"])
event = Event(**details).as_dict()

events.append(event)
Expand Down Expand Up @@ -667,7 +664,7 @@ async def _async_update(self):
events = await self._hilo._api.get_gd_events(self._hilo.devices.location_id)
LOG.debug(f"Events received from Hilo: {events}")
for raw_event in events:
details = self._hilo.get_event_details(raw_event["id"])
details = await self._hilo.get_event_details(raw_event["id"])
event = Event(**details)
if self._hilo.appreciation > 0:
event.appreciation(self._hilo.appreciation)
Expand Down

0 comments on commit 596e1bd

Please sign in to comment.