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

export const unifiprotectDomain = "unifiprotect";
export const unifiprotectDefaultName = "UniFi Protect";

export type TUnifiprotectRawData = TSimpleLocalRawData;
export interface IUnifiprotectSnapshot extends ISimpleLocalSnapshot {}
export interface IUnifiprotectConfig extends ISimpleLocalConfig {}
export interface IHomeAssistantUnifiprotectConfig extends IUnifiprotectConfig {}

export const unifiprotectProfile: ISimpleLocalIntegrationProfile = {
  domain: "unifiprotect",
  displayName: "UniFi Protect",
  manufacturer: "Ubiquiti",
  model: "UniFi Protect NVR",
  defaultName: "UniFi Protect",
  defaultPort: 443,
  defaultHttpPath: "/proxy/protect/api/bootstrap",
  defaultProtocol: "https",
  status: "read-only-runtime",
  platforms: [
    "sensor",
    "binary_sensor"
  ],
  serviceDomains: [],
  controlServices: [],
  discoverySources: [
    "manual",
    "mdns",
    "ssdp",
    "http",
    "custom"
  ],
  discoveryKeywords: [
    "unifi",
    "protect",
    "ubiquiti"
  ],
  metadata: {
    source: "home-assistant/core",
    upstreamPath: "homeassistant/components/unifiprotect",
    upstreamDomain: "unifiprotect",
    integrationType: "hub",
    iotClass: "local_push",
    qualityScale: "platinum",
    requirements: [
      "uiprotect==10.4.1"
    ],
    dependencies: [
      "http",
      "repairs",
      "unifi_discovery"
    ],
    afterDependencies: [],
    codeowners: [
      "@RaHehl"
    ],
    configFlow: true,
    runtime: {
      type: "read-only-runtime",
      services: [
        "snapshot",
        "status",
        "refresh"
      ],
      platforms: [
        "sensor",
        "binary_sensor"
      ],
      controls: false
    },
    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"
      ]
    }
  }
};
