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

export const deakoDomain = 'deako';
export const deakoDefaultName = 'Deako';

export type TDeakoRawData = TSimpleLocalRawData;
export interface IDeakoSnapshot extends ISimpleLocalSnapshot {}
export interface IDeakoConfig extends ISimpleLocalConfig {}
export interface IHomeAssistantDeakoConfig extends IDeakoConfig {}

export const deakoProfile: ISimpleLocalIntegrationProfile = {
  domain: 'deako',
  displayName: 'Deako',
  manufacturer: 'Deako',
  model: 'Smart Lighting',
  defaultName: 'Deako',
  defaultProtocol: 'local',
  status: 'control-runtime',
  platforms: [
    'light',
  ],
  serviceDomains: [
    'light',
  ],
  controlServices: [
    'turn_on',
    'turn_off',
    'toggle',
    'set_level',
  ],
  discoverySources: [
    'manual',
    'mdns',
    'custom',
  ],
  discoveryKeywords: [
    'deako',
    '_deako._tcp.local',
    'dimmer',
    'light',
    'smart lighting',
  ],
  metadata: {
    source: 'home-assistant/core',
    upstreamPath: 'homeassistant/components/deako',
    upstreamDomain: 'deako',
    iotClass: 'local_polling',
    qualityScale: undefined,
    requirements: [
      'pydeako==0.6.0',
    ],
    dependencies: [
      'zeroconf',
    ],
    afterDependencies: [],
    codeowners: [
      '@sebirdman',
      '@balake',
      '@deakolights',
    ],
    configFlow: true,
    zeroconf: [
      '_deako._tcp.local.',
    ],
    runtime: {
      type: 'control-runtime',
      services: [
        'snapshot',
        'status',
        'refresh',
        'turn_on',
        'turn_off',
        'toggle',
        'set_level',
      ],
      platforms: [
        'light',
      ],
      controls: true,
    },
    localApi: {
      implemented: [
        'manual and mDNS local setup for Deako devices',
        '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',
        'cloud account flows and remote API polling',
        'device-specific Deako protocol commands not represented by snapshot/rawData/client/executor inputs',
      ],
    },
  },
};
