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

export const earnEP1Domain = 'earn_e_p1';
export const earnEP1DefaultName = 'EARN-E P1 Meter';

export type TEarnEP1RawData = TSimpleLocalRawData;
export interface IEarnEP1Snapshot extends ISimpleLocalSnapshot {}
export interface IEarnEP1Config extends ISimpleLocalConfig {}
export interface IHomeAssistantEarnEP1Config extends IEarnEP1Config {}

export const earnEP1Profile: ISimpleLocalIntegrationProfile = {
  domain: 'earn_e_p1',
  displayName: 'EARN-E P1 Meter',
  manufacturer: 'EARN-E',
  model: 'P1 Meter',
  defaultName: 'EARN-E P1 Meter',
  defaultProtocol: 'local',
  status: 'read-only-runtime',
  platforms: [
    'sensor',
  ],
  serviceDomains: [],
  controlServices: [],
  discoverySources: [
    'manual',
    'custom',
  ],
  discoveryKeywords: [
    'earn-e',
    'earn_e_p1',
    'p1',
    'meter',
  ],
  metadata: {
    source: 'home-assistant/core',
    upstreamPath: 'homeassistant/components/earn_e_p1',
    upstreamDomain: 'earn_e_p1',
    integrationType: 'device',
    iotClass: 'local_push',
    qualityScale: 'bronze',
    requirements: [
      'earn-e-p1==0.1.0',
    ],
    dependencies: [],
    afterDependencies: [],
    codeowners: [
      '@Miggets7',
    ],
    configFlow: true,
    runtime: {
      type: 'read-only-runtime',
      services: [
        'snapshot',
        'status',
        'refresh',
      ],
      platforms: [
        'sensor',
      ],
      controls: false,
    },
    localApi: {
      implemented: [
        'manual local host setup for UDP push data sources',
        'snapshot, raw data, snapshotProvider, and injected native client operation',
        'read-only sensor mapping for EARN-E P1 meter values',
      ],
      explicitUnsupported: [
        'claiming live command success without injected client.execute or commandExecutor',
        'starting or owning the Python earn_e_p1 UDP listener',
        'automatic UDP validation waits without an injected client or snapshotProvider',
      ],
    },
  },
};
