Skip to content

Commit fd9f7eb

Browse files
authored
Remove 5s probe timeout (#262)
* Remove 5s probe timeout * Remove unnecessary unit test
1 parent 856f632 commit fd9f7eb

File tree

2 files changed

+0
-27
lines changed

2 files changed

+0
-27
lines changed

tests/application/test_connect.py

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -75,24 +75,6 @@ async def test_probe_unsuccessful_slow1(device, make_znp_server, mocker):
7575
assert not any([t._is_connected for t in znp_server._transports])
7676

7777

78-
@pytest.mark.parametrize("device", FORMED_DEVICES)
79-
async def test_probe_unsuccessful_slow2(device, make_znp_server, mocker):
80-
znp_server = make_znp_server(server_cls=device, shorten_delays=False)
81-
82-
# Don't respond to anything
83-
znp_server._listeners.clear()
84-
85-
mocker.patch("zigpy_znp.zigbee.application.PROBE_TIMEOUT", new=0.1)
86-
87-
assert not (
88-
await ControllerApplication.probe(
89-
conf.SCHEMA_DEVICE({conf.CONF_DEVICE_PATH: znp_server.serial_port})
90-
)
91-
)
92-
93-
assert not any([t._is_connected for t in znp_server._transports])
94-
95-
9678
@pytest.mark.parametrize("device", FORMED_DEVICES)
9779
async def test_probe_successful(device, make_znp_server):
9880
znp_server = make_znp_server(server_cls=device, shorten_delays=False)

zigpy_znp/zigbee/application.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@
3939
ZDO_PROFILE = 0x0000
4040

4141
# All of these are in seconds
42-
PROBE_TIMEOUT = 5
4342
STARTUP_TIMEOUT = 5
4443
DATA_CONFIRM_TIMEOUT = 8
4544
EXTENDED_DATA_CONFIRM_TIMEOUT = 30
@@ -67,14 +66,6 @@ def __init__(self, config: conf.ConfigType):
6766
# Implementation of the core zigpy ControllerApplication methods #
6867
##################################################################
6968

70-
@classmethod
71-
async def probe(cls, device_config):
72-
try:
73-
async with asyncio_timeout(PROBE_TIMEOUT):
74-
return await super().probe(device_config)
75-
except asyncio.TimeoutError:
76-
return False
77-
7869
async def connect(self):
7970
assert self._znp is None
8071

0 commit comments

Comments
 (0)