Comments (6)
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.
from python-tuya.
This has been working for a while now with no issues:
log.debug('decrypted result=%r', result)
if not isinstance(result, str):
result = result.decode()
result = json.loads(result)
from python-tuya.
@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).
from python-tuya.
These are the crypto modules installed (from the homeassistant/home-assistant
docker container):
$ pip list | grep crypto -i
asn1crypto (0.24.0)
cryptography (2.1.1)
pycryptodome (3.4.11)
pycryptodomex (3.5.1)
python-jose-cryptodome (1.3.2)
from python-tuya.
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.
from python-tuya.
I guess you (or the author of the home-assistant plugin) fixed the pytuya
version to 6.0.0 in the script. Change it to 7.0.2 would solve this problem.
from python-tuya.
Related Issues (20)
- Logo Design Offer as Open Source Contribution HOT 1
- Logging is blocked when pytuya is imported HOT 1
- Web version
- BHT-6000 Thermostat (Decrypt) HOT 3
- dps status
- Vaccum Cleaner HOT 1
- ImportError: No module named 'pytuya' HOT 4
- Tuya 3.3 version support HOT 9
- Cannot use module, OutletDevice method does not exist HOT 2
- Support for curtain switch HOT 2
- Smart Life / Jinvoo request latest release installed HOT 1
- Error when changing color on the light
- Tuya App 2.8 No Longer Valid
- 7.0.4 release on PyPI HOT 2
- new switches different port HOT 3
- PIR & Door/Window Sensor Support? HOT 4
- d.status timeout with a just bought device HOT 8
- Get Device Local Key HOT 1
- 7.0.6 release HOT 2
- socket.timeout: timed out
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from python-tuya.