Skip to content

Commit

Permalink
Move device concurrency out into its own constant
Browse files Browse the repository at this point in the history
  • Loading branch information
puddly committed Oct 14, 2024
1 parent ec6a06b commit c74c34b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion zigpy/device.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit c74c34b

Please # to comment.