Remove YAML config from Ring integration (#32039)

This commit is contained in:
Paulus Schoutsen committed 2020-02-21 17:38:24 -08:00
1 parent a102728997
commit a3b3ff52fc
3 files changed
+1 -57

No files matched your search

+1 -26
View File
@@ -9,12 +9,9 @@ from typing import Optional
from oauthlib.oauth2 import AccessDeniedError
import requests
from ring_doorbell import Auth, Ring
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.const import CONF_PASSWORD, CONF_USERNAME, __version__
from homeassistant.const import __version__
from homeassistant.core import HomeAssistant, callback
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.event import async_track_time_interval
from homeassistant.util.async_ import run_callback_threadsafe
@@ -30,18 +27,6 @@ DEFAULT_ENTITY_NAMESPACE = "ring"
PLATFORMS = ("binary_sensor", "light", "sensor", "switch", "camera")
CONFIG_SCHEMA = vol.Schema(
{
vol.Optional(DOMAIN): vol.Schema(
{
vol.Required(CONF_USERNAME): cv.string,
vol.Required(CONF_PASSWORD): cv.string,
}
)
},
extra=vol.ALLOW_EXTRA,
)
async def async_setup(hass, config):
"""Set up the Ring component."""
@@ -56,16 +41,6 @@ async def async_setup(hass, config):
await hass.async_add_executor_job(legacy_cleanup)
hass.async_create_task(
hass.config_entries.flow.async_init(
DOMAIN,
context={"source": config_entries.SOURCE_IMPORT},
data={
"username": config[DOMAIN]["username"],
"password": config[DOMAIN]["password"],
},
)
)
return True
@@ -75,13 +75,6 @@ class RingConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
step_id="2fa", data_schema=vol.Schema({"2fa": str}),
)
async def async_step_import(self, user_input):
"""Handle import."""
if self._async_current_entries():
return self.async_abort(reason="already_configured")
return await self.async_step_user(user_input)
class Require2FA(exceptions.HomeAssistantError):
"""Error to indicate we require 2FA."""