Fire event_mqtt_reloaded only after reload is completed (#74226)
This commit is contained in:
parent
1bdd93cc77
commit
f05b4a0ca0
20 changed files with 96 additions and 123 deletions
|
@ -41,8 +41,8 @@ from .mixins import (
|
|||
MQTT_ENTITY_COMMON_SCHEMA,
|
||||
MqttAvailability,
|
||||
MqttEntity,
|
||||
async_discover_yaml_entities,
|
||||
async_setup_entry_helper,
|
||||
async_setup_platform_discovery,
|
||||
async_setup_platform_helper,
|
||||
warn_for_legacy_schema,
|
||||
)
|
||||
|
@ -102,9 +102,7 @@ async def async_setup_entry(
|
|||
) -> None:
|
||||
"""Set up MQTT binary sensor through configuration.yaml and dynamically through MQTT discovery."""
|
||||
# load and initialize platform config from configuration.yaml
|
||||
config_entry.async_on_unload(
|
||||
await async_setup_platform_discovery(hass, binary_sensor.DOMAIN)
|
||||
)
|
||||
await async_discover_yaml_entities(hass, binary_sensor.DOMAIN)
|
||||
# setup for discovery
|
||||
setup = functools.partial(
|
||||
_async_setup_entity, hass, async_add_entities, config_entry=config_entry
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue