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

export const esceaDomain = 'escea';
export const esceaDefaultName = 'Escea Fireplace';

export type TEsceaRawData = TSimpleLocalRawData;
export interface IEsceaSnapshot extends ISimpleLocalSnapshot {}
export interface IEsceaConfig extends ISimpleLocalConfig {
  controllerId?: string;
  deviceUid?: string;
}
export interface IHomeAssistantEsceaConfig extends IEsceaConfig {}

export const esceaProfile: ISimpleLocalIntegrationProfile = {
  domain: esceaDomain,
  displayName: 'Escea',
  manufacturer: 'Escea',
  model: 'Escea Fireplace',
  defaultName: esceaDefaultName,
  defaultProtocol: 'local',
  status: 'control-runtime',
  platforms: [
    'climate',
  ],
  serviceDomains: [
    'climate',
  ],
  controlServices: [
    'set_temperature',
    'set_hvac_mode',
    'set_fan_mode',
    'turn_on',
    'turn_off',
  ],
  discoverySources: [
    'manual',
    'custom',
  ],
  discoveryKeywords: [
    'escea',
    'fireplace',
    'controller',
    'heater',
    'homekit',
  ],
  metadata: {
    source: 'home-assistant/core',
    upstreamPath: 'homeassistant/components/escea',
    upstreamDomain: 'escea',
    documentation: 'https://www.home-assistant.io/integrations/escea',
    integrationType: 'device',
    iotClass: 'local_push',
    qualityScale: undefined,
    requirements: [
      'pescea==1.0.12',
    ],
    dependencies: [],
    afterDependencies: [],
    codeowners: [
      '@lazdavila',
    ],
    configFlow: true,
    homekit: {
      models: [
        'Escea',
      ],
    },
    homeAssistantPlatforms: [
      'climate',
    ],
    runtime: {
      type: 'control-runtime',
      services: [
        'snapshot',
        'status',
        'refresh',
        'set_temperature',
        'set_hvac_mode',
        'set_fan_mode',
        'turn_on',
        'turn_off',
      ],
      platforms: [
        'climate',
      ],
      controls: true,
    },
    localApi: {
      implemented: [
        'manual local controller setup from discovered Escea controller metadata',
        'snapshot, raw data, snapshotProvider, and injected native client operation',
        'climate service dispatch only through injected client.execute or commandExecutor',
      ],
      explicitUnsupported: [
        'starting the pescea discovery service directly from this TypeScript runtime',
        'claiming live fireplace command success without injected client.execute or commandExecutor',
        'controller reconnection event streaming without an injected native client or snapshotProvider',
      ],
    },
  },
};
