Skip to content

Commit 4dc374b

Browse files
Copilotpuddly
andcommitted
Update concurrency from 2 to 4 and use max_concurrency instead of max_value
Co-authored-by: puddly <[email protected]>
1 parent 1cdd7a5 commit 4dc374b

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

tests/application/test_startup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -304,12 +304,12 @@ async def test_reset_network_info(device, make_application):
304304
"device, concurrency",
305305
[
306306
(FormedLaunchpadCC26X2R1, 16),
307-
(FormedZStack1CC2531, 2),
307+
(FormedZStack1CC2531, 4),
308308
],
309309
)
310310
async def test_concurrency_auto_config(device, concurrency, make_application):
311311
app, znp_server = make_application(server_cls=device)
312312
await app.connect()
313313
await app.start_network()
314314

315-
assert app._concurrent_requests_semaphore.max_value == concurrency
315+
assert app._concurrent_requests_semaphore.max_concurrency == concurrency

zigpy_znp/zigbee/application.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,12 +187,12 @@ async def start_network(self, *, read_only=False):
187187
None,
188188
zigpy.config.defaults.CONF_MAX_CONCURRENT_REQUESTS_DEFAULT,
189189
):
190-
max_concurrent_requests = 16 if self._znp.nvram.align_structs else 2
190+
max_concurrent_requests = 16 if self._znp.nvram.align_structs else 4
191191
else:
192192
max_concurrent_requests = self._config[conf.CONF_MAX_CONCURRENT_REQUESTS]
193193

194194
# Update the max value of the concurrent request semaphore at runtime
195-
self._concurrent_requests_semaphore.max_value = max_concurrent_requests
195+
self._concurrent_requests_semaphore.max_concurrency = max_concurrent_requests
196196

197197
if self.state.network_info.network_key.key == const.Z2M_NETWORK_KEY:
198198
LOGGER.warning(

0 commit comments

Comments
 (0)