id: EXAMPLE_UNLOCK_EXPRESS
version: 2
initial_step: STEP_WAIT_UNLOCK

app_bindings:
  - id: APP_LA
    app: LA_DETECTOR
    config:
      hold_ms: 3000
      unlock_event: UNLOCK
      require_listening: true
  - id: APP_AUDIO
    app: AUDIO_PACK
  - id: APP_SCREEN
    app: SCREEN_SCENE
  - id: APP_GATE
    app: MP3_GATE

steps:
  - step_id: STEP_WAIT_UNLOCK
    screen_scene_id: SCENE_LOCKED
    audio_pack_id: ""
    actions:
      - ACTION_TRACE_STEP
    apps:
      - APP_LA
      - APP_SCREEN
      - APP_GATE
    mp3_gate_open: false
    transitions:
      - trigger: on_event
        event_type: unlock
        event_name: UNLOCK
        target_step_id: STEP_WIN
        after_ms: 0
        priority: 100

  - step_id: STEP_WIN
    screen_scene_id: SCENE_REWARD
    audio_pack_id: PACK_WIN
    actions:
      - ACTION_TRACE_STEP
    apps:
      - APP_AUDIO
      - APP_SCREEN
      - APP_GATE
    mp3_gate_open: false
    transitions:
      - trigger: on_event
        event_type: audio_done
        event_name: AUDIO_DONE
        target_step_id: STEP_DONE
        after_ms: 0
        priority: 100
      - trigger: on_event
        event_type: serial
        event_name: FORCE_DONE
        target_step_id: STEP_DONE
        after_ms: 0
        priority: 120

  - step_id: STEP_DONE
    screen_scene_id: SCENE_READY
    audio_pack_id: ""
    actions:
      - ACTION_TRACE_STEP
      - ACTION_REFRESH_SD
    apps:
      - APP_SCREEN
      - APP_GATE
    mp3_gate_open: true
    transitions: []
