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

export const fortiosDomain = 'fortios';
export const fortiosDefaultName = 'FortiOS';

export type TFortiosRawData = TSimpleLocalRawData;
export interface IFortiosSnapshot extends ISimpleLocalSnapshot {}
export interface IFortiosConfig extends ISimpleLocalConfig {
  verifySsl?: boolean;
  vdom?: string;
}
export interface IHomeAssistantFortiosConfig extends IFortiosConfig {}

export const fortiosProfile: ISimpleLocalIntegrationProfile = {
  domain: fortiosDomain,
  displayName: 'FortiOS',
  manufacturer: 'Fortinet',
  model: 'FortiGate / FortiOS',
  defaultName: fortiosDefaultName,
  defaultPort: 443,
  defaultProtocol: 'https',
  status: 'read-only-runtime',
  platforms: [
    'binary_sensor',
    'sensor',
  ],
  serviceDomains: [
    'device_tracker',
  ],
  discoverySources: [
    'manual',
    'custom',
  ],
  discoveryKeywords: [
    'fortios',
    'fortigate',
    'fortinet',
    'device tracker',
  ],
  metadata: {
    source: 'home-assistant/core',
    upstreamPath: 'homeassistant/components/fortios',
    upstreamDomain: 'fortios',
    iotClass: 'local_polling',
    qualityScale: 'legacy',
    requirements: [
      'fortiosapi==1.0.5',
    ],
    dependencies: [],
    afterDependencies: [],
    codeowners: [
      '@kimfrellsen',
    ],
    configFlow: false,
    documentation: 'https://www.home-assistant.io/integrations/fortios',
    loggers: [
      'fortiosapi',
      'paramiko',
    ],
    platforms: [
      'device_tracker',
    ],
    defaults: {
      verifySsl: false,
      minimumVersion: '6.4.3',
      vdom: 'root',
    },
    runtime: {
      type: 'read-only-runtime',
      services: [
        'snapshot',
        'status',
        'refresh',
      ],
      platforms: [
        'device_tracker',
      ],
      controls: 'none; no FortiOS control success is reported without an injected client.execute or commandExecutor',
    },
    localApi: {
      implemented: [
        'manual local setup for FortiGate host/token metadata, snapshots, raw data, snapshotProvider, and injected native clients',
        'runtime mapping for FortiOS device tracker client snapshots as binary sensor style presence entities',
        'read-only runtime status, refresh, device, and entity projection',
      ],
      explicitUnsupported: [
        'native fortiosapi token login and monitor calls in this TypeScript package',
        'claiming live client presence without a real FortiOS client, snapshotProvider, snapshot, entities, or rawData',
        'FortiOS control operations without an injected client.execute or commandExecutor',
      ],
    },
  },
};
