Tinytuya

Latest version: v1.16.1

Safety actively analyzes 710644 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 19 of 22

1.2.9

* PyPi Version 1.2.9
* Added Error Handling in class Device(XenonDevice) for conditions where response is None (Issue 68)
* Added edge-case handler in `_decode_payload()` to decode non-string type decrypted payload (Issue 67)

1.2.8

* PyPi Version 1.2.8
* Added additional error checking for BulbDevice type selection
* Added TinyTuya version logging for debug mode
* Fix bug in scan when color=False (Issue 63)

1.2.7

* PyPi Version 1.2.7
* Updated setup `wizard` to support new Tuya Cloud signing method (Issue 57)
* Added Bulb type C and manual setting function `set_bulb_type(type)` (PR 54)
* Wizard creates `tuya-raw.json` to record raw response from Tuya IoT Platform
* Fixed device22 bug on retry - Now returns ERR_DEVTYPE error, status() includes auto-retry (56)

1.2.6

* PyPi Version 1.2.6
* Added `wizard` handling to capture and display Tuya API server error responses (PR 45)
* Added better error handling for BulbDevice `state()` function to not crash when dps values are missing in response (PR 46)
* Added async examples using `send()` and `receive()`
* Updated scan output to include device Local Key if known (PR 49 50)
* Fixed print typo in examples/devices.py (PR 51)

1.2.5

* PyPi Version 1.2.5
* Added raw mode `send()` and `receive()` function to allow direct control of payload transfers. Useful to monitor constant state changes via threads or continuous loops. This example opens a Tuya device and watches for state changes (e.g. switch going on and off):

python
import tinytuya

d = tinytuya.OutletDevice('DEVICEID', 'DEVICEIP', 'DEVICEKEY')
d.set_version(3.3)
d.set_socketPersistent(True)

print(" > Send Initial Query for Status < ")
payload = d.generate_payload(tinytuya.DP_QUERY)
d.send(payload)

while(True):
See if any data is available
data = d.receive()
print('Received Payload: %r' % data)

Send a keyalive heartbeat ping
print(" > Send Heartbeat Ping < ")
payload = d.generate_payload(tinytuya.HEART_BEAT)
d.send(payload)

1.2.4

* PyPi Version 1.2.4
* Added detect_available_dps() function
* Fixed bug in json_error() function
* Updated instruction for using Tuya iot.tuya.com to run Wizard
* Added option to disable deviceScan() automatic device polling
* Added better error handling processing Tuya messages (responses) Issue 39
* Fixed display bug in Wizard device polling to show correct On/Off state

Page 19 of 22

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.