-
Notifications
You must be signed in to change notification settings - Fork 55
AttributeError: 'str' object has no attribute 'decode' #21
Comments
Have you tried removing the .decode() method from that line? Not totally sure how that code path works with the encryption but if result is a string already you do not need the decode method. |
This has been working for a while now with no issues:
|
@theit8514 what are you using for crypto? I'm trying to work out which code path you are dropping through. I'm going to guess PyCrypto (or PyCryptodome) based on a quick code inspection (AESCipher wrapper class will return a string). |
These are the crypto modules installed (from the $ pip list | grep crypto -i |
Thanks for confirming. So this is one of those cases where we are missing a test for this code path. It would be much better if we have the correct code than a protective check/cast. If anyone has time to work on a unittest that would be awesome. |
I guess you (or the author of the home-assistant plugin) fixed the |
Using pytuya with tuya-homeassistant (python 3.6.4) and I get this error when toggling on/off the switch:
The text was updated successfully, but these errors were encountered: