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

export const tplinkOmadaDomain = "tplink_omada";
export const tplinkOmadaDefaultName = "TP-Link Omada";

export type TTplinkOmadaRawData = TSimpleLocalRawData;
export interface ITplinkOmadaSnapshot extends ISimpleLocalSnapshot {}
export interface ITplinkOmadaConfig extends ISimpleLocalConfig {}
export interface IHomeAssistantTplinkOmadaConfig extends ITplinkOmadaConfig {}

export const tplinkOmadaProfile: ISimpleLocalIntegrationProfile = {
  domain: "tplink_omada",
  displayName: "TP-Link Omada",
  manufacturer: "TP-Link",
  model: "Omada controller",
  defaultName: "TP-Link Omada",
  defaultPort: 8043,
  defaultProtocol: "https",
  status: "control-runtime",
  platforms: [
    "sensor",
    "switch",
    "binary_sensor"
  ],
  serviceDomains: [
    "switch"
  ],
  controlServices: [
    "turn_on",
    "turn_off",
    "toggle"
  ],
  discoverySources: [
    "manual",
    "mdns",
    "ssdp",
    "http",
    "custom"
  ],
  discoveryKeywords: [
    "tp-link",
    "tplink",
    "omada"
  ],
  metadata: {
    source: "home-assistant/core",
    upstreamPath: "homeassistant/components/tplink_omada",
    upstreamDomain: "tplink_omada",
    integrationType: "hub",
    iotClass: "local_polling",
    qualityScale: "bronze",
    requirements: [
      "tplink-omada-client==1.5.7"
    ],
    dependencies: [],
    afterDependencies: [],
    codeowners: [
      "@MarkGodwin"
    ],
    configFlow: true,
    runtime: {
      type: "control-runtime",
      services: [
        "snapshot",
        "status",
        "refresh",
        "turn_on",
        "turn_off",
        "toggle"
      ],
      platforms: [
        "sensor",
        "switch",
        "binary_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"
      ]
    }
  }
};
