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

export const transmissionDomain = "transmission";
export const transmissionDefaultName = "Transmission";

export type TTransmissionRawData = TSimpleLocalRawData;
export interface ITransmissionSnapshot extends ISimpleLocalSnapshot {}
export interface ITransmissionConfig extends ISimpleLocalConfig {}
export interface IHomeAssistantTransmissionConfig extends ITransmissionConfig {}

export const transmissionProfile: ISimpleLocalIntegrationProfile = {
  domain: "transmission",
  displayName: "Transmission",
  manufacturer: "Transmission",
  model: "RPC daemon",
  defaultName: "Transmission",
  defaultPort: 9091,
  defaultHttpPath: "/transmission/rpc",
  defaultProtocol: "http",
  status: "control-runtime",
  platforms: [
    "sensor",
    "switch"
  ],
  serviceDomains: [
    "switch"
  ],
  controlServices: [
    "turn_on",
    "turn_off",
    "toggle"
  ],
  discoverySources: [
    "manual",
    "mdns",
    "ssdp",
    "http",
    "custom"
  ],
  discoveryKeywords: [
    "transmission",
    "torrent",
    "rpc"
  ],
  metadata: {
    source: "home-assistant/core",
    upstreamPath: "homeassistant/components/transmission",
    upstreamDomain: "transmission",
    integrationType: "service",
    iotClass: "local_polling",
    qualityScale: "bronze",
    requirements: [
      "transmission-rpc==7.0.3"
    ],
    dependencies: [],
    afterDependencies: [],
    codeowners: [
      "@engrbm87",
      "@JPHutchins",
      "@andrew-codechimp"
    ],
    configFlow: true,
    runtime: {
      type: "control-runtime",
      services: [
        "snapshot",
        "status",
        "refresh",
        "turn_on",
        "turn_off",
        "toggle"
      ],
      platforms: [
        "sensor",
        "switch"
      ],
      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"
      ]
    }
  }
};
