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

export const veraDomain = "vera";
export const veraDefaultName = "Vera";

export type TVeraRawData = TSimpleLocalRawData;
export interface IVeraSnapshot extends ISimpleLocalSnapshot {}
export interface IVeraConfig extends ISimpleLocalConfig {}
export interface IHomeAssistantVeraConfig extends IVeraConfig {}

export const veraProfile: ISimpleLocalIntegrationProfile = {
  domain: "vera",
  displayName: "Vera",
  manufacturer: "Vera Control",
  model: "Vera controller",
  defaultName: "Vera",
  defaultPort: 3480,
  defaultHttpPath: "/data_request?id=sdata",
  defaultProtocol: "http",
  status: "control-runtime",
  platforms: [
    "switch",
    "sensor",
    "light",
    "cover"
  ],
  serviceDomains: [
    "switch",
    "light",
    "cover"
  ],
  controlServices: [
    "turn_on",
    "turn_off",
    "toggle",
    "turn_on",
    "turn_off",
    "toggle",
    "set_level",
    "open_cover",
    "close_cover",
    "stop_cover"
  ],
  discoverySources: [
    "manual",
    "mdns",
    "ssdp",
    "http",
    "custom"
  ],
  discoveryKeywords: [
    "vera",
    "mi casa verde",
    "mios"
  ],
  metadata: {
    source: "home-assistant/core",
    upstreamPath: "homeassistant/components/vera",
    upstreamDomain: "vera",
    integrationType: "hub",
    iotClass: "local_polling",
    requirements: [
      "pyvera==0.3.16"
    ],
    dependencies: [],
    afterDependencies: [],
    codeowners: [],
    configFlow: true,
    runtime: {
      type: "control-runtime",
      services: [
        "snapshot",
        "status",
        "refresh",
        "turn_on",
        "turn_off",
        "toggle",
        "set_level",
        "open_cover",
        "close_cover",
        "stop_cover"
      ],
      platforms: [
        "switch",
        "sensor",
        "light",
        "cover"
      ],
      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"
      ]
    }
  }
};
