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

export const fingDomain = 'fing';
export const fingDefaultName = 'Fing';

export type TFingRawData = TSimpleLocalRawData;
export interface IFingSnapshot extends ISimpleLocalSnapshot {}
export interface IFingConfig extends ISimpleLocalConfig {
  ipAddress?: string;
  apiKey?: string;
  upnpAvailable?: boolean;
}
export interface IHomeAssistantFingConfig extends IFingConfig {}

export const fingProfile: ISimpleLocalIntegrationProfile = {
  domain: 'fing',
  displayName: 'Fing',
  manufacturer: 'Fing',
  model: 'Fing Agent',
  defaultName: fingDefaultName,
  defaultPort: 49090,
  defaultProtocol: 'http',
  status: 'read-only-runtime',
  platforms: [
    'binary_sensor',
  ],
  serviceDomains: [],
  controlServices: [],
  discoverySources: [
    'manual',
    'http',
    'custom',
  ],
  discoveryKeywords: [
    'fing',
    'fing agent',
    'network inventory',
    'device tracker',
  ],
  metadata: {
    source: 'home-assistant/core',
    upstreamPath: 'homeassistant/components/fing',
    upstreamDomain: 'fing',
    integrationType: 'service',
    iotClass: 'local_polling',
    qualityScale: 'bronze',
    qualityScaleRulesPath: 'homeassistant/components/fing/quality_scale.yaml',
    requirements: [
      'fing_agent_api==1.1.0',
    ],
    dependencies: [],
    afterDependencies: [],
    codeowners: [
      '@Lorenzo-Gasparini',
    ],
    configFlow: true,
    documentation: 'https://www.home-assistant.io/integrations/fing',
    homeAssistantPlatforms: [
      'device_tracker',
    ],
    runtime: {
      type: 'read-only-runtime',
      services: [
        'snapshot',
        'status',
        'refresh',
      ],
      platforms: [
        'binary_sensor',
      ],
      controls: false,
    },
    localApi: {
      implemented: [
        'manual local setup for Fing Agent host, port, API key, snapshots, raw data, snapshotProvider, and injected native clients',
        'generic HTTP local transport when config.path points at a Fing Agent JSON endpoint',
      ],
      explicitUnsupported: [
        'claiming live command success without injected client.execute or commandExecutor',
        'direct fing_agent_api polling when no local path, injected client, snapshotProvider, snapshot, entities, or rawData is supplied',
        'UPnP agent-info probing without an injected native client',
      ],
    },
  },
};
