From 514516baccd8fe6a1a566db633247c2eaef51874 Mon Sep 17 00:00:00 2001 From: Erik Montnemery Date: Fri, 12 Mar 2021 13:52:46 +0100 Subject: [PATCH] Remove unused COVER_SCHEMA from gogogate2 cover (#47170) --- homeassistant/components/gogogate2/cover.py | 26 ++++++--------------- 1 file changed, 7 insertions(+), 19 deletions(-) diff --git a/homeassistant/components/gogogate2/cover.py b/homeassistant/components/gogogate2/cover.py index 053c35c171a..2d97edbfe43 100644 --- a/homeassistant/components/gogogate2/cover.py +++ b/homeassistant/components/gogogate2/cover.py @@ -1,8 +1,8 @@ """Support for Gogogate2 garage Doors.""" +import logging from typing import Callable, List, Optional from gogogate2_api.common import AbstractDoor, DoorStatus, get_configured_doors -import voluptuous as vol from homeassistant.components.cover import ( DEVICE_CLASS_GARAGE, @@ -12,14 +12,7 @@ from homeassistant.components.cover import ( CoverEntity, ) from homeassistant.config_entries import SOURCE_IMPORT, ConfigEntry -from homeassistant.const import ( - CONF_DEVICE, - CONF_IP_ADDRESS, - CONF_PASSWORD, - CONF_USERNAME, -) from homeassistant.core import HomeAssistant -import homeassistant.helpers.config_validation as cv from homeassistant.helpers.entity import Entity from .common import ( @@ -27,24 +20,19 @@ from .common import ( GoGoGate2Entity, get_data_update_coordinator, ) -from .const import DEVICE_TYPE_GOGOGATE2, DEVICE_TYPE_ISMARTGATE, DOMAIN +from .const import DOMAIN -COVER_SCHEMA = vol.Schema( - { - vol.Required(CONF_IP_ADDRESS): cv.string, - vol.Required(CONF_DEVICE, default=DEVICE_TYPE_GOGOGATE2): vol.In( - (DEVICE_TYPE_GOGOGATE2, DEVICE_TYPE_ISMARTGATE) - ), - vol.Required(CONF_PASSWORD): cv.string, - vol.Required(CONF_USERNAME): cv.string, - } -) +_LOGGER = logging.getLogger(__name__) async def async_setup_platform( hass: HomeAssistant, config: dict, add_entities: Callable, discovery_info=None ) -> None: """Convert old style file configs to new style configs.""" + _LOGGER.warning( + "Loading gogogate2 via platform config is deprecated. The configuration" + " has been migrated to a config entry and can be safely removed." + ) hass.async_create_task( hass.config_entries.flow.async_init( DOMAIN, context={"source": SOURCE_IMPORT}, data=config