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

export const nmapTrackerDomain = "nmap_tracker";
export const nmapTrackerDefaultName = "Nmap Tracker";

export type TNmapTrackerRawData = TSimpleLocalRawData;
export interface INmapTrackerSnapshot extends ISimpleLocalSnapshot {}
export interface INmapTrackerConfig extends ISimpleLocalConfig {
  url?: string;
  macAddress?: string;
  deviceId?: string;
}
export interface IHomeAssistantNmapTrackerConfig extends INmapTrackerConfig {}

export const nmapTrackerProfile: ISimpleLocalIntegrationProfile = {
  domain: nmapTrackerDomain,
  displayName: "Nmap Tracker",
  manufacturer: "Nmap Tracker",
  model: "Nmap Tracker local integration",
  defaultName: nmapTrackerDefaultName,
  defaultProtocol: 'local',
  status: "read-only-runtime",
  platforms: [
    "sensor",
  ],
  serviceDomains: [],
  controlServices: [],
  discoverySources: [
    'manual',
    'custom',
  ],
  discoveryKeywords: [
    "nmap_tracker",
    "Nmap Tracker",
    "Nmap",
    "Tracker",
  ],
  metadata: {
    "source": "home-assistant/core",
    "upstreamPath": "homeassistant/components/nmap_tracker",
    "upstreamDomain": "nmap_tracker",
    "iotClass": "local_polling",
    "requirements": [
      "netmap==0.7.0.2",
      "getmac==0.9.5",
      "aiooui==0.1.9",
    ],
    "dependencies": [
      "network",
    ],
    "configFlow": true,
    "documentation": "https://www.home-assistant.io/integrations/nmap_tracker",
    "loggers": [
      "nmap",
    ],
    "runtime": {
      "type": "read-only-runtime",
      "services": [
        "snapshot",
        "status",
        "refresh",
      ],
      "platforms": [
        "sensor",
      ],
      "controls": false,
    },
    "localApi": {
      "status": "native live scanning is unsupported: HA uses netmap/python-nmap to invoke the external nmap scanner plus getmac/aiooui MAC/OUI helpers, not an implementable HTTP/TCP/TLS/file protocol",
      "implemented": [
        "manual local setup for Nmap Tracker snapshots, rawData, snapshotProvider, and injected native clients",
        "runtime mapping for Nmap Tracker device snapshots and Home Assistant platform metadata",
        "safe snapshot/injected-client behavior only",
      ],
      "explicitUnsupported": [
        "native live network scanning because HA depends on netmap/python-nmap invoking the external nmap scanner rather than a local HTTP/TCP/TLS/file protocol",
        "MAC fallback/vendor behavior because HA depends on getmac and aiooui data/helpers that are unavailable in the existing TypeScript dependency set",
        "UDP/ARP/privileged host discovery semantics and nmap command-line option compatibility",
        "Home Assistant entity registry migrations and repair flows",
      ],
    },
  },
};
