Reduce number of parallel api calls to august (#66328)
parent
acf2033734
commit
323af9f59c
|
@ -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:
|
||||||
|
|
Loading…
Reference in New Issue