diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3f9c584..015997f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 }} diff --git a/tests/application/test_requests.py b/tests/application/test_requests.py index 4c7e4dc..2c49361 100644 --- a/tests/application/test_requests.py +++ b/tests/application/test_requests.py @@ -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 diff --git a/tests/application/test_startup.py b/tests/application/test_startup.py index d3098ff..54b551b 100644 --- a/tests/application/test_startup.py +++ b/tests/application/test_startup.py @@ -304,7 +304,7 @@ 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): @@ -312,4 +312,4 @@ async def test_concurrency_auto_config(device, concurrency, make_application): await app.connect() await app.start_network() - assert app._concurrent_requests_semaphore.max_value == concurrency + assert app._concurrent_requests_semaphore.max_concurrency == concurrency diff --git a/tests/conftest.py b/tests/conftest.py index 059981b..0a15190 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -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 diff --git a/tests/test_uart.py b/tests/test_uart.py index 80efbb1..d16c5af 100644 --- a/tests/test_uart.py +++ b/tests/test_uart.py @@ -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 @@ -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 diff --git a/zigpy_znp/zigbee/application.py b/zigpy_znp/zigbee/application.py index 06984a3..a9e2ce1 100644 --- a/zigpy_znp/zigbee/application.py +++ b/zigpy_znp/zigbee/application.py @@ -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( diff --git a/zigpy_znp/znp/security.py b/zigpy_znp/znp/security.py index acc8ce5..fcbcf11 100644 --- a/zigpy_znp/znp/security.py +++ b/zigpy_znp/znp/security.py @@ -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, @@ -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,