* Track if request is local
* Cancel early if 2FA disabled
* Allow disabling 2FA for ack
* Do not mark devices with 2FA as reachable
* Add request source to GA events
* Move imports to top for google_assistant
* Fix pylint error caused by isorting the imports with noqa: F401
* Move back an import because of circular dependency, add annotations
* Report unavailable entites to google.
Entities should only removed when removed from HA. Removing a temporarily unavailable entity from google causes it to need to re-configured once it become available again.
* Fix test for unavailable entities
* Make async_report_state take agent_user_id
* Attempt to store synced agents
* Drop now not needed initialization
* Make sure cloud uses the all sync on changed preferences
* Some more places to use all version of sync
* Get the agent_user_id from the request context if available
* Minor cleanup
* Remove the old fixed agent_user_id for cloud
Instead pass along cloud_user where appropriate.
* async_delay_save takes a function
* Adjust test for delayed store
* Remove unused save function
* Add login check.
* Move request sync logic into GoogleConfig
* Return http status code for request_sync same as cloud
* agent_user_id is not optional for async_sync_entities now
* No need in checking parameter here
* Adjust some things for cloud tests
* Adjust some more stuff for cloud tests
* Drop uneccessary else
* Black required change
* Let async_schedule_google_sync take agent_user_id
* Assert return value on api call
* Test old api key method
* Update homeassistant/components/google_assistant/helpers.py
Co-Authored-By: Paulus Schoutsen <paulus@home-assistant.io>
* Extract exposed devices function
* Add might_2fa info to trait
* Do not filter with should_expose in Google helper func
* Cloud: allow setting if Google entity is exposed
* Allow disabling 2FA via config
* Cloud: allow disabling 2FA
* Lint
* More changes
* Fix typing
* Skip entity if no device type found
* Add test for potentially skipped binary sensors
* Reorg code, add tests to ensure all exposed things have types
* Lint
* Fix tests
* Lint
The `Config` object specific to the `google_assistant` component
had a default value for `allow_unlock`. We were not overriding this
default when constructing the Config object during `google_assistant`
component setup, whereas we do when setting up the `cloud` component.
To fix, we thread the `allow_unlock` parameter down through http setup,
and ensure that it's set correctly. Moreover, we also change the
ordering of the `Config` parameters, and remove the default. Future
refactoring should not miss it, as it is now a required parameter.
* Add support for locks in google assistant component
This is supported by the smarthome API, but there is no documentation
for it. This work is based on an article I found with screenshots of
documentation that was erroneously uploaded:
https://www.androidpolice.com/2018/01/17/google-assistant-home-can-now-natively-control-smart-locks-august-vivint-first-supported/
Google Assistant now supports unlocking certain locks - Nest and August
come to mind - via this API, and this commit allows Home Assistant to
do so as well.
Notably, I've added a config option `allow_unlock` that controls
whether we actually honor requests to unlock a lock via the google
assistant. It defaults to false.
Additionally, we add the functionNotSupported error, which makes a
little more sense when we're unable to execute the desired state
transition.
https://developers.google.com/actions/reference/smarthome/errors-exceptions#exception_list
* Fix linter warnings
* Ensure that certain groups are never exposed to cloud entities
For example, the group.all_locks entity - we should probably never
expose this to third party cloud integrations. It's risky.
This is not configurable, but can be extended by adding to the
cloud.const.NEVER_EXPOSED_ENTITIES array.
It's implemented in a modestly hacky fashion, because we determine
whether or not a entity should be excluded/included in several ways.
Notably, we define this array in the top level const.py, to avoid
circular import problems between the cloud/alexa components.
* Refactor Google Assistant
* Fix cloud test
* Fix supported features media player demo
* Fix query
* Fix execute
* Fix demo media player tests
* Add tests for traits
* Lint
* Lint
* Add integration tests
* Add more tests
* update logging
* Catch out of range temp errrors
* Fix cloud error
* Lint