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

export const devialetDomain = 'devialet';
export const devialetDefaultName = 'Devialet Speaker';

export type TDevialetRawData = TSimpleLocalRawData;
export interface IDevialetSnapshot extends ISimpleLocalSnapshot {}
export interface IDevialetConfig extends ISimpleLocalConfig {
  model?: string;
  serialNumber?: string;
  source?: string;
  soundMode?: string;
}
export interface IHomeAssistantDevialetConfig extends IDevialetConfig {}

export const devialetProfile: ISimpleLocalIntegrationProfile = {
  domain: devialetDomain,
  displayName: 'Devialet',
  manufacturer: 'Devialet',
  model: 'Phantom',
  defaultName: devialetDefaultName,
  defaultProtocol: 'http',
  status: 'read-only-runtime',
  platforms: [
    'media_player',
  ],
  serviceDomains: [
    'media_player',
  ],
  controlServices: [],
  discoverySources: [
    'manual',
    'mdns',
    'http',
    'custom',
  ],
  discoveryKeywords: [
    'devialet',
    'phantom',
    'speaker',
    '_devialet-http._tcp.local.',
  ],
  metadata: {
    source: 'home-assistant/core',
    upstreamPath: 'homeassistant/components/devialet',
    upstreamDomain: 'devialet',
    integrationType: 'device',
    iotClass: 'local_polling',
    qualityScale: undefined,
    requirements: [
      'devialet==1.5.7',
    ],
    dependencies: [],
    afterDependencies: [
      'zeroconf',
    ],
    codeowners: [
      '@fwestenberg',
    ],
    configFlow: true,
    zeroconf: [
      '_devialet-http._tcp.local.',
    ],
    runtime: {
      type: 'read-only-runtime',
      services: [
        'snapshot',
        'status',
        'refresh',
      ],
      platforms: [
        'media_player',
      ],
      controls: false,
    },
    localApi: {
      implemented: [
        'manual local endpoint setup',
        'zeroconf-compatible discovery hints',
        'snapshot, raw data, snapshotProvider, and injected native client operation',
        'media player service dispatch only through injected client.execute or commandExecutor',
      ],
      explicitUnsupported: [
        'calling Devialet HTTP control endpoints without a supplied native client',
        'claiming live media player command success without injected client.execute or commandExecutor',
      ],
    },
  },
};
