Remove unused config schema & logger from totalconnect (#50604)

pull/50618/head
Franck Nijhof 2021-05-14 15:49:18 +02:00 committed by GitHub
parent f33b45ec82
commit 20a39ab7e1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 23 deletions

View File

@ -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
)