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

export const danfossAirDomain = 'danfoss_air';
export const danfossAirDefaultName = 'Danfoss Air';

export type TDanfossAirRawData = TSimpleLocalRawData;
export interface IDanfossAirSnapshot extends ISimpleLocalSnapshot {}
export interface IDanfossAirConfig extends ISimpleLocalConfig {}
export interface IHomeAssistantDanfossAirConfig extends IDanfossAirConfig {}

export const danfossAirProfile: ISimpleLocalIntegrationProfile = {
  domain: 'danfoss_air',
  displayName: 'Danfoss Air',
  manufacturer: 'Danfoss',
  model: 'Air CCM',
  defaultName: 'Danfoss Air',
  defaultProtocol: 'local',
  status: 'control-runtime',
  platforms: [
    'binary_sensor',
    'sensor',
    'switch',
  ],
  serviceDomains: [
    'switch',
  ],
  controlServices: [
    'turn_on',
    'turn_off',
    'toggle',
  ],
  discoverySources: [
    'manual',
    'custom',
  ],
  discoveryKeywords: [
    'danfoss',
    'danfoss air',
    'air ccm',
    'hrv',
    'ventilation',
  ],
  metadata: {
    source: 'home-assistant/core',
    upstreamPath: 'homeassistant/components/danfoss_air',
    upstreamDomain: 'danfoss_air',
    iotClass: 'local_polling',
    qualityScale: 'legacy',
    requirements: [
      'pydanfossair==0.1.0',
    ],
    dependencies: [],
    afterDependencies: [],
    codeowners: [],
    configFlow: false,
    runtime: {
      type: 'control-runtime',
      services: [
        'snapshot',
        'status',
        'refresh',
        'turn_on',
        'turn_off',
        'toggle',
      ],
      platforms: [
        'binary_sensor',
        'sensor',
        'switch',
      ],
      controls: true,
    },
    localApi: {
      implemented: [
        'manual local host setup for Danfoss Air CCM units',
        'snapshot, raw data, snapshotProvider, and injected native client operation',
        'delegated switch control through injected client.execute or commandExecutor',
      ],
      explicitUnsupported: [
        'claiming live switch command success without injected client.execute or commandExecutor',
        'cloud account flows and remote API polling',
        'device-specific Danfoss protocol commands not represented by snapshot/rawData/client/executor inputs',
      ],
    },
  },
};
