input_select:
  richie_status:
    name: "Richie Status"
    options:
      - Available
      - Busy
      - Do Not Disturb
    icon: mdi:account
    initial: Available

  maple_status:
    name: "Maple Status"
    options:
      - Available
      - Busy
      - Do Not Disturb
    icon: mdi:account
    initial: Available

template:
  - sensor:
      - name: "Richie Status Icon"
        state: >
          {{ states('input_select.richie_status') }}
        icon: >
          {% set status = states('input_select.richie_status') %}
          {% if status == 'Available' %}mdi:circle
          {% elif status == 'Busy' %}mdi:circle-half-full
          {% else %}mdi:minus-circle{% endif %}

      - name: "Maple Status Icon"
        state: >
          {{ states('input_select.maple_status') }}
        icon: >
          {% set status = states('input_select.maple_status') %}
          {% if status == 'Available' %}mdi:circle
          {% elif status == 'Busy' %}mdi:circle-half-full
          {% else %}mdi:minus-circle{% endif %}

script:
  # Richie
  set_richie_available:
    alias: "Richie → Available"
    icon: mdi:circle
    sequence:
      - service: input_select.select_option
        target:
          entity_id: input_select.richie_status
        data:
          option: "Available"

  set_richie_busy:
    alias: "Richie → Busy"
    icon: mdi:circle-half-full
    sequence:
      - service: input_select.select_option
        target:
          entity_id: input_select.richie_status
        data:
          option: "Busy"

  set_richie_dnd:
    alias: "Richie → Do Not Disturb"
    icon: mdi:minus-circle
    sequence:
      - service: input_select.select_option
        target:
          entity_id: input_select.richie_status
        data:
          option: "Do Not Disturb"

  cycle_richie_status:
    alias: "Cycle Richie Status"
    icon: mdi:account-switch
    sequence:
      - service: input_select.select_option
        target:
          entity_id: input_select.richie_status
        data:
          option: >
            {% set current = states('input_select.richie_status') %}
            {% if current == 'Available' %}Busy
            {% elif current == 'Busy' %}Do Not Disturb
            {% else %}Available{% endif %}

  # Maple
  set_maple_available:
    alias: "Maple → Available"
    icon: mdi:circle
    sequence:
      - service: input_select.select_option
        target:
          entity_id: input_select.maple_status
        data:
          option: "Available"

  set_maple_busy:
    alias: "Maple → Busy"
    icon: mdi:circle-half-full
    sequence:
      - service: input_select.select_option
        target:
          entity_id: input_select.maple_status
        data:
          option: "Busy"

  set_maple_dnd:
    alias: "Maple → Do Not Disturb"
    icon: mdi:minus-circle
    sequence:
      - service: input_select.select_option
        target:
          entity_id: input_select.maple_status
        data:
          option: "Do Not Disturb"

  cycle_maple_status:
    alias: "Cycle Maple Status"
    icon: mdi:account-switch
    sequence:
      - service: input_select.select_option
        target:
          entity_id: input_select.maple_status
        data:
          option: >
            {% set current = states('input_select.maple_status') %}
            {% if current == 'Available' %}Busy
            {% elif current == 'Busy' %}Do Not Disturb
            {% else %}Available{% endif %}
