|
1 | 1 | # RELEASE NOTES |
2 | 2 |
|
| 3 | +## v1.17.0 - BulbDevice Rewrite |
| 4 | + |
| 5 | +* Rewrite BulbDevice and rework set_multiple_values() @uzlonewolf in https://github.com/jasonacox/tinytuya/pull/617 |
| 6 | +* Tool updates: pcap parse fix, new broadcast relay by @uzlonewolf in https://github.com/jasonacox/tinytuya/pull/612 |
| 7 | +* Fix initialization bug with python2 (embedded devices) by @Ircama in https://github.com/jasonacox/tinytuya/pull/615 |
| 8 | + |
| 9 | +BulbDevice Example Usage |
| 10 | + |
| 11 | +```python |
| 12 | +import time |
| 13 | +import random |
| 14 | +import tinytuya |
| 15 | + |
| 16 | +d = tinytuya.BulbDevice(DEVICEID, address=DEVICEIP, local_key=DEVICEKEY, version=DEVICEVERS, persist=True) |
| 17 | + |
| 18 | +# BASIC FUNCTIONS |
| 19 | +print('Basic Tests') |
| 20 | +d.set_colour(255,127,63) # Set to orange |
| 21 | +d.set_white_percentage(100.0, 0.0) # 100% brightness, 0% colour temperature |
| 22 | +d.set_brightness_percentage(100) # 100% brightness |
| 23 | + |
| 24 | +# MUSIC MODE |
| 25 | +print("Music Mode") |
| 26 | +d.set_mode('music') |
| 27 | +d.set_socketPersistent( True ) |
| 28 | +# Devices respond with a command ACK, but do not send DP updates. |
| 29 | +# Setting the 2 options below causes it to wait for a response but |
| 30 | +# return immediately after an ACK. |
| 31 | +d.set_sendWait( None ) |
| 32 | +d.set_retry( False ) |
| 33 | +for x in range(100): |
| 34 | + red = random.randint(0,255) |
| 35 | + green = random.randint(0,255) |
| 36 | + blue = random.randint(0,255) |
| 37 | + if (x % 6 == 0): |
| 38 | + # extend every 6 beat |
| 39 | + d.set_music_colour( d.MUSIC_TRANSITION_FADE, red, green, blue ) |
| 40 | + time.sleep(2) |
| 41 | + else: |
| 42 | + # Jump! |
| 43 | + d.set_music_colour( d.MUSIC_TRANSITION_JUMP, red, green, blue ) |
| 44 | + time.sleep(0.1) # the bulbs seem to get upset if updates are faster than 0.1s (100ms) |
| 45 | + |
| 46 | +# SCENE MODE |
| 47 | +if d.bulb_has_capability(d.BULB_FEATURE_SCENE_DATA): |
| 48 | + d.set_mode('scene') |
| 49 | + print('String based scenes compatible smartbulb detected.') |
| 50 | + # Example: Color rotation |
| 51 | + print('Switch to Scene 7 - Color Rotation') |
| 52 | + d.set_scene( 7, '464602000003e803e800000000464602007803e803e80000000046460200f003e803e800000000464602003d03e803e80000000046460200ae03e803e800000000464602011303e803e800000000') |
| 53 | +``` |
| 54 | + |
3 | 55 | ## v1.16.3 - Cloud Error Handling |
4 | 56 |
|
5 | 57 | * Add error handling in Cloud getdevices() function for edge case where old devices.json has corrupt or malformed device entries. |
|
0 commit comments