Fix Google Assistant User with Cloud (#22042)

* Fix Google Assistant User with Cloud

* Fix User Agent ID

* respell

* Fix object

* Fix tests

* fix lint

* Fix lint
This commit is contained in:
Pascal Vizeli authored and Paulus Schoutsen committed 2019-03-14 16:18:31 -07:00
1 parent 3769f5893a
commit 6a80ffa8cc
5 files changed
+94 -20

No files matched your search

+8 -4
View File
@@ -136,12 +136,16 @@ class CloudClient(Interface):
if not self._prefs.google_enabled:
return ga.turned_off_response(payload)
cloud = self._hass.data[DOMAIN]
return await ga.async_handle_message(
self._hass, self.google_config,
cloud.claims['cognito:username'], payload
answer = await ga.async_handle_message(
self._hass, self.google_config, self.prefs.cloud_user, payload
)
# Fix AgentUserId
cloud = self._hass.data[DOMAIN]
answer['payload']['agentUserId'] = cloud.claims['cognito:username']
return answer
async def async_webhook_message(
self, payload: Dict[Any, Any]) -> Dict[Any, Any]:
"""Process cloud webhook message to client."""