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

export const twinklyDomain = "twinkly";
export const twinklyDefaultName = "Twinkly";

export type TTwinklyRawData = TSimpleLocalRawData;
export interface ITwinklySnapshot extends ISimpleLocalSnapshot {}
export interface ITwinklyConfig extends ISimpleLocalConfig {}
export interface IHomeAssistantTwinklyConfig extends ITwinklyConfig {}

export const twinklyProfile: ISimpleLocalIntegrationProfile = {
  domain: "twinkly",
  displayName: "Twinkly",
  manufacturer: "Twinkly",
  model: "LED controller",
  defaultName: "Twinkly",
  defaultPort: 80,
  defaultHttpPath: "/xled/v1/gestalt",
  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: [
    "twinkly",
    "xled"
  ],
  metadata: {
    source: "home-assistant/core",
    upstreamPath: "homeassistant/components/twinkly",
    upstreamDomain: "twinkly",
    integrationType: "device",
    iotClass: "local_polling",
    requirements: [
      "ttls==1.8.3"
    ],
    dependencies: [],
    afterDependencies: [],
    codeowners: [
      "@dr1rrb",
      "@Robbie1221",
      "@Olen"
    ],
    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"
      ]
    }
  }
};
