Closed shenxn closed 3 years ago
@lolongan This problem need further investigation. Maybe I will write a script for you to run and give me more info.
@lolongan This problem need further investigation. Maybe I will write a script for you to run and give me more info.
With pleasure, when you wish.
@lolongan I've made a new branch https://github.com/shenxn/libdyson/tree/debug that prints raw data from HTTP request. Download or clone the branch, run python3 get_devices.py
. You may need to install dependencies by running pip3 install -r requirements.txt
. Then you should see several message starting with Device raw info:
. Paste those lines here. Feel free to change LocalCredentials
value for privacy.
@lolongan I've made a new branch https://github.com/shenxn/libdyson/tree/debug that prints raw data from HTTP request. Download or clone the branch, run
python3 get_devices.py
. You may need to install dependencies by runningpip3 install -r requirements.txt
. Then you should see several message starting withDevice raw info:
. Paste those lines here. Feel free to changeLocalCredentials
value for privacy.
@shenxn Here you are. Note that Device #1 is a Pure Cool + Hot and Device #2 is a Lightcycle Lamp. I suspect that this is this device which creates the issue because it has no 'LocalCredentials'.
Device raw info: {'Serial': 'A1B-EU-NJA2043A', 'Name': 'Salon', 'Version': 'ECG2PF.30.06.003.0002', 'LocalCredentials': 'XXXX----XXXX', 'AutoUpdate': True, 'NewVersionAvailable': True, 'ProductType': '527', 'ConnectionType': 'wss'}
Device raw info: {'Serial': 'YS4-EU-MCA0660A', 'Name': 'Bureau', 'Version': '0552PF.00.05.017.0002', 'LocalCredentials': None, 'AutoUpdate': True, 'NewVersionAvailable': False, 'ProductType': '552', 'ConnectionType': 'wss'}
Traceback (most recent call last):
File "/Users/comedie/Downloads/libdyson-debug/get_devices.py", line 30, in <module>
devices = account.devices()
File "/Users/comedie/Downloads/libdyson-debug/libdyson/cloud/account.py", line 174, in devices
devices.append(DysonDeviceInfo.from_raw(raw))
File "/Users/comedie/Downloads/libdyson-debug/libdyson/cloud/device_info.py", line 31, in from_raw
decrypt_password(raw["LocalCredentials"]),
File "/Users/comedie/Downloads/libdyson-debug/libdyson/cloud/utils.py", line 29, in decrypt_password
encrypted = base64.b64decode(encrypted_password)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/base64.py", line 80, in b64decode
s = _bytes_from_decode_data(s)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/base64.py", line 45, in _bytes_from_decode_data
raise TypeError("argument should be a bytes-like object or ASCII "
TypeError: argument should be a bytes-like object or ASCII string, not 'NoneType'
Yes. I'll fix that soon. Thanks a lot.
Fixed and released in version 0.7.0 of libdyson. Will be included in ha-dyson-cloud in the next major release.
This is originally reported in https://github.com/shenxn/ha-dyson/issues/1#issuecomment-792259004 by @lolongan.
Here is the log