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

export const leaoneDomain = "leaone";
export const leaoneDefaultName = "LeaOne";

export type TLeaoneRawData = TSimpleLocalRawData;
export interface ILeaoneSnapshot extends ISimpleLocalSnapshot {}
export interface ILeaoneConfig extends ISimpleLocalConfig {
  url?: string;
  macAddress?: string;
  deviceId?: string;
}

export const leaoneProfile: ISimpleLocalIntegrationProfile = {
  domain: leaoneDomain,
  displayName: "LeaOne",
  manufacturer: "LeaOne",
  model: "LeaOne local integration",
  defaultName: leaoneDefaultName,
  defaultProtocol: 'local',
  status: "read-only-runtime",
  platforms: [
    "sensor",
  ],
  serviceDomains: [],
  controlServices: [],
  discoverySources: [
    'manual',
    'custom',
  ],
  discoveryKeywords: [
    "leaone",
    "LeaOne",
    "Leaone",
  ],
  metadata: {
    "source": "home-assistant/core",
    "upstreamPath": "homeassistant/components/leaone",
    "upstreamDomain": "leaone",
    "integrationType": "device",
    "iotClass": "local_push",
    "requirements": [
      "leaone-ble==0.3.0",
    ],
    "dependencies": [
      "bluetooth_adapters",
    ],
    "codeowners": [
      "@bdraco",
    ],
    "configFlow": true,
    "documentation": "https://www.home-assistant.io/integrations/leaone",
    "runtime": {
      "type": "read-only-runtime",
      "services": [
        "snapshot",
        "status",
        "refresh",
      ],
      "platforms": [
        "sensor",
      ],
      "controls": false,
    },
    "localApi": {
      "status": "No native live client is implemented: Home Assistant uses leaone-ble with PassiveBluetoothProcessorCoordinator over BLE advertisements, and this repo has no BLE scanner stack or leaone-ble parser dependency.",
      "implemented": [
        "manual local setup for LeaOne endpoints, snapshots, rawData, snapshotProvider, and injected native clients",
        "runtime mapping for LeaOne device snapshots and Home Assistant platform metadata",
        "safe command delegation to injected client.execute or commandExecutor only",
      ],
      "explicitUnsupported": [
        "native LeaOne BLE scanning, advertisement parsing, pairing, subscription, and live polling because HA delegates that to the unavailable leaone-ble Python library and Bluetooth stack",
        "Home Assistant entity registry migrations and repair flows",
        "claiming command success without injected client.execute or commandExecutor",
      ],
    },
  },
};
