Python interface to Tuya WiFi smart devices.
Project description
TuyaFace
Tuya client that allows you to locally communicate with tuya devices without the tuya-cloud.
Installation
pip install tuyaface
or
pip install tuyaface==1.1.0
Public Interface
Request device status
status(device: dict)
Returns json string
Change device state
set_state(device: dict, value: bool, idx: int = 1)
Returns json string
Change device status
set_status(device: dict, dps: dict)
Returns json string
Device dict
device = {
'protocol': '3.3', # 3.1 | 3.3
'deviceid': '34280100600194d17c96',
'localkey': 'e7e9339aa82abe61',
'ip': '192.168.1.101',
}
DPS dict
dps = {
'1': 0,
'103' 255,
...etc...
}
Todo
- move constants to separate file
- _stitch_payload type casting
- _select_reply use filter
Changelog
v1.1.1
- better description pub interface
- replace pycrypto with pycryptodome
v1.1.0 Breaking
- function set_status was added
- functionname set_status was changed to set_state
v1.0.5
- setup fixed
- split _generate_payload function to a readable format
- add support for older devices back in (untested, please report back)
- solved recursion problem in send_request
- moved functions back to init
- removed TuyaConnection class, use send_request in try/except
- declassified aescipher
- moved to a more functional programming style
- yield and list comprehensions
- setup.py
- removed code for older devices < 3.3
Implementations
- https://github.com/TradeFace/tuyamqtt
- let me know, I'll add it here
Acknowledgements
- This module is a rewrite of https://github.com/clach04/python-tuya
- https://github.com/codetheweb/tuyapi as reference on commands
- https://github.com/SDNick484 for testing protocol 3.1 reimplementation
- https://github.com/jkerdreux-imt several improvements
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
tuyaface-1.1.1.tar.gz
(5.8 kB
view details)
Built Distributions
tuyaface-1.1.1-py3.6.egg
(12.1 kB
view details)
File details
Details for the file tuyaface-1.1.1.tar.gz
.
File metadata
- Download URL: tuyaface-1.1.1.tar.gz
- Upload date:
- Size: 5.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/46.1.3 requests-toolbelt/0.8.0 tqdm/4.45.0 CPython/3.6.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f1ee1f964f33dbde752b4330f0a1bbd39bbd53792f9f6af1dfffce80a99bef37 |
|
MD5 | f8275838b2fe2eb9b3fc3a04e5c82707 |
|
BLAKE2b-256 | 6033885d17ac48731b1cc9437a16654796c6f2d427e4425aef28b8a94d7a0602 |
File details
Details for the file tuyaface-1.1.1-py3.6.egg
.
File metadata
- Download URL: tuyaface-1.1.1-py3.6.egg
- Upload date:
- Size: 12.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/46.1.3 requests-toolbelt/0.8.0 tqdm/4.45.0 CPython/3.6.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0e7d7e155337863ff5823a71d6c8546d912e241e4f224a2a72a21ba683312d75 |
|
MD5 | 977021caa02e4895a6ef20581e89d037 |
|
BLAKE2b-256 | 50326577062aee34397b85fd7d4de5b6c1e47eb91db345057933cf247a88b7d8 |
File details
Details for the file tuyaface-1.1.1-py3-none-any.whl
.
File metadata
- Download URL: tuyaface-1.1.1-py3-none-any.whl
- Upload date:
- Size: 7.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/46.1.3 requests-toolbelt/0.8.0 tqdm/4.45.0 CPython/3.6.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c87a417d6984c5a215ec39c9153a71eb476fb80e902c1528cc334254ee2f52f7 |
|
MD5 | 474dc89307fb378134233fc15d61161a |
|
BLAKE2b-256 | ad69779f1d84502b4611e3d0e8669acc555b47cd2d6c1d14ea019345152ac0ed |