mirror of
https://github.com/home-assistant/core.git
synced 2025-12-24 21:06:19 +00:00
Rename MQTT tag and device_automation setup helpers (#152344)
This commit is contained in:
@@ -25,7 +25,9 @@ DISCOVERY_SCHEMA = MQTT_BASE_SCHEMA.extend(
|
||||
)
|
||||
|
||||
|
||||
async def async_setup_entry(hass: HomeAssistant, config_entry: ConfigEntry) -> None:
|
||||
async def async_setup_mqtt_device_automation_entry(
|
||||
hass: HomeAssistant, config_entry: ConfigEntry
|
||||
) -> None:
|
||||
"""Set up MQTT device automation dynamically through MQTT discovery."""
|
||||
|
||||
setup = functools.partial(_async_setup_automation, hass, config_entry=config_entry)
|
||||
|
||||
@@ -53,7 +53,9 @@ DISCOVERY_SCHEMA = MQTT_BASE_SCHEMA.extend(
|
||||
)
|
||||
|
||||
|
||||
async def async_setup_entry(hass: HomeAssistant, config_entry: ConfigEntry) -> None:
|
||||
async def async_setup_mqtt_tag_entry(
|
||||
hass: HomeAssistant, config_entry: ConfigEntry
|
||||
) -> None:
|
||||
"""Set up MQTT tag scanner dynamically through MQTT discovery."""
|
||||
|
||||
setup = functools.partial(_async_setup_tag, hass, config_entry=config_entry)
|
||||
|
||||
@@ -166,13 +166,19 @@ async def async_forward_entry_setup_and_setup_discovery(
|
||||
from . import device_automation # noqa: PLC0415
|
||||
|
||||
tasks.append(
|
||||
create_eager_task(device_automation.async_setup_entry(hass, config_entry))
|
||||
create_eager_task(
|
||||
device_automation.async_setup_mqtt_device_automation_entry(
|
||||
hass, config_entry
|
||||
)
|
||||
)
|
||||
)
|
||||
if "tag" in new_platforms:
|
||||
# Local import to avoid circular dependencies
|
||||
from . import tag # noqa: PLC0415
|
||||
|
||||
tasks.append(create_eager_task(tag.async_setup_entry(hass, config_entry)))
|
||||
tasks.append(
|
||||
create_eager_task(tag.async_setup_mqtt_tag_entry(hass, config_entry))
|
||||
)
|
||||
if new_entity_platforms := (new_platforms - {"tag", "device_automation"}):
|
||||
tasks.append(
|
||||
create_eager_task(
|
||||
|
||||
Reference in New Issue
Block a user