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

export const denonRs232Domain = 'denon_rs232';
export const denonRs232DefaultName = 'Denon Receiver';

export type TDenonRs232RawData = TSimpleLocalRawData;
export interface IDenonRs232Snapshot extends ISimpleLocalSnapshot {}
export interface IDenonRs232Config extends ISimpleLocalConfig {
  device?: string;
  model?: string;
  modelName?: string;
}
export interface IHomeAssistantDenonRs232Config extends IDenonRs232Config {}

export const denonRs232Profile: ISimpleLocalIntegrationProfile = {
  domain: denonRs232Domain,
  displayName: 'Denon RS232',
  manufacturer: 'Denon',
  model: 'RS232 receiver',
  defaultName: denonRs232DefaultName,
  defaultProtocol: 'local',
  status: 'read-only-runtime',
  platforms: [
    'media_player',
  ],
  serviceDomains: [
    'media_player',
  ],
  controlServices: [],
  discoverySources: [
    'manual',
    'usb',
    'custom',
  ],
  discoveryKeywords: [
    'denon',
    'rs232',
    'receiver',
    'serial',
  ],
  metadata: {
    source: 'home-assistant/core',
    upstreamPath: 'homeassistant/components/denon_rs232',
    upstreamDomain: 'denon_rs232',
    integrationType: 'hub',
    iotClass: 'local_push',
    qualityScale: 'bronze',
    requirements: [
      'denon-rs232==4.1.0',
    ],
    dependencies: [
      'usb',
    ],
    afterDependencies: [],
    codeowners: [
      '@balloob',
    ],
    configFlow: true,
    runtime: {
      type: 'read-only-runtime',
      services: [
        'snapshot',
        'status',
        'refresh',
      ],
      platforms: [
        'media_player',
      ],
      controls: false,
    },
    localApi: {
      implemented: [
        'manual local serial endpoint metadata setup',
        'snapshot, raw data, snapshotProvider, and injected native client operation',
        'media player service dispatch only through injected client.execute or commandExecutor',
      ],
      explicitUnsupported: [
        'opening serial ports directly without a supplied native Denon RS232 client',
        'claiming live media player command success without injected client.execute or commandExecutor',
      ],
    },
  },
};
