Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions zigpy_zigate/zigbee/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,16 @@

async def connect(self):
api = await ZiGate.new(self._config[zigpy.config.CONF_DEVICE], self)
await api.set_raw_mode()
await api.set_time()

(_, version), lqi = await api.version()
try:
await api.set_raw_mode()
await api.set_time()

(_, version), lqi = await api.version()
except Exception:
await api.disconnect()
raise

Check warning on line 52 in zigpy_zigate/zigbee/application.py

View check run for this annotation

Codecov / codecov/patch

zigpy_zigate/zigbee/application.py#L50-L52

Added lines #L50 - L52 were not covered by tests

major, minor = version.to_bytes(2, "big")
self.version = f"{major:x}.{minor:x}"

Expand Down