Use Platform enum in load_platform [a-l] (#63750)

This commit is contained in:
epenet 2022-01-10 10:30:47 +01:00 committed by GitHub
parent b78e22e012
commit c7cb26cbab
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
22 changed files with 87 additions and 42 deletions

View file

@ -12,6 +12,7 @@ from homeassistant.const import (
CONF_NAME,
CONF_REGION,
EVENT_HOMEASSISTANT_STOP,
Platform,
)
from homeassistant.core import HomeAssistant, ServiceCall, callback
from homeassistant.exceptions import HomeAssistantError
@ -224,10 +225,14 @@ async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
loaded = True
await hass.helpers.discovery.async_load_platform(
"binary_sensor", DOMAIN, {}, config
Platform.BINARY_SENSOR, DOMAIN, {}, config
)
await hass.helpers.discovery.async_load_platform(
Platform.STT, DOMAIN, {}, config
)
await hass.helpers.discovery.async_load_platform(
Platform.TTS, DOMAIN, {}, config
)
await hass.helpers.discovery.async_load_platform("stt", DOMAIN, {}, config)
await hass.helpers.discovery.async_load_platform("tts", DOMAIN, {}, config)
cloud.iot.register_on_connect(_on_connect)