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

export const duotecnoDomain = 'duotecno';
export const duotecnoDefaultName = 'Duotecno';

export type TDuotecnoRawData = TSimpleLocalRawData;
export interface IDuotecnoSnapshot extends ISimpleLocalSnapshot {}
export interface IDuotecnoConfig extends ISimpleLocalConfig {}
export interface IHomeAssistantDuotecnoConfig extends IDuotecnoConfig {}

export const duotecnoProfile: ISimpleLocalIntegrationProfile = {
  domain: 'duotecno',
  displayName: 'Duotecno',
  manufacturer: 'Duotecno',
  model: 'Duotecno controller',
  defaultName: 'Duotecno',
  defaultProtocol: 'local',
  status: 'control-runtime',
  platforms: [
    'binary_sensor',
    'climate',
    'cover',
    'light',
    'switch',
  ],
  serviceDomains: [
    'climate',
    'cover',
    'light',
    'switch',
  ],
  controlServices: [
    'turn_on',
    'turn_off',
    'set_temperature',
    'set_hvac_mode',
    'set_preset_mode',
    'open_cover',
    'close_cover',
    'stop_cover',
  ],
  discoverySources: [
    'manual',
    'custom',
  ],
  discoveryKeywords: [
    'duotecno',
    'pyduotecno',
    'duoswitch',
    'dimunit',
  ],
  metadata: {
    source: 'home-assistant/core',
    upstreamPath: 'homeassistant/components/duotecno',
    upstreamDomain: 'duotecno',
    integrationType: 'hub',
    iotClass: 'local_push',
    qualityScale: 'legacy',
    requirements: [
      'pyDuotecno==2024.10.1',
    ],
    dependencies: [],
    afterDependencies: [],
    codeowners: [
      '@cereal2nd',
    ],
    configFlow: true,
    singleConfigEntry: true,
    runtime: {
      type: 'control-runtime',
      services: [
        'snapshot',
        'status',
        'refresh',
        'turn_on',
        'turn_off',
        'set_temperature',
        'set_hvac_mode',
        'set_preset_mode',
        'open_cover',
        'close_cover',
        'stop_cover',
      ],
      platforms: [
        'binary_sensor',
        'climate',
        'cover',
        'light',
        'switch',
      ],
      controls: true,
    },
    localApi: {
      implemented: [
        'manual local endpoint setup',
        'snapshot, raw data, snapshotProvider, and injected native Duotecno client operation',
      ],
      explicitUnsupported: [
        'claiming live command success without injected client.execute or commandExecutor',
        'cloud account flows and remote API polling',
        'device-specific protocol features not represented by snapshot/rawData/client/executor inputs',
      ],
    },
  },
};
