Tinytuya

Latest version: v1.13.2

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

Scan your dependencies

Page 15 of 16

1.2.0

* PyPi Version 1.2.0
* Now decrypting all TuyaMessage responses (not just status)
* Fixed `set_colour(r, g, b)` to work with python2
* Fixed `set_debug()` to toggle on debug logging (with color)
* Added handler for `device22` to automatically detect and `set_dpsUsed()` with available DPS values.
* Added `set_socketTimeout(s)` for adjustable connection timeout setting (defaults to 5s)
* Added `set_sendWait(s)` for adjustable wait time after sending device commands
* Improved and added additional error handling and retry logic
* Instead of Exceptions, tinytuya responds with Error response codes (potential breaking change):

Example

python
import tinytuya

tinytuya.set_debug(toggle=False, color=True)

d = tinytuya.OutletDevice('<ID>','<IP>','<KEY>')
d.set_version(3.3)
d.status()


{u'Payload': None, u'Err': u'905', u'Error': u'Network Error: Device Unreachable'}

1.1.4

* PyPi Version 1.1.4
* Added `updatedps()` command 18 function to request device to update DPS values (Issue 8)
* Added `set_debug()` function to activate debug logging
python
import tinytuya
import time

tinytuya.set_debug(True)

d = tinytuya.OutletDevice('DEVICEID', 'IP', 'LOCALKEY')
d.set_version(3.3)

print(" > Fetch Status < ")
data = d.status()
time.sleep(5)

print(" > Request Update for DPS indexes 18, 19 and 20 < ")
result = d.updatedps([18, 19, 20])

print(" > Fetch Status Again < ")
data2 = d.status()

print("Before %r" % data)
print("After %r" % data2)

1.1.3

* PyPi Version 1.1.3
* Updated device read retry logic for minimum response payload (28 characters) (Issue 17)
* Feature added to do automatic IP address lookup via network scan if _None_ or '0.0.0.0' is specified. Example:
python
import tinytuya
ID = "01234567890123456789"
IP = None
KEY = "0123456789012345"
d = tinytuya.OutletDevice(ID,IP,KEY)
d.status()

1.1.2

* PyPi Version 1.1.2
* Bug Fix for 3.1 Devices using CONTROL command - updated to hexdigest[8:][:16]
* See Issue: 11

1.1.1

* PyPi Version 1.1.1
* Updated BulbDevice Class to support two types of bulbs with different DPS mappings and functions:
- Type A - Uses DPS index 1-5 and represents color with RGB+HSV
- Type B - Uses DPS index 20-27 (no index 1)
* Updated Colour Support - Index (DPS_INDEX_COLOUR) is assumed to be in the format:
- (Type A) Index: 5 in hex format: rrggbb0hhhssvv
- (Type B) Index: 24 in hex format: hhhhssssvvvv
* New Functions to help abstract Bulb Type:
- `set_white_percentage(brightness=100, colourtemp=0):`
- `set_brightness_percentage(brightness=100):`
- `set_colourtemp_percentage(colourtemp=100):`
- `set_mode(mode='white'):` white, colour, scene, music
* Example Script https://github.com/jasonacox/tinytuya/blob/master/examples/bulb.py

1.1.0

* PyPi Version 1.1.0
* Added TinyTuya Setup Wizard to help users grab device *LOCAL_KEY* from the Tuya Platform.
* Added formatted terminal color output (optionally disabled with `-nocolor`) for interactive **Wizard** and **Scan** functions.

python
python3 -m tinytuya wizard

s

Page 15 of 16

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.