Closed achaiah closed 4 years ago
Huh.. so I commented out the assertion about key length but am now getting a different error:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 178, in _async_setup_platform
await asyncio.wait_for(asyncio.shield(task), SLOW_SETUP_MAX_WAIT)
File "/usr/local/lib/python3.7/asyncio/tasks.py", line 442, in wait_for
return fut.result()
File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/eufy_vacuum/vacuum.py", line 50, in setup_platform
add_entities([EufyVacuum(device_config)], True)
File "/config/custom_components/eufy_vacuum/vacuum.py", line 70, in __init__
device_config['local_key'])
File "/config/custom_components/eufy_vacuum/tuya.py", line 453, in __init__
self.cipher = TuyaCipher(local_key, self.version)
File "/config/custom_components/eufy_vacuum/tuya.py", line 166, in __init__
self.cipher = Cipher(algorithms.AES(key.encode('ascii')), modes.ECB(),
File "/usr/local/lib/python3.7/site-packages/cryptography/hazmat/primitives/ciphers/algorithms.py", line 35, in __init__
self.key = _verify_key_size(self, key)
File "/usr/local/lib/python3.7/site-packages/cryptography/hazmat/primitives/ciphers/algorithms.py", line 21, in _verify_key_size
len(key) * 8, algorithm.name
ValueError: Invalid key size (176) for AES.
Nevermind. Looks like the 30C vacuum is special. I had to look up the info per #1 with an old Android app and adb.
I have a 30C vacuum and am seeing this error when trying to set it up in home assistant:
My access_token is 22 characters long. I successfully used it on the command line to retrieve information from eufy but it doesn't seem to work with this project. Any pointers would be appreciated.
Thanks