From 7f22cf168383dcac15d5ff2d88060cea964b90f4 Mon Sep 17 00:00:00 2001 From: Mahasri Kalavala Date: Thu, 25 Jan 2018 15:09:22 -0500 Subject: [PATCH] Update scripts.markdown --- source/_docs/scripts.markdown | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/source/_docs/scripts.markdown b/source/_docs/scripts.markdown index 930b58700c7..4c6ff1d47b0 100644 --- a/source/_docs/scripts.markdown +++ b/source/_docs/scripts.markdown @@ -116,6 +116,7 @@ wait_template: "{{ is_state(dummy, 'off') }}" This action allows you to fire an event. Events can be used for many things. It could trigger an automation or indicate to another component that something is happening. For instance, in the below example it is used to create an entry in the logbook. +{% raw %} ```yaml event: LOGBOOK_ENTRY event_data: @@ -124,12 +125,14 @@ event_data: entity_id: device_tracker.paulus domain: light ``` +{% endraw %} ### {% linkable_title Raise and Consume Custom Events %} The following automation shows how to raise a custom event called `event_light_turned_on` with `entity_id` as the event data. The action part could be inside a script or an automation. -``` +{% raw %} +```yaml - alias: Fire Event trigger: platform: state @@ -140,10 +143,11 @@ The following automation shows how to raise a custom event called `event_light_t event_data: entity_id: "{{ trigger.entity_id }}" ``` +{% endraw %} The following automation shows how to capture the custom event `event_light_turned_on`, and retrieve corresponsing `entity_id` that was passed as the event data. -``` +```yaml - alias: Capture Event trigger: platform: event