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

export const ecowittDomain = 'ecowitt';
export const ecowittDefaultName = 'Ecowitt';

export type TEcowittRawData = TSimpleLocalRawData;
export interface IEcowittSnapshot extends ISimpleLocalSnapshot {}
export interface IEcowittConfig extends ISimpleLocalConfig {}
export interface IHomeAssistantEcowittConfig extends IEcowittConfig {}

export const ecowittProfile: ISimpleLocalIntegrationProfile = {
  domain: 'ecowitt',
  displayName: 'Ecowitt',
  manufacturer: 'Ecowitt',
  model: 'Weather Station',
  defaultName: 'Ecowitt',
  defaultProtocol: 'local',
  status: 'read-only-runtime',
  platforms: [
    'binary_sensor',
    'sensor',
  ],
  serviceDomains: [],
  controlServices: [],
  discoverySources: [
    'manual',
    'mdns',
    'ssdp',
    'http',
    'custom',
  ],
  discoveryKeywords: [
    'ecowitt',
    'weather',
    'station',
    'webhook',
  ],
  metadata: {
    source: 'home-assistant/core',
    upstreamPath: 'homeassistant/components/ecowitt',
    upstreamDomain: 'ecowitt',
    integrationType: 'device',
    iotClass: 'local_push',
    qualityScale: undefined,
    requirements: [
      'aioecowitt==2025.9.2',
    ],
    dependencies: [
      'webhook',
    ],
    afterDependencies: [],
    codeowners: [
      '@pvizeli',
    ],
    configFlow: true,
    runtime: {
      type: 'read-only-runtime',
      services: [
        'snapshot',
        'status',
        'refresh',
      ],
      platforms: [
        'binary_sensor',
        'sensor',
      ],
      controls: false,
    },
    localApi: {
      implemented: [
        'manual local endpoint setup',
        'snapshot, raw data, snapshotProvider, and injected native client operation',
        'local push webhook payload snapshots represented through rawData or snapshotProvider',
      ],
      explicitUnsupported: [
        'claiming live command success without injected client.execute or commandExecutor',
        'hosting the Home Assistant webhook listener inside this package runtime',
        'device-specific aioecowitt protocol features not represented by snapshot/rawData/client inputs',
      ],
    },
  },
};
