From 9ea0e028fd76a61296373730649e3b86899c2908 Mon Sep 17 00:00:00 2001 From: Tim Lunn Date: Tue, 9 Jul 2024 20:31:31 +1000 Subject: [PATCH] Skip bootloader when the config is set to skip On SMLIGHT SLZB-06 devices in USB mode the skip bootloader sequence causes the esp32 in these devices to reset. While there is a config option to disable skip bootloader, it is not hooked up. Ensure that it is possible to disable skip bootloader. --- zigpy_znp/api.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/zigpy_znp/api.py b/zigpy_znp/api.py index 941314d..555c6b5 100644 --- a/zigpy_znp/api.py +++ b/zigpy_znp/api.py @@ -734,7 +734,12 @@ async def connect(self, *, test_port=True) -> None: # prevent any data from being sent if test_port: # The reset indication callback is sent when some sticks start up - self.capabilities = (await self._skip_bootloader()).Capabilities + if self._znp_config[conf.CONF_SKIP_BOOTLOADER]: + self.capabilities = (await self._skip_bootloader()).Capabilities + else: + self.capabilities = ( + await self.request(c.SYS.Ping.Req()) + ).Capabilities # We need to know how structs are packed to deserialize frames correctly await self.nvram.determine_alignment()