FlagX / ha-ledvance-tuya-resync-localkey

pyscript for homeassistant to resync local keys from private tuya api
MIT License
108 stars 17 forks source link

new device -> print-local-keys.py #2

Closed Milo-PRT closed 1 year ago

Milo-PRT commented 1 year ago

I think this is more of a question than an issue.

when i query the local keys, i get the following message:

_➜ python3 print-local-keys.py Traceback (most recent call last): File "/config/print-local-keys.py", line 1, in from pyscript_modules.tuya.api import TuyaAPI File "/config/pyscript_modules/tuya/init.py", line 2, in from .api import TuyaAPI File "/config/pyscript_modules/tuya/api.py", line 6, in from Crypto.Util.number import bytes_to_long, long_tobytes ModuleNotFoundError: No module named 'Crypto'

My goal is to be able to read out the devID and the local key of a newly connected plug in the Ledvance app so that these can be entered in LocalTuya.

Am I doing something wrong here?

FlagX commented 1 year ago

You need to install pycryptodome

pip install pycryptodome

I will add this to the readme.

Milo-PRT commented 1 year ago

perfect! After a "python print-local-keys.py" all devices with their corresponding keys and IDs are now visible. Many thanks for the great work - TOP!