diff --git a/gallery/src/data/traces/basic_trace.ts b/gallery/src/data/traces/basic_trace.ts index 2038166544..6375b7ff5c 100644 --- a/gallery/src/data/traces/basic_trace.ts +++ b/gallery/src/data/traces/basic_trace.ts @@ -2,13 +2,14 @@ import { DemoTrace } from "./types"; export const basicTrace: DemoTrace = { trace: { - last_action: "action/0", + automation_id: "1615419646544", + last_action: "action/0/choose/0/sequence/0", last_condition: "condition/0", run_id: "0", state: "stopped", timestamp: { - start: "2021-03-12T21:38:48.050464+00:00", - finish: "2021-03-12T21:38:48.068458+00:00", + start: "2021-03-22T19:17:09.519178+00:00", + finish: "2021-03-22T19:17:09.556129+00:00", }, trigger: "state of input_boolean.toggle_1", unique_id: "1615419646544", @@ -16,7 +17,7 @@ export const basicTrace: DemoTrace = { "action/0": [ { path: "action/0", - timestamp: "2021-03-12T21:38:48.054395+00:00", + timestamp: "2021-03-22T19:17:09.526794+00:00", changed_variables: { trigger: { platform: "state", @@ -24,11 +25,14 @@ export const basicTrace: DemoTrace = { from_state: { entity_id: "input_boolean.toggle_1", state: "on", - attributes: { editable: true, friendly_name: "Toggle 1" }, - last_changed: "2021-03-12T21:38:03.262985+00:00", - last_updated: "2021-03-12T21:38:03.262985+00:00", + attributes: { + editable: true, + friendly_name: "Toggle 1", + }, + last_changed: "2021-03-22T19:11:24.418709+00:00", + last_updated: "2021-03-22T19:11:24.418709+00:00", context: { - id: "4ad34793b237d7cb5e541e8a331e7bf9", + id: "55daa6c47a7613b0800fe0ec81090a84", parent_id: null, user_id: null, }, @@ -36,11 +40,14 @@ export const basicTrace: DemoTrace = { to_state: { entity_id: "input_boolean.toggle_1", state: "off", - attributes: { editable: true, friendly_name: "Toggle 1" }, - last_changed: "2021-03-12T21:38:48.049816+00:00", - last_updated: "2021-03-12T21:38:48.049816+00:00", + attributes: { + editable: true, + friendly_name: "Toggle 1", + }, + last_changed: "2021-03-22T19:17:09.516874+00:00", + last_updated: "2021-03-22T19:17:09.516874+00:00", context: { - id: "2d83ca81663c85df51fae2a1f940d0e7", + id: "116d7a6562d594b114f7efe728619a3f", parent_id: null, user_id: "d1b4e89da01445fa8bc98e39fac477ca", }, @@ -50,11 +57,50 @@ export const basicTrace: DemoTrace = { description: "state of input_boolean.toggle_1", }, context: { - id: "febeaa3d50152bae8017d783ed3c0751", - parent_id: "2d83ca81663c85df51fae2a1f940d0e7", + id: "54a7371cff31be0f4010c9fde2317322", + parent_id: "116d7a6562d594b114f7efe728619a3f", user_id: null, }, }, + result: { + choice: 0, + }, + }, + ], + "action/0/choose/0": [ + { + path: "action/0/choose/0", + timestamp: "2021-03-22T19:17:09.530176+00:00", + result: { + result: true, + }, + }, + ], + "action/0/choose/0/conditions/0": [ + { + path: "action/0/choose/0/conditions/0", + timestamp: "2021-03-22T19:17:09.539155+00:00", + result: { + result: true, + }, + }, + ], + "action/0/choose/0/sequence/0": [ + { + path: "action/0/choose/0/sequence/0", + timestamp: "2021-03-22T19:17:09.542769+00:00", + result: { + params: { + domain: "input_boolean", + service: "toggle", + service_data: {}, + target: { + entity_id: ["input_boolean.toggle_2"], + }, + }, + running_script: false, + limit: 10, + }, }, ], }, @@ -62,7 +108,7 @@ export const basicTrace: DemoTrace = { "condition/0": [ { path: "condition/0", - timestamp: "2021-03-12T21:38:48.050783+00:00", + timestamp: "2021-03-22T19:17:09.520267+00:00", changed_variables: { trigger: { platform: "state", @@ -70,11 +116,14 @@ export const basicTrace: DemoTrace = { from_state: { entity_id: "input_boolean.toggle_1", state: "on", - attributes: { editable: true, friendly_name: "Toggle 1" }, - last_changed: "2021-03-12T21:38:03.262985+00:00", - last_updated: "2021-03-12T21:38:03.262985+00:00", + attributes: { + editable: true, + friendly_name: "Toggle 1", + }, + last_changed: "2021-03-22T19:11:24.418709+00:00", + last_updated: "2021-03-22T19:11:24.418709+00:00", context: { - id: "4ad34793b237d7cb5e541e8a331e7bf9", + id: "55daa6c47a7613b0800fe0ec81090a84", parent_id: null, user_id: null, }, @@ -82,11 +131,14 @@ export const basicTrace: DemoTrace = { to_state: { entity_id: "input_boolean.toggle_1", state: "off", - attributes: { editable: true, friendly_name: "Toggle 1" }, - last_changed: "2021-03-12T21:38:48.049816+00:00", - last_updated: "2021-03-12T21:38:48.049816+00:00", + attributes: { + editable: true, + friendly_name: "Toggle 1", + }, + last_changed: "2021-03-22T19:17:09.516874+00:00", + last_updated: "2021-03-22T19:17:09.516874+00:00", context: { - id: "2d83ca81663c85df51fae2a1f940d0e7", + id: "116d7a6562d594b114f7efe728619a3f", parent_id: null, user_id: "d1b4e89da01445fa8bc98e39fac477ca", }, @@ -96,15 +148,22 @@ export const basicTrace: DemoTrace = { description: "state of input_boolean.toggle_1", }, }, - result: { result: true }, + result: { + result: true, + }, }, ], }, config: { id: "1615419646544", - alias: "Basic Trace Example", + alias: "Ensure Party mode", description: "", - trigger: [{ platform: "state", entity_id: "input_boolean.toggle_1" }], + trigger: [ + { + platform: "state", + entity_id: "input_boolean.toggle_1", + }, + ], condition: [ { condition: "template", @@ -114,16 +173,37 @@ export const basicTrace: DemoTrace = { ], action: [ { - service: "input_boolean.toggle", - alias: "Enable party mode", - target: { entity_id: "input_boolean.toggle_2" }, + choose: [ + { + alias: "If toggle 3 is on", + conditions: "{{ is_state('input_boolean.toggle_3', 'on') }}", + sequence: [ + { + service: "input_boolean.toggle", + alias: "Toggle 2 while 3 is on", + target: { + entity_id: "input_boolean.toggle_2", + }, + }, + ], + }, + ], + default: [ + { + service: "input_boolean.toggle", + alias: "Toggle 2", + target: { + entity_id: "input_boolean.toggle_2", + }, + }, + ], }, ], mode: "single", }, context: { - id: "febeaa3d50152bae8017d783ed3c0751", - parent_id: "2d83ca81663c85df51fae2a1f940d0e7", + id: "54a7371cff31be0f4010c9fde2317322", + parent_id: "116d7a6562d594b114f7efe728619a3f", user_id: null, }, variables: { @@ -133,11 +213,14 @@ export const basicTrace: DemoTrace = { from_state: { entity_id: "input_boolean.toggle_1", state: "on", - attributes: { editable: true, friendly_name: "Toggle 1" }, - last_changed: "2021-03-12T21:38:03.262985+00:00", - last_updated: "2021-03-12T21:38:03.262985+00:00", + attributes: { + editable: true, + friendly_name: "Toggle 1", + }, + last_changed: "2021-03-22T19:11:24.418709+00:00", + last_updated: "2021-03-22T19:11:24.418709+00:00", context: { - id: "4ad34793b237d7cb5e541e8a331e7bf9", + id: "55daa6c47a7613b0800fe0ec81090a84", parent_id: null, user_id: null, }, @@ -145,11 +228,14 @@ export const basicTrace: DemoTrace = { to_state: { entity_id: "input_boolean.toggle_1", state: "off", - attributes: { editable: true, friendly_name: "Toggle 1" }, - last_changed: "2021-03-12T21:38:48.049816+00:00", - last_updated: "2021-03-12T21:38:48.049816+00:00", + attributes: { + editable: true, + friendly_name: "Toggle 1", + }, + last_changed: "2021-03-22T19:17:09.516874+00:00", + last_updated: "2021-03-22T19:17:09.516874+00:00", context: { - id: "2d83ca81663c85df51fae2a1f940d0e7", + id: "116d7a6562d594b114f7efe728619a3f", parent_id: null, user_id: "d1b4e89da01445fa8bc98e39fac477ca", }, @@ -166,13 +252,14 @@ export const basicTrace: DemoTrace = { message: "has been triggered by state of input_boolean.toggle_1", source: "state of input_boolean.toggle_1", entity_id: "automation.toggle_toggles", - when: "2021-03-12T21:38:48.051460+00:00", + context_id: "54a7371cff31be0f4010c9fde2317322", + when: "2021-03-22T19:17:09.523041+00:00", domain: "automation", }, { - when: "2021-03-12T21:38:48.064184+00:00", + when: "2021-03-22T19:17:09.549346+00:00", name: "Toggle 2", - state: "off", + state: "on", entity_id: "input_boolean.toggle_2", context_entity_id: "automation.toggle_toggles", context_entity_id_name: "Ensure Party mode",