Skip to content

Commit

Permalink
Updated to support protocol 3.2
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonacox committed Aug 13, 2022
1 parent e3c7358 commit 8b9b1fe
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
13 changes: 5 additions & 8 deletions tinytuya/scanner.py
Original file line number Diff line number Diff line change
Expand Up @@ -360,10 +360,10 @@ def tuyaLookup(deviceid):
if verbose:
print(dim + " Status: %s" % dpsdata["dps"])
else:
# Version 3.3+ requires device key
# Version 3.2 and up requires device key
if dkey != "":
d = tinytuya.OutletDevice(gwId, ip, dkey)
d.set_version(3.3)
d.set_version(float(version))
dpsdata = d.status()
if "dps" not in dpsdata:
if verbose:
Expand Down Expand Up @@ -513,8 +513,7 @@ def snapshot(color=True):
else:
try:
d = tinytuya.OutletDevice(i['id'], ip, i['key'])
if ver == "3.3":
d.set_version(3.3)
d.set_version(float(ver))
data = d.status()
if 'dps' in data:
item['dps'] = data
Expand Down Expand Up @@ -623,8 +622,7 @@ def getIP(d, gwid):
else:
try:
d = tinytuya.OutletDevice(i['id'], ip, i['key'])
if ver == "3.3":
d.set_version(3.3)
d.set_version(float(ver))
data = d.status()
if 'dps' in data:
item['dps'] = data
Expand Down Expand Up @@ -702,8 +700,7 @@ def snapshotjson():
else:
try:
d = tinytuya.OutletDevice(i['id'], ip, i['key'])
if ver == "3.3":
d.set_version(3.3)
d.set_version(float(ver))
data = d.status()
if 'dps' in data:
item['dps'] = data
Expand Down
3 changes: 1 addition & 2 deletions tinytuya/wizard.py
Original file line number Diff line number Diff line change
Expand Up @@ -401,8 +401,7 @@ def getIP(d, gwid):
else:
try:
d = tinytuya.OutletDevice(i['id'], ip, i['key'])
if ver == "3.3":
d.set_version(3.3)
d.set_version(float(ver))
data = d.status()
if 'dps' in data:
item['dps'] = data
Expand Down

0 comments on commit 8b9b1fe

Please sign in to comment.