From c74c34bd910ceee825ad706357d8ea48398fb0ef Mon Sep 17 00:00:00 2001 From: puddly <32534428+puddly@users.noreply.github.com> Date: Mon, 14 Oct 2024 10:28:18 -0400 Subject: [PATCH] Move device concurrency out into its own constant --- zigpy/device.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/zigpy/device.py b/zigpy/device.py index 75a0ef6f0..f4d4503c5 100644 --- a/zigpy/device.py +++ b/zigpy/device.py @@ -50,6 +50,7 @@ LOGGER = logging.getLogger(__name__) PACKET_DEBOUNCE_WINDOW = 10 +MAX_DEVICE_CONCURRENCY = 1 AFTER_OTA_ATTR_READ_DELAY = 10 OTA_RETRY_DECORATOR = zigpy.util.retryable_request( @@ -95,7 +96,9 @@ def __init__(self, application: ControllerApplication, ieee: t.EUI64, nwk: t.NWK self._send_sequence: int = 0 self._packet_debouncer = zigpy.datastructures.Debouncer() - self._concurrent_requests_semaphore = zigpy.util.DynamicBoundedSemaphore(1) + self._concurrent_requests_semaphore = ( + zigpy.datastructures.PriorityDynamicBoundedSemaphore(MAX_DEVICE_CONCURRENCY) + ) # Retained for backwards compatibility, will be removed in a future release self.status = Status.NEW