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

export const webostvDomain = "webostv";
export const webostvDefaultName = "LG webOS TV";

export type TWebostvRawData = TSimpleLocalRawData;
export interface IWebostvSnapshot extends ISimpleLocalSnapshot {}
export interface IWebostvConfig extends ISimpleLocalConfig {}
export interface IHomeAssistantWebostvConfig extends IWebostvConfig {}

export const webostvProfile: ISimpleLocalIntegrationProfile = {
  domain: "webostv",
  displayName: "LG webOS TV",
  manufacturer: "LG",
  model: "webOS TV",
  defaultName: "LG webOS TV",
  defaultPort: 3000,
  defaultProtocol: "websocket",
  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: [
    "lg",
    "webos",
    "tv"
  ],
  metadata: {
    source: "home-assistant/core",
    upstreamPath: "homeassistant/components/webostv",
    upstreamDomain: "webostv",
    integrationType: "device",
    iotClass: "local_push",
    qualityScale: "platinum",
    requirements: [
      "aiowebostv==0.7.5"
    ],
    dependencies: [],
    afterDependencies: [],
    codeowners: [
      "@thecode"
    ],
    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"
      ]
    }
  }
};
