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

export const edimaxDomain = 'edimax';
export const edimaxDefaultName = 'Edimax Smart Plug';

export type TEdimaxRawData = TSimpleLocalRawData;
export interface IEdimaxSnapshot extends ISimpleLocalSnapshot {}
export interface IEdimaxConfig extends ISimpleLocalConfig {}
export interface IHomeAssistantEdimaxConfig extends IEdimaxConfig {}

export const edimaxProfile: ISimpleLocalIntegrationProfile = {
  domain: 'edimax',
  displayName: 'Edimax',
  manufacturer: 'Edimax',
  model: 'Smart Plug',
  defaultName: edimaxDefaultName,
  defaultProtocol: 'http',
  status: 'control-runtime',
  platforms: [
    'switch',
  ],
  serviceDomains: [
    'switch',
  ],
  controlServices: [
    'turn_on',
    'turn_off',
    'toggle',
  ],
  discoverySources: [
    'manual',
    'mdns',
    'ssdp',
    'http',
    'custom',
  ],
  discoveryKeywords: [
    'edimax',
    'smart plug',
    'switch',
  ],
  metadata: {
    source: 'home-assistant/core',
    upstreamPath: 'homeassistant/components/edimax',
    upstreamDomain: 'edimax',
    iotClass: 'local_polling',
    qualityScale: 'legacy',
    requirements: [
      'pyedimax==0.2.1',
    ],
    dependencies: [],
    afterDependencies: [],
    codeowners: [],
    configFlow: false,
    runtime: {
      type: 'control-runtime',
      services: [
        'snapshot',
        'status',
        'refresh',
        'turn_on',
        'turn_off',
        'toggle',
      ],
      platforms: [
        'switch',
      ],
      controls: true,
    },
    localApi: {
      implemented: [
        'manual local host and credential setup',
        'snapshot, raw data, snapshotProvider, and injected native client operation',
        'Edimax switch state snapshot mapping and commandExecutor-backed switch control',
      ],
      explicitUnsupported: [
        'claiming live switch command success without injected client.execute or commandExecutor',
        'direct pyedimax SmartPlug protocol operation without an injected native client',
        'cloud account flows and remote API polling',
      ],
    },
  },
};
