mirror of
https://github.com/home-assistant/core.git
synced 2025-07-21 12:17:07 +00:00
Remove unused config schema & logger from totalconnect (#50604)
This commit is contained in:
parent
f33b45ec82
commit
20a39ab7e1
@ -1,8 +1,5 @@
|
|||||||
"""The totalconnect component."""
|
"""The totalconnect component."""
|
||||||
import logging
|
|
||||||
|
|
||||||
from total_connect_client import TotalConnectClient
|
from total_connect_client import TotalConnectClient
|
||||||
import voluptuous as vol
|
|
||||||
|
|
||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.const import CONF_PASSWORD, CONF_USERNAME
|
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
|
from .const import CONF_USERCODES, DOMAIN
|
||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
|
||||||
|
|
||||||
PLATFORMS = ["alarm_control_panel", "binary_sensor"]
|
PLATFORMS = ["alarm_control_panel", "binary_sensor"]
|
||||||
|
|
||||||
CONFIG_SCHEMA = vol.Schema(
|
CONFIG_SCHEMA = cv.deprecated(DOMAIN)
|
||||||
vol.All(
|
|
||||||
cv.deprecated(DOMAIN),
|
|
||||||
{
|
|
||||||
DOMAIN: vol.Schema(
|
|
||||||
{
|
|
||||||
vol.Required(CONF_USERNAME): cv.string,
|
|
||||||
vol.Required(CONF_PASSWORD): cv.string,
|
|
||||||
}
|
|
||||||
)
|
|
||||||
},
|
|
||||||
),
|
|
||||||
extra=vol.ALLOW_EXTRA,
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry):
|
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")
|
raise ConfigEntryAuthFailed("No usercodes in TotalConnect configuration")
|
||||||
|
|
||||||
temp_codes = conf[CONF_USERCODES]
|
temp_codes = conf[CONF_USERCODES]
|
||||||
usercodes = {}
|
usercodes = {int(code): temp_codes[code] for code in temp_codes}
|
||||||
for code in temp_codes:
|
|
||||||
usercodes[int(code)] = temp_codes[code]
|
|
||||||
|
|
||||||
client = await hass.async_add_executor_job(
|
client = await hass.async_add_executor_job(
|
||||||
TotalConnectClient.TotalConnectClient, username, password, usercodes
|
TotalConnectClient.TotalConnectClient, username, password, usercodes
|
||||||
)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user