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

export const devoloHomeControlDomain = 'devolo_home_control';
export const devoloHomeControlDefaultName = 'devolo Home Control';

export type TDevoloHomeControlRawData = TSimpleLocalRawData;
export interface IDevoloHomeControlSnapshot extends ISimpleLocalSnapshot {}
export interface IDevoloHomeControlConfig extends ISimpleLocalConfig {
  gatewayId?: string;
  gatewayIds?: string[];
}
export interface IHomeAssistantDevoloHomeControlConfig extends IDevoloHomeControlConfig {}

export const devoloHomeControlProfile: ISimpleLocalIntegrationProfile = {
  domain: devoloHomeControlDomain,
  displayName: 'devolo Home Control',
  manufacturer: 'devolo',
  model: 'Home Control Central Unit',
  defaultName: devoloHomeControlDefaultName,
  defaultProtocol: 'local',
  status: 'read-only-runtime',
  platforms: [
    'binary_sensor',
    'climate',
    'cover',
    'light',
    'sensor',
    'switch',
  ],
  serviceDomains: [
    'climate',
    'cover',
    'light',
    'siren',
    'switch',
  ],
  controlServices: [],
  discoverySources: [
    'manual',
    'mdns',
    'custom',
  ],
  discoveryKeywords: [
    'devolo',
    'home control',
    'homecontrol',
    'gateway',
    '2600',
    '2601',
    '_dvl-deviceapi._tcp.local.',
  ],
  metadata: {
    source: 'home-assistant/core',
    upstreamPath: 'homeassistant/components/devolo_home_control',
    upstreamDomain: 'devolo_home_control',
    integrationType: 'hub',
    iotClass: 'local_push',
    qualityScale: 'silver',
    requirements: [
      'devolo-home-control-api==0.19.0',
    ],
    dependencies: [],
    afterDependencies: [
      'zeroconf',
    ],
    codeowners: [
      '@2Fake',
      '@Shutgun',
    ],
    configFlow: true,
    zeroconf: [
      '_dvl-deviceapi._tcp.local.',
    ],
    supportedModelTypes: [
      '2600',
      '2601',
    ],
    runtime: {
      type: 'read-only-runtime',
      services: [
        'snapshot',
        'status',
        'refresh',
      ],
      platforms: [
        'binary_sensor',
        'climate',
        'cover',
        'light',
        'sensor',
        'siren',
        'switch',
      ],
      controls: false,
    },
    localApi: {
      implemented: [
        'manual local gateway metadata setup',
        'zeroconf-compatible discovery hints for devolo gateways',
        'snapshot, raw data, snapshotProvider, and injected native client operation',
        'entity service dispatch only through injected client.execute or commandExecutor',
      ],
      explicitUnsupported: [
        'mydevolo cloud account authentication flow',
        'opening devolo Home Control websocket sessions without a supplied native client',
        'claiming live entity command success without injected client.execute or commandExecutor',
      ],
    },
  },
};
