{ lib, ... }:

{
  services.homeAssistantConfig = {

    group.view_overview.entities = [
        "media_player.mpd"
    ];

    media_player = [
      {
        platform = "mpd";
        host = "localhost";
      }
    ];

    script.turn_all_off.sequence = [
      {
        alias = "turn mpd off";
        service = "media_player.turn_off";
        data.entity_id = "media_player.mpd";
      }
    ];

    script.turn_all_on.sequence = [
      {
        alias = "turn mpd on";
        service = "media_player.turn_on";
        data.entity_id = "media_player.mpd";
      }
      {
        alias = "Adjust volume";
        service = "media_player.volume_set";
        data = {
          entity_id = "media_player.mpd";
          volume_level = "0.90";
        };
      }
    ];

  };

}