From 3114af0386c1f72eede0c0f5f015ee81db41093e Mon Sep 17 00:00:00 2001 From: edif30 Date: Fri, 7 Dec 2018 21:45:10 -0500 Subject: [PATCH 1/5] Fix google assistant request sync service call From d6df384fc4f8681c5977c968f6e6770a769eb64f Mon Sep 17 00:00:00 2001 From: edif30 Date: Fri, 7 Dec 2018 21:52:05 -0500 Subject: [PATCH 2/5] More descriptive services.yaml --- homeassistant/components/google_assistant/services.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homeassistant/components/google_assistant/services.yaml b/homeassistant/components/google_assistant/services.yaml index 7d3af71ac2bba..1e25dd899c940 100644 --- a/homeassistant/components/google_assistant/services.yaml +++ b/homeassistant/components/google_assistant/services.yaml @@ -2,4 +2,4 @@ request_sync: description: Send a request_sync command to Google. fields: agent_user_id: - description: Optional. Only needed for automations. Specific Home Assistant user id to sync with Google Assistant. Do not need when you call this service through Home Assistant front end or API. Used in automation script or other place where context.user_id is missing. + description: "Optional. Only needed for automations. Specific Home Assistant user id (not username, ID in configuration > users > under username) to sync with Google Assistant. Do not need when you call this service through Home Assistant front end or API. Used in automation script or other place where context.user_id is missing. From b3f75048ad4d58afd23fe74f504d382a58ff7a81 Mon Sep 17 00:00:00 2001 From: edif30 Date: Fri, 7 Dec 2018 21:53:15 -0500 Subject: [PATCH 3/5] Update services.yaml --- homeassistant/components/google_assistant/services.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homeassistant/components/google_assistant/services.yaml b/homeassistant/components/google_assistant/services.yaml index 1e25dd899c940..33a52c8ef6050 100644 --- a/homeassistant/components/google_assistant/services.yaml +++ b/homeassistant/components/google_assistant/services.yaml @@ -2,4 +2,4 @@ request_sync: description: Send a request_sync command to Google. fields: agent_user_id: - description: "Optional. Only needed for automations. Specific Home Assistant user id (not username, ID in configuration > users > under username) to sync with Google Assistant. Do not need when you call this service through Home Assistant front end or API. Used in automation script or other place where context.user_id is missing. + description: "Optional. Only needed for automations. Specific Home Assistant user id (not username, ID in configuration > users > under username) to sync with Google Assistant. Do not need when you call this service through Home Assistant front end or API. Used in automation script or other place where context.user_id is missing." From fa78b779024ccd5bb3894952936faabfa09bef51 Mon Sep 17 00:00:00 2001 From: edif30 Date: Fri, 7 Dec 2018 22:46:20 -0500 Subject: [PATCH 4/5] Update __init__.py From 14b123968743049a0ae6467c1a84774555c884c9 Mon Sep 17 00:00:00 2001 From: edif30 Date: Sat, 8 Dec 2018 15:31:45 -0500 Subject: [PATCH 5/5] Update request sync service call timeout Change from 5s to 15s to allow Google to respond. 5s was too short. The service would sync but the service call would time out and throw the error. --- homeassistant/components/google_assistant/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homeassistant/components/google_assistant/__init__.py b/homeassistant/components/google_assistant/__init__.py index bf0c72ec1c8e0..c0dff15d888c2 100644 --- a/homeassistant/components/google_assistant/__init__.py +++ b/homeassistant/components/google_assistant/__init__.py @@ -67,7 +67,7 @@ async def request_sync_service_handler(call: ServiceCall): """Handle request sync service calls.""" websession = async_get_clientsession(hass) try: - with async_timeout.timeout(5, loop=hass.loop): + with async_timeout.timeout(15, loop=hass.loop): agent_user_id = call.data.get('agent_user_id') or \ call.context.user_id res = await websession.post(