Skip to content

Commit

Permalink
Moved access to message attribute inside if message is not Not statement
Browse files Browse the repository at this point in the history
  • Loading branch information
jthure committed Jun 16, 2020
1 parent 8a88057 commit 7ab535d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion miio/miioprotocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ def send_handshake(self) -> Message:
:raises DeviceException: if the device could not be discovered."""
m = MiIOProtocol.discover(self.ip)
header = m.header.value
if m is not None:
header = m.header.value
self._device_id = header.device_id
self._device_ts = header.ts
self._discovered = True
Expand Down

0 comments on commit 7ab535d

Please sign in to comment.