Add support for automation description (#26662)
* Add support for automation annotation * Rename annotation to description
This commit is contained in:
parent
c17057de4b
commit
10572a62b1
2 changed files with 3 additions and 1 deletions
|
@ -43,6 +43,7 @@ ENTITY_ID_FORMAT = DOMAIN + ".{}"
|
||||||
GROUP_NAME_ALL_AUTOMATIONS = "all automations"
|
GROUP_NAME_ALL_AUTOMATIONS = "all automations"
|
||||||
|
|
||||||
CONF_ALIAS = "alias"
|
CONF_ALIAS = "alias"
|
||||||
|
CONF_DESCRIPTION = "description"
|
||||||
CONF_HIDE_ENTITY = "hide_entity"
|
CONF_HIDE_ENTITY = "hide_entity"
|
||||||
|
|
||||||
CONF_CONDITION = "condition"
|
CONF_CONDITION = "condition"
|
||||||
|
@ -95,6 +96,7 @@ PLATFORM_SCHEMA = vol.Schema(
|
||||||
# str on purpose
|
# str on purpose
|
||||||
CONF_ID: str,
|
CONF_ID: str,
|
||||||
CONF_ALIAS: cv.string,
|
CONF_ALIAS: cv.string,
|
||||||
|
vol.Optional(CONF_DESCRIPTION): cv.string,
|
||||||
vol.Optional(CONF_INITIAL_STATE): cv.boolean,
|
vol.Optional(CONF_INITIAL_STATE): cv.boolean,
|
||||||
vol.Optional(CONF_HIDE_ENTITY, default=DEFAULT_HIDE_ENTITY): cv.boolean,
|
vol.Optional(CONF_HIDE_ENTITY, default=DEFAULT_HIDE_ENTITY): cv.boolean,
|
||||||
vol.Required(CONF_TRIGGER): _TRIGGER_SCHEMA,
|
vol.Required(CONF_TRIGGER): _TRIGGER_SCHEMA,
|
||||||
|
|
|
@ -53,7 +53,7 @@ class EditAutomationConfigView(EditIdBasedConfigView):
|
||||||
|
|
||||||
# Iterate through some keys that we want to have ordered in the output
|
# Iterate through some keys that we want to have ordered in the output
|
||||||
updated_value = OrderedDict()
|
updated_value = OrderedDict()
|
||||||
for key in ("id", "alias", "trigger", "condition", "action"):
|
for key in ("id", "alias", "description", "trigger", "condition", "action"):
|
||||||
if key in cur_value:
|
if key in cur_value:
|
||||||
updated_value[key] = cur_value[key]
|
updated_value[key] = cur_value[key]
|
||||||
if key in new_value:
|
if key in new_value:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue