Skip to content

Releases: jasonacox/tinytuya

v1.17.2 - BulbDevice

05 Jun 03:44
Compare
Choose a tag to compare

What's Changed

  • Add Singapore datacenter, update BulbDevice for non-bulb devices again by @uzlonewolf in #625

Full Changelog: v1.17.1...v1.17.2

v1.17.1 - Fix BulbDevice

31 May 18:07
Compare
Choose a tag to compare

What's Changed

  • Fix BulbDevice for non-bulb devices. This will allow BulbDevice to be used even for non-bulb devices, e.g. turn_on() & turn_off(), by @uzlonewolf in #620.

Full Changelog: v1.17.0...v1.17.1

v1.17.0 - BulbDevice Rewrite

26 May 00:09
01095a1
Compare
Choose a tag to compare

What's Changed

  • Tool updates: pcap parse fix, new broadcast relay by @uzlonewolf in #612
  • Fix initialization bug with python2 (embedded devices) by @Ircama in #615
  • Rewrite BulbDevice and rework set_multiple_values(), again by @uzlonewolf in #617

BulbDevice Example Usage

import time
import random
import tinytuya

d = tinytuya.BulbDevice(DEVICEID, address=DEVICEIP, local_key=DEVICEKEY, version=DEVICEVERS, persist=True)

# BASIC FUNCTIONS
print('Basic Tests')
d.set_colour(255,127,63)           # Set to orange
d.set_white_percentage(100.0, 0.0) # 100% brightness, 0% colour temperature
d.set_brightness_percentage(100)   # 100% brightness

# MUSIC MODE
print("Music Mode")
d.set_mode('music')
d.set_socketPersistent( True )
# Devices respond with a command ACK, but do not send DP updates.
# Setting the 2 options below causes it to wait for a response but
#   return immediately after an ACK.
d.set_sendWait( None )
d.set_retry( False )
for x in range(100):
    red = random.randint(0,255)
    green = random.randint(0,255)
    blue = random.randint(0,255)
    if (x % 6 == 0):
        # extend every 6 beat
        d.set_music_colour( d.MUSIC_TRANSITION_FADE, red, green, blue )
        time.sleep(2)
    else:
        # Jump!
        d.set_music_colour( d.MUSIC_TRANSITION_JUMP, red, green, blue )
        time.sleep(0.1) # the bulbs seem to get upset if updates are faster than 0.1s (100ms)

# SCENE MODE
if d.bulb_has_capability(d.BULB_FEATURE_SCENE_DATA):
    d.set_mode('scene')
    print('String based scenes compatible smartbulb detected.')
    # Example: Color rotation 
    print('Switch to Scene 7 - Color Rotation')
    d.set_scene( 7, '464602000003e803e800000000464602007803e803e80000000046460200f003e803e800000000464602003d03e803e80000000046460200ae03e803e800000000464602011303e803e800000000')

New Contributors

Full Changelog: v1.16.3...v1.17.0

v1.16.3 - Devices.json Error Handling

27 Apr 04:15
3fa3870
Compare
Choose a tag to compare

What's Changed

  • Add error handling in Cloud getdevices() function for edge case where old devices.json has corrupt or malformed device entries. by @jasonacox in #609
  • Server p14 update: Add main loop logic to try to recover when exception occurs.

Full Changelog: v1.16.2...v1.16.3

v1.16.2 - Invalid JSON Handling

27 Apr 02:35
1130950
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v1.16.1...v1.16.2

v1.16.1 - Scanner Error Handling

26 Jan 04:31
443e9c8
Compare
Choose a tag to compare

What's Changed

  • Adds error handling for cases when the scanner broadcasts fails by @x011 in #585 and @uzlonewolf in #587
  • Fix WinError 10022: Handle invalid socket arguments in send_discovery_request by @x011 in #585
  • Add better error message when sending scanner broadcasts fails by @uzlonewolf in #587

New Contributors

  • @x011 made their first contribution in #585

Full Changelog: v1.16.0...v1.16.1

v1.16.0 - Code Refactoring

06 Jan 06:37
Compare
Choose a tag to compare

What's Changed

  • This update refactors core.py by splitting it up into smaller, more logical files. It puts it in a core directory, so existing code that imports from tinytuya.core should be unaffected.
  • Add Contrib support for Electric Blankets such as Goldair GPFAEB-Q by @leodenham in #528
  • Add IoT core service renewal info to the setup wizard in the README by @lorumic in #558
  • Contributing with a new device ColorfulX7Device by @CheAhMeD in #568
  • Add WiFi Dual Meter device by @ggardet in #569
  • Refactoring: split up core.py by @tringenbach in #575
  • fix: update tests.py to pass, add to github workflow by @tringenbach in #576

New Contributors

Full Changelog: v1.15.1...v1.16.0

v1.15.1 - Scanner Fixes

20 Jul 04:00
0cae224
Compare
Choose a tag to compare

What's Changed

  • Fix scanner broadcast attempting to bind to the wrong IP address, introduced in v1.15.0, by @uzlonewolf in #519
  • Make netifaces optional.

Full Changelog: v1.15.0...v1.15.1

v1.15.0 - Scanner Fixes

08 Jul 07:43
2b84315
Compare
Choose a tag to compare

What's Changed

  • Fix force-scanning bug in scanner introduced in last release and add broadcast request feature to help discover Tuya version 3.5 devices by @uzlonewolf in #511.
  • Add netifaces as an install requirement by @jasonacox in #517
  • Server p12 updates:
    • Added "Force Scan" button to cause server to run a network scan for devices not broadcasting.
    • Minor updates to UI for a cleaner title and footer to accommodate button.
    • Added logic to allow settings via environmental variables.
    • Add broadcast request to local network for version 3.5 devices.
    • Fix bug with cloud sync refresh that was losing device mappings.
    • Added "Cloud Sync" button to poll cloud for updated device data.
    • Add network configuration for force scan by @jasonacox in #518

Example CLI

# Standard Scan with broadcast requests for version 3.5 devices
python3 -m tinytuya scan

# Forced network scan
python3 -m tinytuya scan -f

Example Docker Run for Server Test (http://localhost:8888)

docker run \
    -d \
    -p 8888:8888 \
    -p 6666:6666/udp \
    -p 6667:6667/udp \
    -p 7000:7000/udp \
    --network host \
    -e DEBUGMODE='no' \
    -e HOST='192.168.0.100' \
    -v $PWD/devices.json:/app/devices.json \
    -v $PWD/tinytuya.json:/app/tinytuya.json \
    --name tinytuya \
    --restart unless-stopped \
    jasonacox/tinytuya

Full Changelog: v1.14.0...v1.15.0

v1.14.0 - Command Line Updates

26 May 23:36
a75324b
Compare
Choose a tag to compare

What's Changed

  • PyPI 1.14.0
  • README Update: Warn users about use of guest accounts by @Hello1024 in #491
  • Add support for pipx install tinytuya as raised by @felipecrs in #500 allowing for easier CLI use.
  • Updated docs to explain timeout as raised by @GamerPeggun in #501
  • Rewrite main to use argparse and add additional options by @uzlonewolf in #503
  • Note possible breaking change: Running tinytuya by itself will now produce a "Usage" page instead of running a scan. Use tinytuya scan or python -m tinytuya scan.
# Install CLI tool with pipx
pipx install tinytuya

tinytuya scan

New Contributors

Full Changelog: v1.13.2...v1.14.0