-
-
Notifications
You must be signed in to change notification settings - Fork 567
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Construct related, support upto 2.9.31 #226
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ | |
import socket | ||
import logging | ||
import construct | ||
import binascii | ||
from typing import Any, List, Optional # noqa: F401 | ||
|
||
from .protocol import Message | ||
|
@@ -133,7 +134,7 @@ def do_discover(self) -> Message: | |
:raises DeviceException: if the device could not be discovered.""" | ||
m = Device.discover(self.ip) | ||
if m is not None: | ||
self._device_id = m.header.value.device_id | ||
self._device_id = binascii.hexlify(m.header.value.device_id) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. undefined name 'binascii' |
||
self._device_ts = m.header.value.ts | ||
self._discovered = True | ||
if self.debug > 1: | ||
|
@@ -184,7 +185,7 @@ def discover(addr: str=None) -> Any: | |
if addr[0] not in seen_addrs: | ||
_LOGGER.info(" IP %s (ID: %s) - token: %s", | ||
addr[0], | ||
m.header.value.device_id.decode(), | ||
binascii.hexlify(m.header.value.device_id).decode(), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. undefined name 'binascii' There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. undefined name 'binascii' |
||
codecs.encode(m.checksum, 'hex')) | ||
seen_addrs.append(addr[0]) | ||
except socket.timeout: | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
undefined name 'binascii'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be left as it is, considering that it gets passed back to the device at later point, or will it be handled automatically by the
build()
. If that's fine, I think we can merge this and prepare a new release.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It recreates behevior from before recent Hex update, just that.