Releases: jasonacox/tinytuya
Releases · jasonacox/tinytuya
v1.6.5 - Updated Payload Dictionary and Command List
What's Changed
- PyPI 1.6.5
- Reworked payload_dict and realigned the command list to match Tuya's API by @uzlonewolf in #166
- Changed socket.send() to socket.sendall() in _send_receive() by @uzlonewolf in #166
- Created TuyaSmartPlug-example.py by @fajarmnrozaki in #163 and #165
New Contributors
- @fajarmnrozaki made their first contribution in #163
Full Changelog: v1.6.4...v1.6.5
v1.6.4 - IRRemoteControlDevice and Read Improvements
What's Changed
- PyPI 1.6.4
- Separates read retries from send retries by @uzlonewolf #158
- IRRemoteControlDevice - New community contributed device module for IR Remote Control devices by @ClusterM in #160 - See example: examples/IRRemoteControlDevice-example.py
# Example usage of community contributed device modules
from tinytuya import Contrib
ir = Contrib.IRRemoteControlDevice( 'abcdefghijklmnop123456', '172.28.321.475', '1234567890123abc' )
New Contributors
Full Changelog: v1.6.2...v1.6.4
v1.6.2 - Cloud, TuyaMessage & ThermostatDevice Improvements
What's Changed
- PyPI 1.6.2
- Add getconnectstatus() function to Cloud class by @Paxy in #151
- Improve TuyaMessage Header processing for mulit-payload messages by @uzlonewolf in #153
- More verbose debug logging on decode error by @uzlonewolf in #155
- Add schedule editing to Contrib/ThermostatDevice and various fixes by @uzlonewolf in #157
New Contributors
Full Changelog: v1.6.1...v1.6.2
v1.6.1 - ThermostatDevice - User Contributed Device Module
What's Changed
- PyPI 1.6.1
- Cloud - Fix bug in
getdevices()
to import device mac addresses (same as wizard). - Break the Outlet/Cover/Bulb/Cloud modules out into separate files by @uzlonewolf in #142
- Fix logging calls in XenonDevice.detect_available_dps by @pkasprzyk in #144
- TinyTuya API Server - Add Cloud API syncing with auto-retry by @uzlonewolf in #147
- TinyTuya API Server - List registered but offline devices via
/offline
and web UI. - ThermostatDevice - First community contributed device module ThermostatDevice by @uzlonewolf in #146 - See example: examples/ThermostatDevice-example.py
# Example usage of community contributed device modules
from tinytuya import Contrib
thermo = Contrib.ThermostatDevice( 'abcdefghijklmnop123456', '172.28.321.475', '1234567890123abc' )
New Contributors
- @pkasprzyk made their first contribution in #144
Full Changelog: v1.6.0...v1.6.1
v1.6.0 - Colorama for Terminal Color
What's Changed
- PyPI 1.6.0
- Add colorama terminal color capability for all platforms including MS Windows and stdout redirects
- Fix to allow setting socket options to existing open sockets by @uzlonewolf in #140
- Add DPS table to README for a 24v Thermostat by @uzlonewolf in #141
- BETA: Started standalone TinyTuya API Server (see here). No change to core library.
New Contributors
- @uzlonewolf made their first contribution in #140
Full Changelog: v1.5.0...v1.6.0
v1.5.0 - Add "nowait" Option to Commands
What's Changed
- PyPI 1.5.0
- Added an optional 'nowait' boolean setting (True/False) to functions to allow sending commands without waiting for a device response. (Issue #74)
- Support optional version parameter by @dominikkarall in #127
- Update README.md to reflect new DPs for v3.3 Plug by @manj9501 in #133
- Some cleanup from pylint by @mafrosis in #135
- Add Universal IR Controller DP instructions by @mont5piques in #137
- Added robot mower data by @Whytey in #138
New Contributors
- @dominikkarall made their first contribution in #127
- @manj9501 made their first contribution in #133
- @mafrosis made their first contribution in #135
- @mont5piques made their first contribution in #137
- @Whytey made their first contribution in #138
# Example use of nowait option
d.turn_on(nowait=True)
d.set_colour(r, g, b, nowait=True)
d.set_value(201, '9AEmAvQBJgL0ASYCQAYmAkAGJgJABiY', nowait=True) # send IR command
d.set_value(25, '010e0d0000000000000003e803e8', nowait=True) # set scene
Full Changelog: v1.4.0...v1.5.0
v1.4.0 - Updated Scanner Functions
What's Changed
- PyPI 1.4.0 - Minor Update to APIs (additional arguments and elements)
- Debug - Updated debug output for payloads to formatted hexadecimal (pull request #98)
- Scan - Terminal color fix for 3.1 devices.
- Error Handling added for
set_timer()
function (Issue #87) - Add galaxy lamp example by @knrdl in #115
- Add wizard capability to pull mac addresses from TuyaPlatform in devices.json (Issue #117)
- Add wizard
-force
option to perform network scan for device IP addresses (Issue #117) - Added support to get the MAC address and local IP address in the Wizard by @frodeheg in #120
- Separated scan functions into
scanner.py
file. - NEW: Added command line functions for scanning:
devices
- Display and poll all registered devices for status (using devices.json). This will force a network scan for IP address changes and will create snapshot.json.snapshot
- Display and poll all devices as listed snapshot.json. This assume IP address are the same as the last snapshot.json
- Same as snapshot but respond with a JSON payload.
# Run wizard using brute force scan for IP addresses
python -m tinytuya wizard -force
# New Interactive Command Line Options
python -m tinytuya devices
python -m tinytuya snapshot
# Non-Interactive poll with JSON response
python -m tinytuya json
New Contributors
Full Changelog: v1.3.1...v1.4.0
v1.3.1 - TuyaCloud API Support
v1.3.0 - TuyaCloud API Support
- Code format cleanup and readability improvements (pull request #91)
- Upgrade - Add TuyaCloud API support and functions (#87 #95)
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)
v1.2.11 - Updated Scan and Wizard Retry Logic
- Added retries logic to
wizard
andscan
to honor value set by command line or default to a value based on the number of devices (if known):
# Explicit value set via command line
python3 -m tinytuya wizard 50 # Set retry to 50
python3 -m tinytuya scan 50
# Use automatic computed value
python3 -m tinytuya wizard # Compute a default
python3 -m tinytuya scan
# Example output
TinyTuya (Tuya device scanner) [1.2.11]
[Loaded devices.json - 32 devices]
Scanning on UDP ports 6666 and 6667 for devices (47 retries)...