bugfix: ensure the google_assistant component respects allow_unlock (#18874)

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.
This commit is contained in:
Andrew Hayworth authored and Paulus Schoutsen committed 2018-12-02 11:14:46 +01:00
1 parent a62fc7ca04
commit b7e2522083
5 files changed
+12 -5

No files matched your search

@@ -11,6 +11,7 @@ from homeassistant.components.light.demo import DemoLight
BASIC_CONFIG = helpers.Config(
should_expose=lambda state: True,
allow_unlock=False,
agent_user_id='test-agent',
)
REQ_ID = 'ff36a3cc-ec34-11e6-b1a0-64510650abcf'
@@ -35,6 +36,7 @@ async def test_sync_message(hass):
config = helpers.Config(
should_expose=lambda state: state.entity_id != 'light.not_expose',
allow_unlock=False,
agent_user_id='test-agent',
entity_config={
'light.demo_light': {
@@ -25,6 +25,7 @@ from tests.common import async_mock_service
BASIC_CONFIG = helpers.Config(
should_expose=lambda state: True,
allow_unlock=False,
agent_user_id='test-agent',
)