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

export const ecoforestDomain = 'ecoforest';
export const ecoforestDefaultName = 'Ecoforest';

export type TEcoforestRawData = TSimpleLocalRawData;
export interface IEcoforestSnapshot extends ISimpleLocalSnapshot {}
export interface IEcoforestConfig extends ISimpleLocalConfig {}
export interface IHomeAssistantEcoforestConfig extends IEcoforestConfig {}

export const ecoforestProfile: ISimpleLocalIntegrationProfile = {
  domain: 'ecoforest',
  displayName: 'Ecoforest',
  manufacturer: 'Ecoforest',
  model: 'Ecoforest device',
  defaultName: 'Ecoforest',
  defaultProtocol: 'local',
  status: 'control-runtime',
  platforms: [
    'number',
    'sensor',
    'switch',
  ],
  serviceDomains: [
    'number',
    'switch',
  ],
  controlServices: [
    'set_value',
    'turn_on',
    'turn_off',
  ],
  discoverySources: [
    'manual',
    'mdns',
    'ssdp',
    'http',
    'custom',
  ],
  discoveryKeywords: [
    'ecoforest',
    'pellet',
    'stove',
    'boiler',
  ],
  metadata: {
    source: 'home-assistant/core',
    upstreamPath: 'homeassistant/components/ecoforest',
    upstreamDomain: 'ecoforest',
    integrationType: 'device',
    iotClass: 'local_polling',
    qualityScale: undefined,
    requirements: [
      'pyecoforest==0.4.0',
    ],
    dependencies: [],
    afterDependencies: [],
    codeowners: [
      '@pjanuario',
    ],
    configFlow: true,
    runtime: {
      type: 'control-runtime',
      services: [
        'snapshot',
        'status',
        'refresh',
        'set_value',
        'turn_on',
        'turn_off',
      ],
      platforms: [
        'number',
        '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 pyecoforest protocol features not represented by snapshot/rawData/client/executor inputs',
      ],
    },
  },
};
