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

export const wledDomain = "wled";
export const wledDefaultName = "WLED";

export type TWledRawData = TSimpleLocalRawData;
export interface IWledSnapshot extends ISimpleLocalSnapshot {}
export interface IWledConfig extends ISimpleLocalConfig {}
export interface IHomeAssistantWledConfig extends IWledConfig {}

export const wledProfile: ISimpleLocalIntegrationProfile = {
  domain: "wled",
  displayName: "WLED",
  manufacturer: "WLED",
  model: "WLED controller",
  defaultName: "WLED",
  defaultPort: 80,
  defaultHttpPath: "/json",
  defaultProtocol: "http",
  status: "control-runtime",
  platforms: [
    "light",
    "sensor"
  ],
  serviceDomains: [
    "light"
  ],
  controlServices: [
    "turn_on",
    "turn_off",
    "toggle",
    "set_level"
  ],
  discoverySources: [
    "manual",
    "mdns",
    "ssdp",
    "http",
    "custom"
  ],
  discoveryKeywords: [
    "wled",
    "esp8266",
    "esp32"
  ],
  metadata: {
    source: "home-assistant/core",
    upstreamPath: "homeassistant/components/wled",
    upstreamDomain: "wled",
    integrationType: "device",
    iotClass: "local_push",
    qualityScale: "platinum",
    requirements: [
      "wled==0.22.0"
    ],
    dependencies: [],
    afterDependencies: [],
    codeowners: [
      "@frenck",
      "@mik-laj"
    ],
    configFlow: true,
    runtime: {
      type: "control-runtime",
      services: [
        "snapshot",
        "status",
        "refresh",
        "turn_on",
        "turn_off",
        "toggle",
        "set_level"
      ],
      platforms: [
        "light",
        "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"
      ]
    }
  }
};
