Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
Mar 21, 2023

Conversation

uzlonewolf
Copy link
Collaborator

Closes #305

@@ -213,7 +226,10 @@ def wizard(color=True, retries=None, forcescan=False, nocloud=False):
print('\n\n' + bold + 'Unable to save raw file' + dim )

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

Choose a reason for hiding this comment

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

Nice!

@@ -18,7 +18,7 @@
getfunctions(deviceid)
getproperties(deviceid)
getdps(deviceid)
sendcommand(deviceid, commands)
sendcommand(deviceid, commands [, uri])
Copy link
Owner

Choose a reason for hiding this comment

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

Good catch

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
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
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
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
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