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

export const ebusdDomain = 'ebusd';
export const ebusdDefaultName = 'ebusd';

export type TEbusdRawData = TSimpleLocalRawData;
export interface IEbusdSnapshot extends ISimpleLocalSnapshot {}
export interface IEbusdConfig extends ISimpleLocalConfig {}
export interface IHomeAssistantEbusdConfig extends IEbusdConfig {}

export const ebusdProfile: ISimpleLocalIntegrationProfile = {
  domain: 'ebusd',
  displayName: 'ebusd',
  manufacturer: 'ebusd',
  model: 'eBUS daemon',
  defaultName: 'ebusd',
  defaultPort: 8888,
  defaultProtocol: 'tcp',
  status: 'control-runtime',
  platforms: [
    'sensor',
  ],
  serviceDomains: [],
  controlServices: [
    'write',
    'ebusd_write',
  ],
  discoverySources: [
    'manual',
    'custom',
  ],
  discoveryKeywords: [
    'ebusd',
    'ebus',
    'heating',
    'boiler',
  ],
  metadata: {
    source: 'home-assistant/core',
    upstreamPath: 'homeassistant/components/ebusd',
    upstreamDomain: 'ebusd',
    iotClass: 'local_polling',
    qualityScale: 'legacy',
    requirements: [
      'ebusdpy==0.0.17',
    ],
    dependencies: [],
    afterDependencies: [],
    codeowners: [],
    configFlow: false,
    runtime: {
      type: 'control-runtime',
      services: [
        'snapshot',
        'status',
        'refresh',
        'write',
        'ebusd_write',
      ],
      platforms: [
        'sensor',
      ],
      controls: true,
    },
    localApi: {
      implemented: [
        'manual local daemon setup on TCP port 8888',
        'snapshot, raw data, snapshotProvider, and injected native client operation',
        'executor-routed ebusd write service when client.execute or commandExecutor is supplied',
      ],
      explicitUnsupported: [
        'claiming live ebusd write success without injected client.execute or commandExecutor',
        'direct ebusdpy protocol reads/writes without an injected native client',
        'legacy YAML monitored-condition validation beyond supplied snapshot/rawData/client inputs',
      ],
    },
  },
};
