Reduce number of parallel api calls to august (#66328)

pull/66290/head^2
J. Nick Koston 2022-02-11 11:07:32 -06:00 committed by GitHub
parent acf2033734
commit 323af9f59c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 5 deletions

View File

@ -107,11 +107,10 @@ class AugustData(AugustSubscriberMixin):
async def async_setup(self): async def async_setup(self):
"""Async setup of august device data and activities.""" """Async setup of august device data and activities."""
token = self._august_gateway.access_token token = self._august_gateway.access_token
user_data, locks, doorbells = await asyncio.gather( # This used to be a gather but it was less reliable with august's recent api changes.
self._api.async_get_user(token), user_data = await self._api.async_get_user(token)
self._api.async_get_operable_locks(token), locks = await self._api.async_get_operable_locks(token)
self._api.async_get_doorbells(token), doorbells = await self._api.async_get_doorbells(token)
)
if not doorbells: if not doorbells:
doorbells = [] doorbells = []
if not locks: if not locks: