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

export const ecoalBoilerDomain = 'ecoal_boiler';
export const ecoalBoilerDefaultName = 'eSterownik eCoal.pl Boiler';

export type TEcoalBoilerRawData = TSimpleLocalRawData;
export interface IEcoalBoilerSnapshot extends ISimpleLocalSnapshot {}
export interface IEcoalBoilerConfig extends ISimpleLocalConfig {}
export interface IHomeAssistantEcoalBoilerConfig extends IEcoalBoilerConfig {}

export const ecoalBoilerProfile: ISimpleLocalIntegrationProfile = {
  domain: 'ecoal_boiler',
  displayName: 'eSterownik eCoal.pl Boiler',
  manufacturer: 'eSterownik',
  model: 'eCoal.pl Boiler',
  defaultName: 'eSterownik eCoal.pl Boiler',
  defaultProtocol: 'local',
  status: 'control-runtime',
  platforms: [
    'sensor',
    'switch',
  ],
  serviceDomains: [
    'switch',
  ],
  controlServices: [
    'turn_on',
    'turn_off',
  ],
  discoverySources: [
    'manual',
    'mdns',
    'ssdp',
    'http',
    'custom',
  ],
  discoveryKeywords: [
    'esterownik',
    'ecoal',
    'ecoal.pl',
    'boiler',
    'coal',
    'wood',
  ],
  metadata: {
    source: 'home-assistant/core',
    upstreamPath: 'homeassistant/components/ecoal_boiler',
    upstreamDomain: 'ecoal_boiler',
    iotClass: 'local_polling',
    qualityScale: 'legacy',
    requirements: [
      'ecoaliface==0.4.0',
    ],
    dependencies: [],
    afterDependencies: [],
    codeowners: [],
    configFlow: false,
    runtime: {
      type: 'control-runtime',
      services: [
        'snapshot',
        'status',
        'refresh',
        'turn_on',
        'turn_off',
      ],
      platforms: [
        'sensor',
        'switch',
      ],
      controls: true,
    },
    localApi: {
      implemented: [
        'manual local endpoint setup',
        'snapshot, raw data, snapshotProvider, and injected native client operation',
        'control service dispatch only through injected client.execute or commandExecutor',
      ],
      explicitUnsupported: [
        'claiming live command success without injected client.execute or commandExecutor',
        'cloud account flows and remote API polling',
        'device-specific ecoaliface protocol features not represented by snapshot/rawData/client/executor inputs',
      ],
    },
  },
};
