mirror of
https://github.com/home-assistant/core.git
synced 2025-07-21 12:17:07 +00:00
Ensure status is correct at start for older august bridges (#64144)
This commit is contained in:
parent
06329a2f43
commit
d1831748eb
@ -141,9 +141,15 @@ class AugustData(AugustSubscriberMixin):
|
||||
self._pubnub_unsub = async_create_pubnub(user_data["UserID"], pubnub)
|
||||
|
||||
if self._locks_by_id:
|
||||
await asyncio.gather(
|
||||
*[self.async_status_async(lock_id) for lock_id in self._locks_by_id]
|
||||
)
|
||||
tasks = []
|
||||
for lock_id in self._locks_by_id:
|
||||
detail = self._device_detail_by_id[lock_id]
|
||||
tasks.append(
|
||||
self.async_status_async(
|
||||
lock_id, bool(detail.bridge and detail.bridge.hyper_bridge)
|
||||
)
|
||||
)
|
||||
await asyncio.gather(*tasks)
|
||||
|
||||
@callback
|
||||
def async_pubnub_message(self, device_id, date_time, message):
|
||||
@ -252,13 +258,14 @@ class AugustData(AugustSubscriberMixin):
|
||||
device_id,
|
||||
)
|
||||
|
||||
async def async_status_async(self, device_id):
|
||||
async def async_status_async(self, device_id, hyper_bridge):
|
||||
"""Request status of the the device but do not wait for a response since it will come via pubnub."""
|
||||
return await self._async_call_api_op_requires_bridge(
|
||||
device_id,
|
||||
self._api.async_status_async,
|
||||
self._august_gateway.access_token,
|
||||
device_id,
|
||||
hyper_bridge,
|
||||
)
|
||||
|
||||
async def async_lock_async(self, device_id, hyper_bridge):
|
||||
|
Loading…
x
Reference in New Issue
Block a user