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

export const evilGeniusLabsDomain = 'evil_genius_labs';
export const evilGeniusLabsDefaultName = 'Evil Genius Labs';

export type TEvilGeniusLabsRawData = TSimpleLocalRawData;
export interface IEvilGeniusLabsSnapshot extends ISimpleLocalSnapshot {}
export interface IEvilGeniusLabsConfig extends ISimpleLocalConfig {
  host?: string;
}
export interface IHomeAssistantEvilGeniusLabsConfig extends IEvilGeniusLabsConfig {}

export const evilGeniusLabsProfile: ISimpleLocalIntegrationProfile = {
  domain: 'evil_genius_labs',
  displayName: 'Evil Genius Labs',
  manufacturer: 'Evil Genius Labs',
  model: 'Evil Genius Labs light',
  defaultName: evilGeniusLabsDefaultName,
  defaultHttpPath: '/all',
  defaultProtocol: 'http',
  status: 'control-runtime',
  platforms: [
    'light',
  ],
  serviceDomains: [
    'light',
  ],
  controlServices: [
    'turn_on',
    'turn_off',
    'toggle',
    'set_level',
    'set_value',
  ],
  discoverySources: [
    'manual',
    'http',
    'custom',
  ],
  discoveryKeywords: [
    'evil genius labs',
    'evil_genius_labs',
    'fibonacci',
    'led',
    'light',
  ],
  metadata: {
    source: 'home-assistant/core',
    upstreamPath: 'homeassistant/components/evil_genius_labs',
    upstreamDomain: 'evil_genius_labs',
    integrationType: 'device',
    iotClass: 'local_polling',
    qualityScale: undefined,
    requirements: [
      'pyevilgenius==2.0.0',
    ],
    dependencies: [],
    afterDependencies: [],
    codeowners: [],
    configFlow: true,
    runtime: {
      type: 'control-runtime',
      services: [
        'snapshot',
        'status',
        'refresh',
        'turn_on',
        'turn_off',
        'toggle',
        'set_level',
        'set_value',
      ],
      platforms: [
        'light',
      ],
      controls: true,
    },
    localApi: {
      implemented: [
        'manual local HTTP setup for Evil Genius Labs /all snapshots',
        'snapshot, raw data, snapshotProvider, and injected native client operation',
        'delegated light control through injected client.execute or commandExecutor',
      ],
      explicitUnsupported: [
        'claiming live light command success without injected client.execute or commandExecutor',
        'device info and product enrichment beyond /all without an injected snapshot or client',
        'cloud account flows and remote API polling',
      ],
    },
  },
};
