|
43 | 43 | # All of these are in seconds |
44 | 44 | STARTUP_TIMEOUT = 15 |
45 | 45 | AFTER_BOOTLOADER_SKIP_BYTE_DELAY = 2.5 |
46 | | -NETWORK_COMMISSIONING_TIMEOUT = 30 |
| 46 | +NETWORK_COMMISSIONING_TIMEOUT = 60 |
47 | 47 | BOOTLOADER_PIN_TOGGLE_DELAY = 0.15 |
48 | 48 | CONNECT_PING_TIMEOUT = 0.50 |
49 | 49 | CONNECT_PROBE_TIMEOUT = 10 |
@@ -935,7 +935,7 @@ def wait_for_response(self, response: t.CommandBase) -> asyncio.Future: |
935 | 935 | return self.wait_for_responses([response]) |
936 | 936 |
|
937 | 937 | async def request( |
938 | | - self, request: t.CommandBase, **response_params |
| 938 | + self, request: t.CommandBase, timeout: int | None = None, **response_params |
939 | 939 | ) -> t.CommandBase | None: |
940 | 940 | """ |
941 | 941 | Sends a SREQ/AREQ request and returns its SRSP (only for SREQ), failing if any |
@@ -991,7 +991,9 @@ async def request( |
991 | 991 | self._uart.send(frame) |
992 | 992 |
|
993 | 993 | # We should get a SRSP in a reasonable amount of time |
994 | | - async with async_timeout.timeout(self._znp_config[conf.CONF_SREQ_TIMEOUT]): |
| 994 | + async with async_timeout.timeout( |
| 995 | + timeout or self._znp_config[conf.CONF_SREQ_TIMEOUT] |
| 996 | + ): |
995 | 997 | # We lock until either a sync response is seen or an error occurs |
996 | 998 | response = await response_future |
997 | 999 |
|
@@ -1032,7 +1034,7 @@ async def request_callback_rsp( |
1032 | 1034 | if not background: |
1033 | 1035 | try: |
1034 | 1036 | async with async_timeout.timeout(timeout): |
1035 | | - await self.request(request, **response_params) |
| 1037 | + await self.request(request, timeout=timeout, **response_params) |
1036 | 1038 |
|
1037 | 1039 | return await callback_rsp |
1038 | 1040 | finally: |
|
0 commit comments