Browse Source

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

David K 1 week ago
parent
commit
4b9a5b2999
1 changed files with 1 additions and 1 deletions
  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
             )