Use Platform enum in load_platform [a-l] (#63750)
This commit is contained in:
parent
b78e22e012
commit
c7cb26cbab
22 changed files with 87 additions and 42 deletions
|
@ -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)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue