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

export const blinksticklightDomain = "blinksticklight";
export const blinksticklightDefaultName = "BlinkStick";

export type TBlinksticklightRawData = TSimpleLocalRawData;
export interface IBlinksticklightSnapshot extends ISimpleLocalSnapshot {}
export interface IBlinksticklightConfig extends ISimpleLocalConfig {}
export interface IHomeAssistantBlinksticklightConfig extends IBlinksticklightConfig {}

export const blinksticklightSampleData: TBlinksticklightRawData = {
  on: true,
  brightness: 200,
  color: 'blue',
};

export const blinksticklightProfile: ISimpleLocalIntegrationProfile = {
  domain: "blinksticklight",
  displayName: "BlinkStick",
  manufacturer: "BlinkStick",
  model: "USB light",
  defaultName: "BlinkStick",
  defaultProtocol: "local",
  status: "control-runtime",
  platforms: [
    "light",
    "sensor"
  ],
  serviceDomains: [
    "light"
  ],
  controlServices: [
    "turn_on",
    "turn_off",
    "toggle",
    "set_level"
  ],
  discoverySources: [
    "manual",
    "usb",
    "custom"
  ],
  discoveryKeywords: [
    "blinkstick",
    "light",
    "usb"
  ],
  metadata: {
    source: "home-assistant/core",
    upstreamPath: "homeassistant/components/blinksticklight",
    upstreamDomain: "blinksticklight",
    iotClass: "local_polling",
    qualityScale: "legacy",
    requirements: [
      "BlinkStick==1.2.0"
    ],
    dependencies: [],
    afterDependencies: [],
    codeowners: [],
    configFlow: true,
    sampleData: blinksticklightSampleData,
    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"
      ]
    }
  }
};
