diff --git a/miio/extract_tokens.py b/miio/extract_tokens.py index 521c21ebe..aecd97e20 100644 --- a/miio/extract_tokens.py +++ b/miio/extract_tokens.py @@ -82,8 +82,8 @@ def decrypt_ztoken(ztoken): key = bytes.fromhex(keystring) cipher = Cipher( algorithms.AES(key), - modes.ECB(), - backend=default_backend(), # nosec + modes.ECB(), # nosec + backend=default_backend(), ) decryptor = cipher.decryptor() token = decryptor.update(bytes.fromhex(ztoken[:64])) + decryptor.finalize()