Skip to content

Fetch the device list a 2nd time to make sure we have the local key#306

Merged
jasonacox merged 2 commits into
jasonacox:masterfrom
uzlonewolf:cloud
Mar 21, 2023
Merged

Fetch the device list a 2nd time to make sure we have the local key#306
jasonacox merged 2 commits into
jasonacox:masterfrom
uzlonewolf:cloud

Conversation

@uzlonewolf

Copy link
Copy Markdown
Collaborator

Closes #305

Comment thread tinytuya/wizard.py

# Find out if we should poll all devices
answer = input(subbold + '\nPoll local devices? ' + normal + '(Y/n): ')
if quicklist:

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

Comment thread tinytuya/Cloud.py
getproperties(deviceid)
getdps(deviceid)
sendcommand(deviceid, commands)
sendcommand(deviceid, commands [, uri])

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch

Comment thread tinytuya/Cloud.py
users[dev['uid']] = True
if users:
# we have at least 1 user id, so fetch the device list again to make sure we have the local key
# this also gets us the gateway_id for child devices

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love this!

@jasonacox
jasonacox merged commit eba92e2 into jasonacox:master Mar 21, 2023
@jasonacox

Copy link
Copy Markdown
Owner

Nice... I like the merge approach rather than scanning every ID with missing local_key's.

Testing...

Do we want to try to get any of the draft changes in on this release? I think this could go out as v1.12.1.

@uzlonewolf

Copy link
Copy Markdown
Collaborator Author

Up to you. Only reason I left #308 as a draft was because by the time I was done I was too tired to test it as much as I wanted. #300 is going to require some slight updates after these 2 are merged.

@jasonacox

Copy link
Copy Markdown
Owner

To keep it clean (and small batch changes), I released this PR as v1.12.1 (see https://pypi.org/project/tinytuya/1.12.1/).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Wizard doesn't pull local_key for some devices

2 participants