We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent eb4d141 commit 521e425Copy full SHA for 521e425
zigpy_zigate/zigbee/application.py
@@ -41,10 +41,16 @@ async def _watchdog_feed(self):
41
42
async def connect(self):
43
api = await ZiGate.new(self._config[zigpy.config.CONF_DEVICE], self)
44
- await api.set_raw_mode()
45
- await api.set_time()
46
47
- (_, version), lqi = await api.version()
+ try:
+ await api.set_raw_mode()
+ await api.set_time()
48
+
49
+ (_, version), lqi = await api.version()
50
+ except Exception:
51
+ await api.disconnect()
52
+ raise
53
54
major, minor = version.to_bytes(2, "big")
55
self.version = f"{major:x}.{minor:x}"
56
0 commit comments