Add config reloaded events for automation and scene (#34664)
This commit is contained in:
1 parent
07469127ce
commit
1883b1d2a2
4 files changed
+22
-1
No files matched your search
@@ -61,6 +61,8 @@ CONDITION_TYPE_OR = "or"
|
||||
DEFAULT_CONDITION_TYPE = CONDITION_TYPE_AND
|
||||
DEFAULT_INITIAL_STATE = True
|
||||
|
||||
EVENT_AUTOMATION_RELOADED = "automation_reloaded"
|
||||
|
||||
ATTR_LAST_TRIGGERED = "last_triggered"
|
||||
ATTR_VARIABLES = "variables"
|
||||
SERVICE_TRIGGER = "trigger"
|
||||
@@ -214,6 +216,7 @@ async def async_setup(hass, config):
|
||||
if conf is None:
|
||||
return
|
||||
await _async_process_config(hass, conf, component)
|
||||
hass.bus.async_fire(EVENT_AUTOMATION_RELOADED, context=service_call.context)
|
||||
|
||||
async_register_admin_service(
|
||||
hass, DOMAIN, SERVICE_RELOAD, reload_service_handler, schema=vol.Schema({})
|
||||
|
||||
@@ -75,6 +75,7 @@ def _ensure_no_intersection(value):
|
||||
CONF_SCENE_ID = "scene_id"
|
||||
CONF_SNAPSHOT = "snapshot_entities"
|
||||
DATA_PLATFORM = "homeassistant_scene"
|
||||
EVENT_SCENE_RELOADED = "scene_reloaded"
|
||||
STATES_SCHEMA = vol.All(dict, _convert_states)
|
||||
|
||||
|
||||
@@ -182,6 +183,8 @@ async def async_setup_platform(hass, config, async_add_entities, discovery_info=
|
||||
|
||||
_process_scenes_config(hass, async_add_entities, p_config)
|
||||
|
||||
hass.bus.async_fire(EVENT_SCENE_RELOADED, context=call.context)
|
||||
|
||||
hass.helpers.service.async_register_admin_service(
|
||||
SCENE_DOMAIN, SERVICE_RELOAD, reload_config
|
||||
)
|
||||
|
||||
Reference in new issue
Block a user