Move hangouts imports at top-level (#29055)
This commit is contained in:
1 parent
1fde0d18ed
commit
112a3f5e9f
4 files changed
+50
-48
No files matched your search
@@ -1,16 +1,16 @@
|
||||
"""Support for Hangouts."""
|
||||
import logging
|
||||
|
||||
from hangups.auth import GoogleAuthError
|
||||
import voluptuous as vol
|
||||
|
||||
from homeassistant import config_entries
|
||||
from homeassistant.components.conversation.util import create_matcher
|
||||
from homeassistant.const import EVENT_HOMEASSISTANT_STOP
|
||||
from homeassistant.helpers import dispatcher, intent
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
from homeassistant.components.conversation.util import create_matcher
|
||||
|
||||
# We need an import from .config_flow, without it .config_flow is never loaded.
|
||||
from .intents import HelpIntent
|
||||
from .config_flow import HangoutsFlowHandler # noqa: F401
|
||||
from .const import (
|
||||
CONF_BOT,
|
||||
@@ -32,6 +32,8 @@ from .const import (
|
||||
SERVICE_UPDATE,
|
||||
TARGETS_SCHEMA,
|
||||
)
|
||||
from .hangouts_bot import HangoutsBot
|
||||
from .intents import HelpIntent
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
@@ -96,11 +98,7 @@ async def async_setup(hass, config):
|
||||
|
||||
async def async_setup_entry(hass, config):
|
||||
"""Set up a config entry."""
|
||||
from hangups.auth import GoogleAuthError
|
||||
|
||||
try:
|
||||
from .hangouts_bot import HangoutsBot
|
||||
|
||||
bot = HangoutsBot(
|
||||
hass,
|
||||
config.data.get(CONF_REFRESH_TOKEN),
|
||||
|
||||
Reference in new issue
Block a user