Remove deprecated yaml config from Syncthru (#62541)

This commit is contained in:
Robert Hillis 2021-12-23 08:31:28 -05:00 committed by GitHub
parent eb37668036
commit 66fd7de34a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 42 deletions

View file

@ -30,10 +30,6 @@ class SyncThruConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
return await self._async_show_form(step_id="user")
return await self._async_check_and_create("user", user_input)
async def async_step_import(self, user_input=None):
"""Handle import initiated flow."""
return await self.async_step_user(user_input=user_input)
async def async_step_ssdp(self, discovery_info: ssdp.SsdpServiceInfo) -> FlowResult:
"""Handle SSDP initiated flow."""
await self.async_set_unique_id(discovery_info.upnp[ssdp.ATTR_UPNP_UDN])

View file

@ -1,15 +1,10 @@
"""Support for Samsung Printers with SyncThru web interface."""
from __future__ import annotations
import logging
from pysyncthru import SyncThru, SyncthruState
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA, SensorEntity
from homeassistant.config_entries import SOURCE_IMPORT
from homeassistant.const import CONF_NAME, CONF_RESOURCE, CONF_URL, PERCENTAGE
import homeassistant.helpers.config_validation as cv
from homeassistant.components.sensor import SensorEntity
from homeassistant.const import CONF_NAME, PERCENTAGE
from homeassistant.helpers.entity import DeviceInfo
from homeassistant.helpers.update_coordinator import (
CoordinatorEntity,
@ -17,9 +12,7 @@ from homeassistant.helpers.update_coordinator import (
)
from . import device_identifiers
from .const import DEFAULT_MODEL, DEFAULT_NAME_TEMPLATE, DOMAIN
_LOGGER = logging.getLogger(__name__)
from .const import DOMAIN
COLORS = ["black", "cyan", "magenta", "yellow"]
DRUM_COLORS = COLORS
@ -42,34 +35,6 @@ SYNCTHRU_STATE_HUMAN = {
SyncthruState.ERROR: "error",
}
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(
{
vol.Required(CONF_RESOURCE): cv.url,
vol.Optional(
CONF_NAME, default=DEFAULT_NAME_TEMPLATE.format(DEFAULT_MODEL)
): cv.string,
}
)
async def async_setup_platform(hass, config, async_add_entities, discovery_info=None):
"""Set up the SyncThru component."""
_LOGGER.warning(
"Loading syncthru via platform config is deprecated and no longer "
"necessary as of 0.113; Please remove it from your configuration YAML"
)
hass.async_create_task(
hass.config_entries.flow.async_init(
DOMAIN,
context={"source": SOURCE_IMPORT},
data={
CONF_URL: config.get(CONF_RESOURCE),
CONF_NAME: config.get(CONF_NAME),
},
)
)
return True
async def async_setup_entry(hass, config_entry, async_add_entities):
"""Set up from config entry."""