Skip to content

Commit 918d3eb

Browse files
authored
Make system update run coroutines in order (and not simultaneously) (#269)
1 parent 029ea5e commit 918d3eb

2 files changed

Lines changed: 4 additions & 6 deletions

File tree

simplipy/api.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ def __init__(
8181
self.request = backoff.on_exception(
8282
backoff.expo,
8383
ClientResponseError,
84+
jitter=backoff.random_jitter,
8485
logger=LOGGER,
8586
max_tries=request_retries,
8687
on_backoff=self._async_handle_on_backoff,

simplipy/system/__init__.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
"""Define V2 and V3 SimpliSafe systems."""
22
from __future__ import annotations
33

4-
import asyncio
54
from dataclasses import dataclass
65
from datetime import datetime
76
from enum import Enum
@@ -388,14 +387,12 @@ async def async_update(
388387
:param cached: Whether to used cached data.
389388
:type cached: ``bool``
390389
"""
391-
update_tasks = []
392390
if include_subscription:
393-
update_tasks.append(self._async_update_subscription_data())
391+
await self._async_update_subscription_data()
394392
if include_settings:
395-
update_tasks.append(self._async_update_settings_data(cached))
393+
await self._async_update_settings_data(cached)
396394
if include_devices:
397-
update_tasks.append(self._async_update_device_data(cached))
398-
await asyncio.gather(*update_tasks)
395+
await self._async_update_device_data(cached)
399396

400397
# Create notifications:
401398
self._notifications = [

0 commit comments

Comments
 (0)