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

export const veluxDomain = "velux";
export const veluxDefaultName = "Velux";

export type TVeluxRawData = TSimpleLocalRawData;
export interface IVeluxSnapshot extends ISimpleLocalSnapshot {}
export interface IVeluxConfig extends ISimpleLocalConfig {}
export interface IHomeAssistantVeluxConfig extends IVeluxConfig {}

export const veluxProfile: ISimpleLocalIntegrationProfile = {
  domain: "velux",
  displayName: "Velux",
  manufacturer: "VELUX",
  model: "KLF 200",
  defaultName: "Velux",
  defaultPort: 51200,
  defaultProtocol: "tcp",
  status: "control-runtime",
  platforms: [
    "cover",
    "sensor"
  ],
  serviceDomains: [
    "cover"
  ],
  controlServices: [
    "open_cover",
    "close_cover",
    "stop_cover",
    "set_cover_position"
  ],
  discoverySources: [
    "manual",
    "mdns",
    "ssdp",
    "http",
    "custom"
  ],
  discoveryKeywords: [
    "velux",
    "klf",
    "cover"
  ],
  metadata: {
    source: "home-assistant/core",
    upstreamPath: "homeassistant/components/velux",
    upstreamDomain: "velux",
    integrationType: "hub",
    iotClass: "local_polling",
    qualityScale: "silver",
    requirements: [
      "pyvlx==0.2.33"
    ],
    dependencies: [],
    afterDependencies: [],
    codeowners: [
      "@Julius2342",
      "@pawlizio",
      "@wollew"
    ],
    configFlow: true,
    runtime: {
      type: "control-runtime",
      services: [
        "snapshot",
        "status",
        "refresh",
        "open_cover",
        "close_cover",
        "stop_cover",
        "set_cover_position"
      ],
      platforms: [
        "cover",
        "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"
      ]
    }
  }
};
