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

export const medcomBleDomain = "medcom_ble";
export const medcomBleDefaultName = "Medcom Bluetooth";

export type TMedcomBleRawData = TSimpleLocalRawData;
export interface IMedcomBleSnapshot extends ISimpleLocalSnapshot {}
export interface IMedcomBleConfig extends ISimpleLocalConfig {
  url?: string;
  macAddress?: string;
  deviceId?: string;
}

export const medcomBleProfile: ISimpleLocalIntegrationProfile = {
  domain: medcomBleDomain,
  displayName: "Medcom Bluetooth",
  manufacturer: "Medcom Bluetooth",
  model: "Medcom Bluetooth local integration",
  defaultName: medcomBleDefaultName,
  defaultProtocol: 'local',
  status: "read-only-runtime",
  platforms: [
    "sensor",
  ],
  serviceDomains: [],
  controlServices: [],
  discoverySources: [
    'manual',
    'custom',
  ],
  discoveryKeywords: [
    "medcom_ble",
    "Medcom Bluetooth",
    "Medcom Ble",
    "Medcom",
    "Bluetooth",
  ],
  metadata: {
    "source": "home-assistant/core",
    "upstreamPath": "homeassistant/components/medcom_ble",
    "upstreamDomain": "medcom_ble",
    "integrationType": "device",
    "iotClass": "local_polling",
    "requirements": [
      "medcom-ble==0.1.1",
    ],
    "dependencies": [
      "bluetooth_adapters",
    ],
    "codeowners": [
      "@elafargue",
    ],
    "configFlow": true,
    "documentation": "https://www.home-assistant.io/integrations/medcom_ble",
    "runtime": {
      "type": "read-only-runtime",
      "services": [
        "snapshot",
        "status",
        "refresh",
      ],
      "platforms": [
        "sensor",
      ],
      "controls": false,
    },
    "localApi": {
      "implemented": [
        "manual snapshot/rawData/entities setup for Medcom Bluetooth readings",
        "snapshotProvider and injected native client snapshot/getRawData support",
        "runtime mapping for supplied Medcom Bluetooth device snapshots and Home Assistant sensor metadata",
      ],
      "explicitUnsupported": [
        "native BLE discovery, pairing, GATT reads, and notification polling for service UUID 39b31fec-b63a-4ef7-b163-a7317872007f because the Home Assistant path depends on bleak/bleak-retry-connector and no BLE stack is available in this TypeScript package",
        "claiming host/url HTTP, TCP, TLS, or file polling for Medcom BLE; the Home Assistant source and medcom-ble library expose only BLE characteristics and notifications",
        "Home Assistant entity registry migrations and repair flows",
        "claiming command/write success; this integration is read-only BLE telemetry in Home Assistant",
      ],
    },
  },
};
