Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ jobs:
with:
CODE_FOLDER: zigpy_znp
CACHE_VERSION: 2
PRE_COMMIT_CACHE_PATH: ~/.cache/pre-commit
PYTHON_VERSION_DEFAULT: 3.9.15
MINIMUM_COVERAGE_PERCENTAGE: 95
secrets:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
2 changes: 1 addition & 1 deletion tests/application/test_requests.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ async def callback(req):
nonlocal in_flight_requests
nonlocal did_lock

if app._concurrent_requests_semaphore.locked():
if app._concurrent_requests_semaphore.locked(priority=0):
did_lock = True

in_flight_requests += 1
Expand Down
4 changes: 2 additions & 2 deletions tests/application/test_startup.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,12 +304,12 @@ async def test_reset_network_info(device, make_application):
"device, concurrency",
[
(FormedLaunchpadCC26X2R1, 16),
(FormedZStack1CC2531, 2),
(FormedZStack1CC2531, 4),
],
)
async def test_concurrency_auto_config(device, concurrency, make_application):
app, znp_server = make_application(server_cls=device)
await app.connect()
await app.start_network()

assert app._concurrent_requests_semaphore.max_value == concurrency
assert app._concurrent_requests_semaphore.max_concurrency == concurrency
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ def passthrough_serial_conn(loop, protocol_factory, url, *args, **kwargs):
return fut

mocker.patch(
"serial_asyncio.create_serial_connection", new=passthrough_serial_conn
"serial_asyncio_fast.create_serial_connection", new=passthrough_serial_conn
)

# So we don't have to import it every time
Expand Down
4 changes: 2 additions & 2 deletions tests/test_uart.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import asyncio

import pytest
from serial_asyncio import SerialTransport
from serial_asyncio_fast import SerialTransport

import zigpy_znp.types as t
import zigpy_znp.config as conf
Expand Down Expand Up @@ -47,7 +47,7 @@ def create_serial_conn(loop, protocol_factory, url, *args, **kwargs):

return fut

mocker.patch("serial_asyncio.create_serial_connection", new=create_serial_conn)
mocker.patch("serial_asyncio_fast.create_serial_connection", new=create_serial_conn)

return device, serial_interface

Expand Down
4 changes: 2 additions & 2 deletions zigpy_znp/zigbee/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,12 +187,12 @@ async def start_network(self, *, read_only=False):
None,
zigpy.config.defaults.CONF_MAX_CONCURRENT_REQUESTS_DEFAULT,
):
max_concurrent_requests = 16 if self._znp.nvram.align_structs else 2
max_concurrent_requests = 16 if self._znp.nvram.align_structs else 4
else:
max_concurrent_requests = self._config[conf.CONF_MAX_CONCURRENT_REQUESTS]

# Update the max value of the concurrent request semaphore at runtime
self._concurrent_requests_semaphore.max_value = max_concurrent_requests
self._concurrent_requests_semaphore.max_concurrency = max_concurrent_requests

if self.state.network_info.network_key.key == const.Z2M_NETWORK_KEY:
LOGGER.warning(
Expand Down
4 changes: 2 additions & 2 deletions zigpy_znp/znp/security.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ async def read_devices(

async for key in read_hashed_link_keys(znp, tclk_seed):
if key.partner_ieee not in devices:
LOGGER.warning(
LOGGER.debug(
"Skipping hashed link key %s (tx: %s, rx: %s) for unknown device %s",
":".join(f"{b:02x}" for b in key.key),
key.tx_counter,
Expand All @@ -309,7 +309,7 @@ async def read_devices(

async for key in read_unhashed_link_keys(znp, addr_mgr):
if key.partner_ieee not in devices:
LOGGER.warning(
LOGGER.debug(
"Skipping unhashed link key %s (tx: %s, rx: %s) for unknown device %s",
":".join(f"{b:02x}" for b in key.key),
key.tx_counter,
Expand Down
Loading