浏览代码

Fix for "ValueError: non-hexadecimal number found in fromhex()" raised with some passwords (#65)

David K 2 年之前
父节点
当前提交
4b9a5b2999
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      switchbot/devices/device.py

+ 1 - 1
switchbot/devices/device.py

@@ -58,7 +58,7 @@ class SwitchbotDevice:
         if password is None or password == "":
             self._password_encoded = None
         else:
-            self._password_encoded = "%x" % (
+            self._password_encoded = "%08x" % (
                 binascii.crc32(password.encode("ascii")) & 0xFFFFFFFF
             )