import type { ISimpleLocalConfig, ISimpleLocalIntegrationProfile, ISimpleLocalSnapshot, TSimpleLocalRawData } from '../../core/index.js';

export const vlcTelnetDomain = "vlc_telnet";
export const vlcTelnetDefaultName = "VLC media player via Telnet";

export type TVlcTelnetRawData = TSimpleLocalRawData;
export interface IVlcTelnetSnapshot extends ISimpleLocalSnapshot {}
export interface IVlcTelnetConfig extends ISimpleLocalConfig {}
export interface IHomeAssistantVlcTelnetConfig extends IVlcTelnetConfig {}

export const vlcTelnetProfile: ISimpleLocalIntegrationProfile = {
  domain: "vlc_telnet",
  displayName: "VLC media player via Telnet",
  manufacturer: "VideoLAN",
  model: "VLC Telnet",
  defaultName: "VLC media player via Telnet",
  defaultPort: 4212,
  defaultTcpCommand: "status",
  defaultProtocol: "telnet",
  status: "control-runtime",
  platforms: [
    "media_player",
    "sensor"
  ],
  serviceDomains: [
    "media_player"
  ],
  controlServices: [
    "turn_on",
    "turn_off",
    "volume_up",
    "volume_down",
    "volume_mute",
    "select_source",
    "media_play",
    "media_pause",
    "media_stop",
    "media_next_track",
    "media_previous_track"
  ],
  discoverySources: [
    "manual",
    "mdns",
    "ssdp",
    "http",
    "custom"
  ],
  discoveryKeywords: [
    "vlc",
    "telnet",
    "videolan"
  ],
  metadata: {
    source: "home-assistant/core",
    upstreamPath: "homeassistant/components/vlc_telnet",
    upstreamDomain: "vlc_telnet",
    integrationType: "service",
    iotClass: "local_polling",
    requirements: [
      "aiovlc==0.5.1"
    ],
    dependencies: [],
    afterDependencies: [],
    codeowners: [
      "@rodripf",
      "@MartinHjelmare"
    ],
    configFlow: true,
    runtime: {
      type: "control-runtime",
      services: [
        "snapshot",
        "status",
        "refresh",
        "turn_on",
        "turn_off",
        "volume_up",
        "volume_down",
        "volume_mute",
        "select_source",
        "media_play",
        "media_pause",
        "media_stop",
        "media_next_track",
        "media_previous_track"
      ],
      platforms: [
        "media_player",
        "sensor"
      ],
      controls: true
    },
    localApi: {
      implemented: [
        "manual local endpoint setup",
        "snapshot, raw data, snapshotProvider, and injected native client operation",
        "generic HTTP/TCP local transport when config.path, config.transport, or documented defaults are supplied"
      ],
      explicitUnsupported: [
        "claiming live command success without injected client.execute or commandExecutor",
        "cloud account flows and remote API polling",
        "device-specific protocol features not represented by snapshot/rawData/client/executor inputs"
      ]
    }
  }
};
