dnandha / miauth

Authenticate and interact with Xiaomi devices over BLE
GNU Affero General Public License v3.0
28 stars 10 forks source link

m365 ch_key not being set #8

Closed nouun closed 2 years ago

nouun commented 2 years ago

self.ch_key is not set and therefore errors when trying to read the m365 key.

Namespace(mac='F1:90:85:05:D0:B8', m365=True, nb=False, command=None, serial=True, version=True, debug=True, register=False, token_file='./mi_token')
Connecting
enabling notifications for: 6e400003-b5a3-f393-e0a9-e50e24dcca9e
found old 55ab encryption -> recovering key
Traceback (most recent call last):
  File "/home/nouun/miauth/lib/python/miauth/cli.py", line 158, in <module>
    main()
  File "/home/nouun/miauth/lib/python/miauth/cli.py", line 151, in main
    m365_main(ble)
  File "/home/nouun/miauth/lib/python/miauth/cli.py", line 79, in m365_main
    mc.recover_key()
  File "/usr/local/lib/python3.10/site-packages/miauth-0.9.6-py3.10.egg/miauth/mi/m365client.py", line 73, in recover_key
TypeError: 'NoneType' object is not subscriptable
dnandha commented 2 years ago

@nouun Thanks for opening the issue, that was some remainder code that I overlooked when refactoring the ble/channel logic.

Please test if the latest commit 3aadfb4bd290bf37d14a9f1c198d56d9dcce4e87 fixes the issue for you.

nouun commented 2 years ago

Everything is working properly now, thanks.