Skip to content

v1.1.4 - Update DPS (Command 18)

Compare
Choose a tag to compare
@jasonacox jasonacox released this 01 Feb 02:14
· 858 commits to master since this release
  • 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
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)