Add config entries to connection class (#16618)

This commit is contained in:
Paulus Schoutsen authored and Pascal Vizeli committed 2018-09-17 10:12:46 +02:00
1 parent 3e0c6c176a
commit 201fd4afee
24 files changed
+104 -63

No files matched your search

+2 -1
View File
@@ -35,4 +35,5 @@ async def _async_has_devices(hass):
config_entry_flow.register_discovery_flow(
DOMAIN, 'Google Cast', _async_has_devices)
DOMAIN, 'Google Cast', _async_has_devices,
config_entries.CONN_CLASS_LOCAL_PUSH)
@@ -54,6 +54,7 @@ class ConfigManagerEntryIndexView(HomeAssistantView):
'title': entry.title,
'source': entry.source,
'state': entry.state,
'connection_class': entry.connection_class,
} for entry in hass.config_entries.async_entries()])
@@ -2,7 +2,7 @@
import voluptuous as vol
from homeassistant import config_entries, data_entry_flow
from homeassistant import config_entries
from homeassistant.core import callback
from homeassistant.const import CONF_API_KEY, CONF_HOST, CONF_PORT
from homeassistant.helpers import aiohttp_client
@@ -23,10 +23,11 @@ def configured_hosts(hass):
@config_entries.HANDLERS.register(DOMAIN)
class DeconzFlowHandler(data_entry_flow.FlowHandler):
class DeconzFlowHandler(config_entries.ConfigFlow):
"""Handle a deCONZ config flow."""
VERSION = 1
CONNECTION_CLASS = config_entries.CONN_CLASS_LOCAL_PUSH
def __init__(self):
"""Initialize the deCONZ config flow."""
@@ -1,7 +1,7 @@
"""Config flow to configure Google Hangouts."""
import voluptuous as vol
from homeassistant import config_entries, data_entry_flow
from homeassistant import config_entries
from homeassistant.const import CONF_EMAIL, CONF_PASSWORD
from homeassistant.core import callback
@@ -19,10 +19,11 @@ def configured_hangouts(hass):
@config_entries.HANDLERS.register(HANGOUTS_DOMAIN)
class HangoutsFlowHandler(data_entry_flow.FlowHandler):
class HangoutsFlowHandler(config_entries.ConfigFlow):
"""Config flow Google Hangouts."""
VERSION = 1
CONNECTION_CLASS = config_entries.CONN_CLASS_CLOUD_PUSH
def __init__(self):
"""Initialize Google Hangouts config flow."""
@@ -1,7 +1,7 @@
"""Config flow to configure the HomematicIP Cloud component."""
import voluptuous as vol
from homeassistant import config_entries, data_entry_flow
from homeassistant import config_entries
from homeassistant.core import callback
from .const import DOMAIN as HMIPC_DOMAIN
@@ -18,10 +18,11 @@ def configured_haps(hass):
@config_entries.HANDLERS.register(HMIPC_DOMAIN)
class HomematicipCloudFlowHandler(data_entry_flow.FlowHandler):
class HomematicipCloudFlowHandler(config_entries.ConfigFlow):
"""Config flow for the HomematicIP Cloud component."""
VERSION = 1
CONNECTION_CLASS = config_entries.CONN_CLASS_CLOUD_PUSH
def __init__(self):
"""Initialize HomematicIP Cloud config flow."""
+3 -2
View File
@@ -6,7 +6,7 @@ import os
import async_timeout
import voluptuous as vol
from homeassistant import config_entries, data_entry_flow
from homeassistant import config_entries
from homeassistant.core import callback
from homeassistant.helpers import aiohttp_client
@@ -41,10 +41,11 @@ def _find_username_from_config(hass, filename):
@config_entries.HANDLERS.register(DOMAIN)
class HueFlowHandler(data_entry_flow.FlowHandler):
class HueFlowHandler(config_entries.ConfigFlow):
"""Handle a Hue config flow."""
VERSION = 1
CONNECTION_CLASS = config_entries.CONN_CLASS_LOCAL_POLL
def __init__(self):
"""Initialize the Hue flow."""
+2 -1
View File
@@ -293,4 +293,5 @@ class iOSIdentifyDeviceView(HomeAssistantView):
config_entry_flow.register_discovery_flow(
DOMAIN, 'Home Assistant iOS', lambda *_: True)
DOMAIN, 'Home Assistant iOS', lambda *_: True,
config_entries.CONN_CLASS_CLOUD_PUSH)
@@ -15,6 +15,7 @@ class FlowHandler(config_entries.ConfigFlow):
"""Handle a config flow."""
VERSION = 1
CONNECTION_CLASS = config_entries.CONN_CLASS_LOCAL_PUSH
async def async_step_user(self, user_input=None):
"""Handle a flow initialized by the user."""
+3 -2
View File
@@ -7,7 +7,7 @@ import os
import async_timeout
import voluptuous as vol
from homeassistant import config_entries, data_entry_flow
from homeassistant import config_entries
from homeassistant.core import callback
from homeassistant.exceptions import HomeAssistantError
from homeassistant.util.json import load_json
@@ -49,10 +49,11 @@ class CodeInvalid(NestAuthError):
@config_entries.HANDLERS.register(DOMAIN)
class NestFlowHandler(data_entry_flow.FlowHandler):
class NestFlowHandler(config_entries.ConfigFlow):
"""Handle a Nest config flow."""
VERSION = 1
CONNECTION_CLASS = config_entries.CONN_CLASS_CLOUD_PUSH
def __init__(self):
"""Initialize the Nest config flow."""
@@ -4,7 +4,7 @@ from collections import OrderedDict
import voluptuous as vol
from homeassistant import config_entries, data_entry_flow
from homeassistant import config_entries
from homeassistant.core import callback
from homeassistant.const import (
CONF_API_KEY, CONF_ELEVATION, CONF_LATITUDE, CONF_LONGITUDE)
@@ -23,10 +23,11 @@ def configured_instances(hass):
@config_entries.HANDLERS.register(DOMAIN)
class OpenUvFlowHandler(data_entry_flow.FlowHandler):
class OpenUvFlowHandler(config_entries.ConfigFlow):
"""Handle an OpenUV config flow."""
VERSION = 1
CONNECTION_CLASS = config_entries.CONN_CLASS_CLOUD_POLL
def __init__(self):
"""Initialize the config flow."""
+2 -1
View File
@@ -34,4 +34,5 @@ async def _async_has_devices(hass):
return await hass.async_add_executor_job(soco.discover)
config_entry_flow.register_discovery_flow(DOMAIN, 'Sonos', _async_has_devices)
config_entry_flow.register_discovery_flow(
DOMAIN, 'Sonos', _async_has_devices, config_entries.CONN_CLASS_LOCAL_PUSH)
+2 -2
View File
@@ -3,7 +3,7 @@
import voluptuous as vol
import homeassistant.helpers.config_validation as cv
from homeassistant import config_entries, data_entry_flow
from homeassistant import config_entries
from homeassistant.const import (
CONF_NAME, CONF_LATITUDE, CONF_LONGITUDE, CONF_ICON, CONF_RADIUS)
from homeassistant.core import callback
@@ -20,7 +20,7 @@ def configured_zones(hass):
@config_entries.HANDLERS.register(DOMAIN)
class ZoneFlowHandler(data_entry_flow.FlowHandler):
class ZoneFlowHandler(config_entries.ConfigFlow):
"""Zone config flow."""
VERSION = 1