Move GoogleConfig initialization into setup of component (#29170)
This commit is contained in:
1 parent
3ecf5596ff
commit
69991bf3a2
2 files changed
+7
-13
No files matched your search
@@ -10,7 +10,6 @@ from aiohttp.web import Request, Response
|
||||
|
||||
# Typing imports
|
||||
from homeassistant.components.http import HomeAssistantView
|
||||
from homeassistant.core import callback
|
||||
from homeassistant.const import CLOUD_NEVER_EXPOSED_ENTITIES
|
||||
from homeassistant.helpers.aiohttp_client import async_get_clientsession
|
||||
from homeassistant.util import dt as dt_util
|
||||
@@ -225,16 +224,6 @@ class GoogleConfig(AbstractConfig):
|
||||
await self.async_call_homegraph_api(REPORT_STATE_BASE_URL, data)
|
||||
|
||||
|
||||
@callback
|
||||
def async_register_http(hass, cfg):
|
||||
"""Register HTTP views for Google Assistant."""
|
||||
config = GoogleConfig(hass, cfg)
|
||||
hass.http.register_view(GoogleAssistantView(config))
|
||||
if config.should_report_state:
|
||||
config.async_enable_report_state()
|
||||
return config
|
||||
|
||||
|
||||
class GoogleAssistantView(HomeAssistantView):
|
||||
"""Handle Google Assistant requests."""
|
||||
|
||||
|
||||
Reference in new issue
Block a user