i2s_audio:
  i2s_lrclk_pin: 13
  i2s_bclk_pin: 14
  i2s_mclk_pin: 15

speaker:
  - platform: i2s_audio
    id: test_speaker
    i2s_dout_pin: 18
    dac_type: external

media_player:
  - platform: speaker
    name: None
    speaker: test_speaker
    on_state:
      - media_player.play:
      - media_player.play_media: http://localhost/media.mp3
      - media_player.play_media: !lambda 'return "http://localhost/media.mp3";'
    on_idle:
      - media_player.pause:
    on_play:
      - media_player.stop:
      - media_player.stop:
          announcement: true
    on_announcement:
      - media_player.play:
    on_turn_on:
      - media_player.play:
    on_turn_off:
      - media_player.stop:
    on_pause:
      - media_player.toggle:
      - media_player.turn_on:
      - media_player.turn_off:
      - media_player.next:
      - media_player.previous:
      - media_player.mute:
      - media_player.unmute:
      - media_player.repeat_off:
      - media_player.repeat_one:
      - media_player.repeat_all:
      - media_player.shuffle:
      - media_player.unshuffle:
      - media_player.group_join:
      - media_player.clear_playlist:
      - wait_until:
          media_player.is_idle:
      - wait_until:
          media_player.is_playing:
      - wait_until:
          media_player.is_announcing:
      - wait_until:
          media_player.is_paused:
      - wait_until:
          media_player.is_on:
      - wait_until:
          media_player.is_off:
      - wait_until:
          media_player.is_muted:
      - media_player.volume_up:
      - media_player.volume_down:
      - media_player.volume_set: 50%
      - media_player.enqueue: http://localhost/media.mp3
      - media_player.enqueue: !lambda 'return "http://localhost/media.mp3";'
      - media_player.enqueue:
          media_url: http://localhost/media.mp3
          announcement: true
