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

'NoneType' object is not iterable when running "print-local-keys.py" #10

Closed larsf96 closed 1 year ago

larsf96 commented 1 year ago

Hi, I'm seeing the following error when running the print-local-keys script:

Traceback (most recent call last):
  File "/Users/lars/dev/private/ha-ledvance-tuya-resync-localkey/print-local-keys.py", line 49, in <module>
    main()
  File "/Users/lars/dev/private/ha-ledvance-tuya-resync-localkey/print-local-keys.py", line 40, in main
    for group in api.groups():
TypeError: 'NoneType' object is not iterable

The login seems to be working as I get a notification in the App, that someone recently logged in. I'm not sure if it's related to my account region which is set to "United States / Canada" even if I'm in Germany. I've created a group in the Ledvance app, but this does not seem to help. Is this behavior known?

larsf96 commented 1 year ago

Okay, I figured it out by myself. Changing the Tuya Endpoint to "https://a1.tuyaus.com/api.json" did the trick