diff --git a/homeassistant/components/totalconnect/__init__.py b/homeassistant/components/totalconnect/__init__.py index c122de310dd..7026abc34f9 100644 --- a/homeassistant/components/totalconnect/__init__.py +++ b/homeassistant/components/totalconnect/__init__.py @@ -1,8 +1,5 @@ """The totalconnect component.""" -import logging - from total_connect_client import TotalConnectClient -import voluptuous as vol from homeassistant.config_entries import ConfigEntry from homeassistant.const import CONF_PASSWORD, CONF_USERNAME @@ -12,24 +9,9 @@ import homeassistant.helpers.config_validation as cv from .const import CONF_USERCODES, DOMAIN -_LOGGER = logging.getLogger(__name__) - PLATFORMS = ["alarm_control_panel", "binary_sensor"] -CONFIG_SCHEMA = vol.Schema( - vol.All( - cv.deprecated(DOMAIN), - { - DOMAIN: vol.Schema( - { - vol.Required(CONF_USERNAME): cv.string, - vol.Required(CONF_PASSWORD): cv.string, - } - ) - }, - ), - extra=vol.ALLOW_EXTRA, -) +CONFIG_SCHEMA = cv.deprecated(DOMAIN) async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry): @@ -43,10 +25,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry): raise ConfigEntryAuthFailed("No usercodes in TotalConnect configuration") temp_codes = conf[CONF_USERCODES] - usercodes = {} - for code in temp_codes: - usercodes[int(code)] = temp_codes[code] - + usercodes = {int(code): temp_codes[code] for code in temp_codes} client = await hass.async_add_executor_job( TotalConnectClient.TotalConnectClient, username, password, usercodes )