Skip to content

Commit

Permalink
Merge pull request #382 from jasonacox/getdevices
Browse files Browse the repository at this point in the history
Fix Cloud getdevices() bug for devices.json
  • Loading branch information
jasonacox authored Jul 4, 2023
2 parents b329dd0 + 7bba52e commit f62925f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

* PyPI 1.12.9
* Add graceful handling of issue where urllib3 v2.0 causes `ImportError: urllib3 v2.0 only supports OpenSSL 1.1.1+` error. See https://github.com/jasonacox/tinytuya/issues/377.
* Fix bug in Cloud getdevices() that can error with older `devices.json` versions as raised in https://github.com/jasonacox/tinytuya/issues/381

## v1.12.8 - Device DP Mapping

Expand Down
4 changes: 2 additions & 2 deletions tinytuya/Cloud.py
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@ def getdevices(self, verbose=False, oldlist=[], include_map=False):
changed_devices = []
unchanged_devices = []

# chect to see if anything has changed. if so, re-download factory-infos and DP mapping
# check to see if anything has changed. if so, re-download factory-infos and DP mapping
for dev in devs:
dev_id = dev['id']
if dev_id not in old_devices:
Expand All @@ -487,7 +487,7 @@ def getdevices(self, verbose=False, oldlist=[], include_map=False):
continue
is_same = True
for k in DEVICEFILE_SAVE_VALUES:
if k in dev and k != 'icon' and k != 'last_ip' and old[k] != dev[k]:
if k in dev and k != 'icon' and k != 'last_ip' and (k not in old or old[k] != dev[k]):
is_same = False
break
if not is_same:
Expand Down

0 comments on commit f62925f

Please sign in to comment.