From e50f0486dde37979788904f39ae79781a8e001fe Mon Sep 17 00:00:00 2001 From: puddly <32534428+puddly@users.noreply.github.com> Date: Wed, 11 Jun 2025 12:07:17 -0400 Subject: [PATCH 1/2] Remove 5s probe timeout --- zigpy_znp/zigbee/application.py | 9 --------- 1 file changed, 9 deletions(-) diff --git a/zigpy_znp/zigbee/application.py b/zigpy_znp/zigbee/application.py index 21dee94..06984a3 100644 --- a/zigpy_znp/zigbee/application.py +++ b/zigpy_znp/zigbee/application.py @@ -39,7 +39,6 @@ ZDO_PROFILE = 0x0000 # All of these are in seconds -PROBE_TIMEOUT = 5 STARTUP_TIMEOUT = 5 DATA_CONFIRM_TIMEOUT = 8 EXTENDED_DATA_CONFIRM_TIMEOUT = 30 @@ -67,14 +66,6 @@ def __init__(self, config: conf.ConfigType): # Implementation of the core zigpy ControllerApplication methods # ################################################################## - @classmethod - async def probe(cls, device_config): - try: - async with asyncio_timeout(PROBE_TIMEOUT): - return await super().probe(device_config) - except asyncio.TimeoutError: - return False - async def connect(self): assert self._znp is None From b01f643170bd7a81c6c544d7608fab9942ed0c07 Mon Sep 17 00:00:00 2001 From: puddly <32534428+puddly@users.noreply.github.com> Date: Wed, 11 Jun 2025 12:11:11 -0400 Subject: [PATCH 2/2] Remove unnecessary unit test --- tests/application/test_connect.py | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/tests/application/test_connect.py b/tests/application/test_connect.py index 5c6aa54..c6c396c 100644 --- a/tests/application/test_connect.py +++ b/tests/application/test_connect.py @@ -75,24 +75,6 @@ async def test_probe_unsuccessful_slow1(device, make_znp_server, mocker): assert not any([t._is_connected for t in znp_server._transports]) -@pytest.mark.parametrize("device", FORMED_DEVICES) -async def test_probe_unsuccessful_slow2(device, make_znp_server, mocker): - znp_server = make_znp_server(server_cls=device, shorten_delays=False) - - # Don't respond to anything - znp_server._listeners.clear() - - mocker.patch("zigpy_znp.zigbee.application.PROBE_TIMEOUT", new=0.1) - - assert not ( - await ControllerApplication.probe( - conf.SCHEMA_DEVICE({conf.CONF_DEVICE_PATH: znp_server.serial_port}) - ) - ) - - assert not any([t._is_connected for t in znp_server._transports]) - - @pytest.mark.parametrize("device", FORMED_DEVICES) async def test_probe_successful(device, make_znp_server): znp_server = make_znp_server(server_cls=device, shorten_delays=False)