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

Google assistant storage of connected agents #29158

Merged
merged 12 commits into from Dec 3, 2019

Conversation

@elupus
Copy link
Contributor

elupus commented Nov 27, 2019

Description:

This adds support for remembering which user agent have connected to your home assistance instance and gives support for disconnect calls as well as separate listed entities for different users.

Example entry for configuration.yaml (if applicable):

Checklist:

  • The code change is tested and works locally.
  • Local tests pass with tox. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly. Update and include derived files by running python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt by running python3 -m script.gen_requirements_all.
  • Untested files have been added to .coveragerc.

If the code does not interact with devices:

  • Tests have been added to verify that the new code works.
@probot-home-assistant

This comment has been minimized.

Copy link

probot-home-assistant bot commented Nov 27, 2019

Hey there @home-assistant/cloud, mind taking a look at this pull request as its been labeled with a integration (cloud) you are listed as a codeowner for? Thanks!

@probot-home-assistant

This comment has been minimized.

Copy link

probot-home-assistant bot commented Nov 27, 2019

Hey there @home-assistant/cloud, mind taking a look at this pull request as its been labeled with a integration (google_assistant) you are listed as a codeowner for? Thanks!

@project-bot project-bot bot added this to Needs review in Dev Nov 27, 2019
@elupus elupus mentioned this pull request Nov 27, 2019
3 of 9 tasks complete
@elupus elupus force-pushed the elupus:google_assistant_storage_2 branch from cbd28be to 20fa575 Nov 27, 2019
@elupus elupus force-pushed the elupus:google_assistant_storage_2 branch from 9b45727 to 12817cf Nov 28, 2019
@elupus

This comment has been minimized.

Copy link
Contributor Author

elupus commented Nov 28, 2019

Nice, this pull is starting to look quite clean now.

Do we need an upgrade function? The store will be empty for upgrading users. A user that have already connected would need to relink, issue a sync by refreshing in google home, explicitly do a sync request from HA. I think that is enough to mention in release notes.

elupus added 5 commits Nov 28, 2019
Instead pass along cloud_user where appropriate.
@MartinHjelmare MartinHjelmare moved this from Needs review to Incoming in Dev Nov 29, 2019
@elupus elupus marked this pull request as ready for review Nov 29, 2019
@MartinHjelmare MartinHjelmare moved this from Incoming to Needs review in Dev Nov 29, 2019
def async_schedule_google_sync_all(self):
"""Schedule a sync for all registered agents."""
for agent_user_id in self._store.agent_user_ids:
self.async_schedule_google_sync(agent_user_id)

This comment has been minimized.

Copy link
@balloob

balloob Dec 3, 2019

Member

We don't have to keep async_schedule_google_sync around, we will never want a single sync to be done ? Probably same for a bunch of other methods that involve a single action instead of doing it for all connected users

This comment has been minimized.

Copy link
@balloob

balloob Dec 3, 2019

Member

nevermind, realize now that the per-agent-user-id methods are implemented by the implementations and not the base class.

@balloob
balloob approved these changes Dec 3, 2019
Dev automation moved this from Needs review to Reviewer approved Dec 3, 2019
@balloob balloob merged commit 2569c4a into home-assistant:dev Dec 3, 2019
2 of 5 checks passed
2 of 5 checks passed
CI #20191203.7 failed
Details
CI (Overview CheckFormat) Overview CheckFormat failed
Details
CI (Overview Lint) Overview Lint failed
Details
CI (Overview Validate) Overview Validate succeeded
Details
cla-bot Everyone involved has signed the CLA
Dev automation moved this from Reviewer approved to Done Dec 3, 2019
@lock lock bot locked and limited conversation to collaborators Dec 4, 2019
@elupus elupus deleted the elupus:google_assistant_storage_2 branch Jan 2, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
Dev
  
Done
4 participants
You can’t perform that action at this time.