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

export const dsmrReaderDomain = 'dsmr_reader';
export const dsmrReaderDefaultName = 'DSMR Reader';

export type TDsmrReaderRawData = TSimpleLocalRawData;
export interface IDsmrReaderSnapshot extends ISimpleLocalSnapshot {}
export interface IDsmrReaderConfig extends ISimpleLocalConfig {}
export interface IHomeAssistantDsmrReaderConfig extends IDsmrReaderConfig {}

export const dsmrReaderProfile: ISimpleLocalIntegrationProfile = {
  domain: 'dsmr_reader',
  displayName: 'DSMR Reader',
  defaultName: 'DSMR Reader',
  defaultProtocol: 'mqtt',
  status: 'read-only-runtime',
  platforms: [
    'sensor',
  ],
  serviceDomains: [],
  controlServices: [],
  discoverySources: [
    'manual',
    'mqtt',
    'custom',
  ],
  discoveryKeywords: [
    'dsmr',
    'dsmr reader',
    'smart meter',
    'mqtt',
  ],
  metadata: {
    source: 'home-assistant/core',
    upstreamPath: 'homeassistant/components/dsmr_reader',
    upstreamDomain: 'dsmr_reader',
    integrationType: 'device',
    iotClass: 'local_push',
    qualityScale: 'legacy',
    requirements: [],
    dependencies: [
      'mqtt',
    ],
    afterDependencies: [],
    codeowners: [
      '@sorted-bits',
      '@glodenox',
      '@erwindouna',
    ],
    configFlow: true,
    mqtt: [
      'dsmr/#',
    ],
    runtime: {
      type: 'read-only-runtime',
      services: [
        'snapshot',
        'status',
        'refresh',
      ],
      platforms: [
        'sensor',
      ],
      controls: false,
    },
    localApi: {
      implemented: [
        'manual local MQTT snapshot setup',
        'snapshot, raw data, snapshotProvider, and injected native client operation',
      ],
      explicitUnsupported: [
        'claiming live command success without injected client.execute or commandExecutor',
        'cloud account flows and remote API polling',
        'subscribing to live MQTT topics without an injected native client or snapshotProvider',
      ],
    },
  },
};
