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

export const mopekaDomain = "mopeka";
export const mopekaDefaultName = "Mopeka";

export type TMopekaRawData = TSimpleLocalRawData;
export interface IMopekaSnapshot extends ISimpleLocalSnapshot {}
export interface IMopekaConfig extends ISimpleLocalConfig {
  url?: string;
  macAddress?: string;
  deviceId?: string;
}
export interface IHomeAssistantMopekaConfig extends IMopekaConfig {}

export const mopekaProfile: ISimpleLocalIntegrationProfile = {
  domain: mopekaDomain,
  displayName: "Mopeka",
  manufacturer: "Mopeka",
  model: "Mopeka local integration",
  defaultName: mopekaDefaultName,
  defaultProtocol: 'local',
  status: "read-only-runtime",
  platforms: [
    "sensor",
  ],
  serviceDomains: [],
  controlServices: [],
  discoverySources: [
    'manual',
    'custom',
  ],
  discoveryKeywords: [
    "mopeka",
    "Mopeka",
  ],
  metadata: {
    "source": "home-assistant/core",
    "upstreamPath": "homeassistant/components/mopeka",
    "upstreamDomain": "mopeka",
    "integrationType": "device",
    "iotClass": "local_push",
    "requirements": [
      "mopeka-iot-ble==0.8.0",
    ],
    "dependencies": [
      "bluetooth_adapters",
    ],
    "codeowners": [
      "@bdraco",
    ],
    "configFlow": true,
    "documentation": "https://www.home-assistant.io/integrations/mopeka",
    "runtime": {
      "type": "read-only-runtime",
      "services": [
        "snapshot",
        "status",
        "refresh",
      ],
      "platforms": [
        "sensor",
      ],
      "controls": false,
    },
    "localApi": {
      "implemented": [
        "manual local setup for Mopeka endpoints, snapshots, rawData, snapshotProvider, and injected native clients",
        "runtime mapping for Mopeka device snapshots and Home Assistant platform metadata",
        "safe command delegation to injected client.execute or commandExecutor only",
      ],
      "explicitUnsupported": [
        "native live Mopeka polling because Home Assistant uses passive Bluetooth advertisements through mopeka-iot-ble and bluetooth_adapters",
        "BLE scanning, adapter selection, and passive advertisement subscription without an injected Bluetooth-capable client or snapshotProvider",
        "claiming live Mopeka polling, pairing, subscription, or write success without an injected native client or snapshotProvider",
        "Home Assistant entity registry migrations and repair flows",
        "claiming command success without injected client.execute or commandExecutor",
      ],
    },
  },
};
