# Describes the format for available media player services

turn_on:
  target:
    entity:
      domain: media_player
      supported_features:
        - media_player.MediaPlayerEntityFeature.TURN_ON

turn_off:
  target:
    entity:
      domain: media_player
      supported_features:
        - media_player.MediaPlayerEntityFeature.TURN_OFF

toggle:
  target:
    entity:
      domain: media_player
      supported_features:
        - - media_player.MediaPlayerEntityFeature.TURN_OFF
          - media_player.MediaPlayerEntityFeature.TURN_ON

volume_up:
  target:
    entity:
      domain: media_player
      supported_features:
        - media_player.MediaPlayerEntityFeature.VOLUME_SET
        - media_player.MediaPlayerEntityFeature.VOLUME_STEP

volume_down:
  target:
    entity:
      domain: media_player
      supported_features:
        - media_player.MediaPlayerEntityFeature.VOLUME_SET
        - media_player.MediaPlayerEntityFeature.VOLUME_STEP

volume_mute:
  target:
    entity:
      domain: media_player
      supported_features:
        - media_player.MediaPlayerEntityFeature.VOLUME_MUTE
  fields:
    is_volume_muted:
      required: true
      selector:
        boolean:

volume_set:
  target:
    entity:
      domain: media_player
      supported_features:
        - media_player.MediaPlayerEntityFeature.VOLUME_SET
  fields:
    volume_level:
      required: true
      selector:
        number:
          min: 0
          max: 1
          step: 0.01

media_play_pause:
  target:
    entity:
      domain: media_player
      supported_features:
        - - media_player.MediaPlayerEntityFeature.PAUSE
          - media_player.MediaPlayerEntityFeature.PLAY

media_play:
  target:
    entity:
      domain: media_player
      supported_features:
        - media_player.MediaPlayerEntityFeature.PLAY

media_pause:
  target:
    entity:
      domain: media_player
      supported_features:
        - media_player.MediaPlayerEntityFeature.PAUSE

media_stop:
  target:
    entity:
      domain: media_player
      supported_features:
        - media_player.MediaPlayerEntityFeature.STOP

media_next_track:
  target:
    entity:
      domain: media_player
      supported_features:
        - media_player.MediaPlayerEntityFeature.NEXT_TRACK

media_previous_track:
  target:
    entity:
      domain: media_player
      supported_features:
        - media_player.MediaPlayerEntityFeature.PREVIOUS_TRACK

media_seek:
  target:
    entity:
      domain: media_player
      supported_features:
        - media_player.MediaPlayerEntityFeature.SEEK
  fields:
    seek_position:
      required: true
      selector:
        number:
          min: 0
          max: 9223372036854775807
          step: 0.01
          mode: box

play_media:
  target:
    entity:
      domain: media_player
      supported_features:
        - media_player.MediaPlayerEntityFeature.PLAY_MEDIA
  fields:
    media_content_id:
      required: true
      example: "https://home-assistant.io/images/cast/splash.png"
      selector:
        text:

    media_content_type:
      required: true
      example: "music"
      selector:
        text:

    enqueue:
      filter:
        supported_features:
          - media_player.MediaPlayerEntityFeature.MEDIA_ENQUEUE
      required: false
      selector:
        select:
          options:
            - "play"
            - "next"
            - "add"
            - "replace"
          translation_key: enqueue
    announce:
      filter:
        supported_features:
          - media_player.MediaPlayerEntityFeature.MEDIA_ANNOUNCE
      required: false
      example: "true"
      selector:
        boolean:

browse_media:
  target:
    entity:
      domain: media_player
  fields:
    media_content_type:
      required: false
      example: "music"
      selector:
        text:
    media_content_id:
      required: false
      example: "A:ALBUMARTIST/Beatles"
      selector:
        text:

select_source:
  target:
    entity:
      domain: media_player
      supported_features:
        - media_player.MediaPlayerEntityFeature.SELECT_SOURCE
  fields:
    source:
      required: true
      example: "video1"
      selector:
        text:

select_sound_mode:
  target:
    entity:
      domain: media_player
      supported_features:
        - media_player.MediaPlayerEntityFeature.SELECT_SOUND_MODE
  fields:
    sound_mode:
      example: "Music"
      selector:
        text:

clear_playlist:
  target:
    entity:
      domain: media_player
      supported_features:
        - media_player.MediaPlayerEntityFeature.CLEAR_PLAYLIST

shuffle_set:
  target:
    entity:
      domain: media_player
      supported_features:
        - media_player.MediaPlayerEntityFeature.SHUFFLE_SET
  fields:
    shuffle:
      required: true
      selector:
        boolean:

repeat_set:
  target:
    entity:
      domain: media_player
      supported_features:
        - media_player.MediaPlayerEntityFeature.REPEAT_SET
  fields:
    repeat:
      required: true
      selector:
        select:
          options:
            - "off"
            - "all"
            - "one"
          translation_key: repeat
join:
  target:
    entity:
      domain: media_player
      supported_features:
        - media_player.MediaPlayerEntityFeature.GROUPING
  fields:
    group_members:
      required: true
      example: |
        - media_player.multiroom_player2
        - media_player.multiroom_player3
      selector:
        entity:
          multiple: true
          domain: media_player

unjoin:
  target:
    entity:
      domain: media_player
      supported_features:
        - media_player.MediaPlayerEntityFeature.GROUPING
