Add Google Report State (#27112)

* Add Google Report State

* UPDATE codeowners"

* Add config option for dev mode

* update library

* lint

* Bug fixes
This commit is contained in:
Paulus Schoutsen
2019-10-03 04:02:38 -07:00
committed by Pascal Vizeli
parent 3e99743244
commit f184bf4d85
26 changed files with 510 additions and 56 deletions

View File

@@ -98,7 +98,7 @@ class CloudClient(Interface):
if not self._google_config:
assert self.cloud is not None
self._google_config = google_config.CloudGoogleConfig(
self.google_user_config, self._prefs, self.cloud
self._hass, self.google_user_config, self._prefs, self.cloud
)
return self._google_config
@@ -107,13 +107,17 @@ class CloudClient(Interface):
"""Initialize the client."""
self.cloud = cloud
if not self.alexa_config.should_report_state or not self.cloud.is_logged_in:
if not self.cloud.is_logged_in:
return
try:
await self.alexa_config.async_enable_proactive_mode()
except alexa_errors.NoTokenAvailable:
pass
if self.alexa_config.should_report_state:
try:
await self.alexa_config.async_enable_proactive_mode()
except alexa_errors.NoTokenAvailable:
pass
if self.google_config.should_report_state:
self.google_config.async_enable_report_state()
async def cleanups(self) -> None:
"""Cleanup some stuff after logout."""