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

export const hpIloDomain = 'hp_ilo';
export const hpIloDefaultName = 'HP ILO';
export const hpIloDefaultPort = 443;

export type THpIloRawData = TSimpleLocalRawData;
export interface IHpIloSnapshot extends ISimpleLocalSnapshot {}
export interface IHpIloMonitoredVariable {
  name: string;
  sensorType: string;
  unitOfMeasurement?: string;
}
export interface IHpIloConfig extends ISimpleLocalConfig {
  monitoredVariables?: IHpIloMonitoredVariable[];
}
export interface IHomeAssistantHpIloConfig extends IHpIloConfig {}

export const hpIloProfile: ISimpleLocalIntegrationProfile = {
  domain: 'hp_ilo',
  displayName: 'HP Integrated Lights-Out (ILO)',
  manufacturer: 'HP',
  model: 'Integrated Lights-Out',
  defaultName: hpIloDefaultName,
  defaultPort: hpIloDefaultPort,
  defaultProtocol: 'https',
  status: 'read-only-runtime',
  platforms: [
    'sensor',
  ],
  serviceDomains: [],
  controlServices: [],
  discoverySources: [
    'manual',
    'custom',
  ],
  discoveryKeywords: [
    'hp ilo',
    'hp_ilo',
    'integrated lights-out',
    'ilo',
  ],
  metadata: {
    source: 'home-assistant/core',
    upstreamPath: 'homeassistant/components/hp_ilo',
    upstreamDomain: 'hp_ilo',
    iotClass: 'local_polling',
    qualityScale: 'legacy',
    requirements: [
      'python-hpilo==4.4.3',
    ],
    dependencies: [],
    afterDependencies: [],
    codeowners: [],
    configFlow: false,
    documentation: 'https://www.home-assistant.io/integrations/hp_ilo',
    defaults: {
      name: hpIloDefaultName,
      port: hpIloDefaultPort,
      updateIntervalSeconds: 300,
    },
    sensorTypes: {
      server_name: 'get_server_name',
      server_fqdn: 'get_server_fqdn',
      server_host_data: 'get_host_data',
      server_oa_info: 'get_oa_info',
      server_power_status: 'get_host_power_status',
      server_power_readings: 'get_power_readings',
      server_power_on_time: 'get_server_power_on_time',
      server_asset_tag: 'get_asset_tag',
      server_uid_status: 'get_uid_status',
      server_health: 'get_embedded_health',
      network_settings: 'get_network_settings',
    },
    platforms: [
      'sensor',
    ],
    runtime: {
      type: 'read-only-runtime',
      services: [
        'snapshot',
        'status',
        'refresh',
      ],
      platforms: [
        'sensor',
      ],
      controls: false,
    },
    localApi: {
      implemented: [
        'manual local setup for host, credentials, monitored variables, snapshots, raw data, snapshotProvider, and injected native clients',
        'runtime device and sensor entity mapping for HP iLO snapshot data',
        'read-only runtime status and refresh services',
      ],
      explicitUnsupported: [
        'native python-hpilo login and polling in this TypeScript package',
        'server power, UID, or hardware command writes without an injected client.execute or commandExecutor',
        'Home Assistant YAML platform value_template rendering',
      ],
    },
  },
};
