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

export const emulatedRokuDomain = 'emulated_roku';
export const emulatedRokuDefaultName = 'Home Assistant';

export type TEmulatedRokuRawData = TSimpleLocalRawData;
export interface IEmulatedRokuSnapshot extends ISimpleLocalSnapshot {}
export interface IEmulatedRokuConfig extends ISimpleLocalConfig {
  listenPort?: number;
  advertiseIp?: string;
  advertisePort?: number;
  upnpBindMulticast?: boolean;
}
export interface IHomeAssistantEmulatedRokuConfig extends IEmulatedRokuConfig {}

export const emulatedRokuProfile: ISimpleLocalIntegrationProfile = {
  domain: 'emulated_roku',
  displayName: 'Emulated Roku',
  manufacturer: 'Home Assistant',
  model: 'Roku API Emulator',
  defaultName: emulatedRokuDefaultName,
  defaultPort: 8060,
  defaultProtocol: 'upnp',
  status: 'read-only-runtime',
  platforms: [
    'sensor',
  ],
  serviceDomains: [],
  controlServices: [],
  discoverySources: [
    'manual',
    'ssdp',
    'custom',
  ],
  discoveryKeywords: [
    'emulated roku',
    'roku',
    'upnp',
    'remote',
    'roku_command',
  ],
  metadata: {
    source: 'home-assistant/core',
    upstreamPath: 'homeassistant/components/emulated_roku',
    upstreamDomain: 'emulated_roku',
    iotClass: 'local_push',
    qualityScale: undefined,
    requirements: [
      'emulated-roku==0.3.0',
    ],
    dependencies: [
      'network',
    ],
    afterDependencies: [],
    codeowners: [],
    configFlow: true,
    runtime: {
      type: 'read-only-runtime',
      services: [
        'snapshot',
        'status',
        'refresh',
      ],
      platforms: [
        'sensor',
      ],
      controls: false,
    },
    localApi: {
      implemented: [
        'manual local setup for configured Emulated Roku server snapshots',
        'snapshot, raw data, snapshotProvider, and injected native client operation',
      ],
      explicitUnsupported: [
        'claiming live Emulated Roku server startup, SSDP advertisement, or HTTP endpoint binding without an injected native client',
        'claiming live command success without injected client.execute or commandExecutor',
      ],
    },
  },
};
