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

export const unifiAccessDomain = "unifi_access";
export const unifiAccessDefaultName = "UniFi Access";

export type TUnifiAccessRawData = TSimpleLocalRawData;
export interface IUnifiAccessSnapshot extends ISimpleLocalSnapshot {}
export interface IUnifiAccessConfig extends ISimpleLocalConfig {}
export interface IHomeAssistantUnifiAccessConfig extends IUnifiAccessConfig {}

export const unifiAccessProfile: ISimpleLocalIntegrationProfile = {
  domain: "unifi_access",
  displayName: "UniFi Access",
  manufacturer: "Ubiquiti",
  model: "UniFi Access",
  defaultName: "UniFi Access",
  defaultPort: 443,
  defaultProtocol: "https",
  status: "control-runtime",
  platforms: [
    "sensor",
    "binary_sensor",
    "switch"
  ],
  serviceDomains: [
    "switch"
  ],
  controlServices: [
    "turn_on",
    "turn_off",
    "toggle"
  ],
  discoverySources: [
    "manual",
    "mdns",
    "ssdp",
    "http",
    "custom"
  ],
  discoveryKeywords: [
    "unifi",
    "access",
    "ubiquiti",
    "door"
  ],
  metadata: {
    source: "home-assistant/core",
    upstreamPath: "homeassistant/components/unifi_access",
    upstreamDomain: "unifi_access",
    integrationType: "hub",
    iotClass: "local_push",
    qualityScale: "platinum",
    requirements: [
      "py-unifi-access==1.3.0"
    ],
    dependencies: [
      "unifi_discovery"
    ],
    afterDependencies: [],
    codeowners: [
      "@imhotep",
      "@RaHehl"
    ],
    configFlow: true,
    runtime: {
      type: "control-runtime",
      services: [
        "snapshot",
        "status",
        "refresh",
        "turn_on",
        "turn_off",
        "toggle"
      ],
      platforms: [
        "sensor",
        "binary_sensor",
        "switch"
      ],
      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"
      ]
    }
  }
};
