Tinytuya

Latest version: v1.16.1

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

Scan your dependencies

Page 18 of 22

1.3.3

1.3.2

1.3.1

* PyPi Version 1.3.1
* Added TuyaCloud token expiration detection and renewal logic (Issue 94)

1.3.0

* PyPi Version 1.3.0
* Code format cleanup and readability improvements (pull request 91)
* Upgrade - Add TuyaCloud API support and functions (87 95)

python
import tinytuya

c = tinytuya.Cloud(
apiRegion="us",
apiKey="xxxxxxxxxxxxxxxxxxxx",
apiSecret="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
apiDeviceID="xxxxxxxxxxxxxxxxxxID")

Display list of devices
devices = c.getdevices()
print("Device List: %r" % devices)

Select a Device ID to Test
id = "xxxxxxxxxxxxxxxxxxID"

Display DPS IDs of Device
result = c.getdps(id)
print("DPS IDs of device:\n", result)

Display Status of Device
result = c.getstatus(id)
print("Status of device:\n", result)

Send Command - This example assumes a basic switch
commands = {
'commands': [{
'code': 'switch_1',
'value': True
}, {
'code': 'countdown_1',
'value': 0
}]
}
print("Sending command...")
result = c.sendcommand(id,commands)
print("Results\n:", result)

1.2.11

[Loaded devices.json - 32 devices]

Scanning on UDP ports 6666 and 6667 for devices (47 retries)...

1.2.10

* PyPi Version 1.2.10
* Added ability to disable device auto-detect (default vs device22) via `d.disabledetect=True`.
* Wizard: Added new data center regions for Tuya Cloud: (Issues 66 75)

Code | Region | Endpoint
-- | -- | --
cn | China Data Center | https://openapi.tuyacn.com
us | Western America Data Center | https://openapi.tuyaus.com
us-e | Eastern America Data Center | https://openapi-ueaz.tuyaus.com
eu | Central Europe Data Center | https://openapi.tuyaeu.com
eu-w | Western Europe Data Center | https://openapi-weaz.tuyaeu.com
in | India Data Center | https://openapi.tuyain.com

Page 18 of 22

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.