%YAML 1.2
---
# Describe some mutually-exclusive conditions where the first match will be
# evaluated as opposed to parallel conditions where potentially multiple
# conditional blocks may be executed
#
# We start the process by unconditionally emitting a signal for part of the
# checked states below
emit:
    signal: lock_state
    value: true

# the first condition clause to be met will be executed to the exclusion of the
# others
exclusive:
    # If the vehicle is locked and we unlock it, signal to unlock
    - condition: >
        lock_state == true &&
        remote_key.command == 'unlock'

      emit:
          signal: lock_state
          value: false

    # If the vehicle is locked and we further lock it, honk the horn to give a
    # clear indicator it is indeed locked
    - condition: >
        lock_state == true &&
        remote_key.command == 'lock'

      emit:
          signal: horn
          value: true

Add config file for complex feature: exclusive conditions
Add config file for complex feature: exclusive conditions
