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

export const eheimdigitalDomain = 'eheimdigital';
export const eheimdigitalDefaultName = 'EHEIM Digital';

export type TEheimdigitalRawData = TSimpleLocalRawData;
export interface IEheimdigitalSnapshot extends ISimpleLocalSnapshot {}
export interface IEheimdigitalConfig extends ISimpleLocalConfig {}
export interface IHomeAssistantEheimdigitalConfig extends IEheimdigitalConfig {}

export const eheimdigitalProfile: ISimpleLocalIntegrationProfile = {
  domain: 'eheimdigital',
  displayName: 'EHEIM Digital',
  manufacturer: 'EHEIM',
  model: 'EHEIM Digital Hub',
  defaultName: 'EHEIM Digital',
  defaultProtocol: 'http',
  status: 'control-runtime',
  platforms: [
    'binary_sensor',
    'climate',
    'light',
    'number',
    'select',
    'sensor',
    'switch',
  ],
  serviceDomains: [
    'climate',
    'light',
    'number',
    'select',
    'switch',
    'time',
  ],
  controlServices: [
    'turn_on',
    'turn_off',
    'toggle',
    'set_value',
    'set_temperature',
    'set_hvac_mode',
    'set_preset_mode',
    'select_option',
  ],
  discoverySources: [
    'manual',
    'mdns',
    'custom',
  ],
  discoveryKeywords: [
    'eheim',
    'eheimdigital',
    'aquarium',
    'filter',
    'heater',
  ],
  metadata: {
    source: 'home-assistant/core',
    upstreamPath: 'homeassistant/components/eheimdigital',
    upstreamDomain: 'eheimdigital',
    documentation: 'https://www.home-assistant.io/integrations/eheimdigital',
    integrationType: 'hub',
    iotClass: 'local_polling',
    qualityScale: 'platinum',
    requirements: [
      'eheimdigital==1.6.0',
    ],
    dependencies: [],
    afterDependencies: [],
    codeowners: [
      '@autinerd',
    ],
    configFlow: true,
    loggers: [
      'eheimdigital',
    ],
    zeroconf: [
      { name: 'eheimdigital._http._tcp.local.', type: '_http._tcp.local.' },
    ],
    homeAssistantPlatforms: [
      'binary_sensor',
      'climate',
      'light',
      'number',
      'select',
      'sensor',
      'switch',
      'time',
    ],
    runtime: {
      type: 'control-runtime',
      services: [
        'snapshot',
        'status',
        'refresh',
        'turn_on',
        'turn_off',
        'toggle',
        'set_value',
        'set_temperature',
        'set_hvac_mode',
        'set_preset_mode',
        'select_option',
      ],
      platforms: [
        'binary_sensor',
        'climate',
        'light',
        'number',
        'select',
        'sensor',
        'switch',
        'time',
      ],
      controls: true,
    },
    localApi: {
      implemented: [
        'manual local endpoint setup',
        'zeroconf candidate normalization for eheimdigital._http._tcp.local.',
        'snapshot, raw data, snapshotProvider, and injected native client operation',
        'writable entity services only through injected client.execute or commandExecutor',
      ],
      explicitUnsupported: [
        'claiming live command success without injected client.execute or commandExecutor',
        'direct eheimdigital hub protocol control without an injected native client',
        'device-specific protocol features not represented by snapshot/rawData/client/executor inputs',
      ],
    },
  },
};
