|
16 | 16 |
|
17 | 17 | CHANGE_NETWORK_WAIT = 1 |
18 | 18 | SEND_CONFIRM_TIMEOUT = 30 |
| 19 | +TIMEOUT_REPLY_ROUTER = 6 |
| 20 | +TIMEOUT_REPLY_ENDDEV = 29 |
19 | 21 |
|
20 | 22 |
|
21 | 23 | class ControllerApplication(zigpy.application.ControllerApplication): |
@@ -82,7 +84,8 @@ async def form_network(self, channel=15, pan_id=None, extended_pan_id=None): |
82 | 84 | raise Exception("Could not form network.") |
83 | 85 |
|
84 | 86 | @zigpy.util.retryable_request |
85 | | - async def request(self, nwk, profile, cluster, src_ep, dst_ep, sequence, data, expect_reply=True, timeout=10): |
| 87 | + async def request(self, nwk, profile, cluster, src_ep, dst_ep, sequence, data, expect_reply=True, |
| 88 | + timeout=TIMEOUT_REPLY_ROUTER): |
86 | 89 | LOGGER.debug("Zigbee request with id %s, data: %s", sequence, binascii.hexlify(data)) |
87 | 90 | assert sequence not in self._pending |
88 | 91 | dst_addr_ep = t.DeconzAddressEndpoint() |
@@ -111,6 +114,10 @@ async def request(self, nwk, profile, cluster, src_ep, dst_ep, sequence, data, e |
111 | 114 | if not expect_reply: |
112 | 115 | return |
113 | 116 |
|
| 117 | + dev = self.get_device(nwk=nwk) |
| 118 | + if dev.node_desc.is_end_device in (True, None): |
| 119 | + LOGGER.debug("Extending timeout for %s/0x%04x", dev.ieee, nwk) |
| 120 | + timeout = TIMEOUT_REPLY_ENDDEV |
114 | 121 | return await asyncio.wait_for(req.reply, timeout) |
115 | 122 |
|
116 | 123 | async def broadcast(self, profile, cluster, src_ep, dst_ep, grpid, radius, |
|
0 commit comments