Skip to content

Commit 4b9a5b2

Browse files
authored
Fix for "ValueError: non-hexadecimal number found in fromhex()" raised with some passwords (#65)
1 parent a05726c commit 4b9a5b2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

switchbot/devices/device.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def __init__(
5858
if password is None or password == "":
5959
self._password_encoded = None
6060
else:
61-
self._password_encoded = "%x" % (
61+
self._password_encoded = "%08x" % (
6262
binascii.crc32(password.encode("ascii")) & 0xFFFFFFFF
6363
)
6464

0 commit comments

Comments
 (0)