Remove YAML support from rachio (#45383)
This commit is contained in:
parent
d733292982
commit
3029a95410
2 changed files with 3 additions and 35 deletions
|
@ -5,21 +5,14 @@ import secrets
|
||||||
|
|
||||||
from rachiopy import Rachio
|
from rachiopy import Rachio
|
||||||
from requests.exceptions import ConnectTimeout
|
from requests.exceptions import ConnectTimeout
|
||||||
import voluptuous as vol
|
|
||||||
|
|
||||||
from homeassistant.config_entries import SOURCE_IMPORT, ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.const import CONF_API_KEY
|
from homeassistant.const import CONF_API_KEY
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.exceptions import ConfigEntryNotReady
|
from homeassistant.exceptions import ConfigEntryNotReady
|
||||||
from homeassistant.helpers import config_validation as cv
|
from homeassistant.helpers import config_validation as cv
|
||||||
|
|
||||||
from .const import (
|
from .const import CONF_CLOUDHOOK_URL, CONF_MANUAL_RUN_MINS, CONF_WEBHOOK_ID, DOMAIN
|
||||||
CONF_CLOUDHOOK_URL,
|
|
||||||
CONF_MANUAL_RUN_MINS,
|
|
||||||
CONF_WEBHOOK_ID,
|
|
||||||
DEFAULT_MANUAL_RUN_MINS,
|
|
||||||
DOMAIN,
|
|
||||||
)
|
|
||||||
from .device import RachioPerson
|
from .device import RachioPerson
|
||||||
from .webhooks import (
|
from .webhooks import (
|
||||||
async_get_or_create_registered_webhook_id_and_url,
|
async_get_or_create_registered_webhook_id_and_url,
|
||||||
|
@ -30,35 +23,14 @@ _LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
SUPPORTED_DOMAINS = ["switch", "binary_sensor"]
|
SUPPORTED_DOMAINS = ["switch", "binary_sensor"]
|
||||||
|
|
||||||
CONFIG_SCHEMA = vol.Schema(
|
CONFIG_SCHEMA = cv.deprecated(DOMAIN)
|
||||||
{
|
|
||||||
DOMAIN: vol.Schema(
|
|
||||||
{
|
|
||||||
vol.Required(CONF_API_KEY): cv.string,
|
|
||||||
vol.Optional(
|
|
||||||
CONF_MANUAL_RUN_MINS, default=DEFAULT_MANUAL_RUN_MINS
|
|
||||||
): cv.positive_int,
|
|
||||||
}
|
|
||||||
)
|
|
||||||
},
|
|
||||||
extra=vol.ALLOW_EXTRA,
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
async def async_setup(hass: HomeAssistant, config: dict):
|
async def async_setup(hass: HomeAssistant, config: dict):
|
||||||
"""Set up the rachio component from YAML."""
|
"""Set up the rachio component from YAML."""
|
||||||
|
|
||||||
conf = config.get(DOMAIN)
|
|
||||||
hass.data.setdefault(DOMAIN, {})
|
hass.data.setdefault(DOMAIN, {})
|
||||||
|
|
||||||
if not conf:
|
|
||||||
return True
|
|
||||||
|
|
||||||
hass.async_create_task(
|
|
||||||
hass.config_entries.flow.async_init(
|
|
||||||
DOMAIN, context={"source": SOURCE_IMPORT}, data=conf
|
|
||||||
)
|
|
||||||
)
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -94,10 +94,6 @@ class ConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
|
||||||
await self.async_set_unique_id(properties["id"])
|
await self.async_set_unique_id(properties["id"])
|
||||||
return await self.async_step_user()
|
return await self.async_step_user()
|
||||||
|
|
||||||
async def async_step_import(self, user_input):
|
|
||||||
"""Handle import."""
|
|
||||||
return await self.async_step_user(user_input)
|
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
@callback
|
@callback
|
||||||
def async_get_options_flow(config_entry):
|
def async_get_options_flow(config_entry):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue