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

export const oralbDomain = "oralb";
export const oralbDefaultName = "Oral-B";

export type TOralbRawData = TSimpleLocalRawData;
export interface IOralbSnapshot extends ISimpleLocalSnapshot {}
export interface IOralbConfig extends ISimpleLocalConfig {
  url?: string;
  macAddress?: string;
  deviceId?: string;
}
export interface IHomeAssistantOralbConfig extends IOralbConfig {}

export const oralbProfile: ISimpleLocalIntegrationProfile = {
  domain: oralbDomain,
  displayName: "Oral-B",
  manufacturer: "Oral-B",
  model: "Oral-B local integration",
  defaultName: oralbDefaultName,
  defaultProtocol: 'local',
  status: "read-only-runtime",
  platforms: [
    "sensor",
  ],
  serviceDomains: [],
  controlServices: [],
  discoverySources: [
    'manual',
    'custom',
  ],
  discoveryKeywords: [
    "oralb",
    "Oral-B",
    "Oralb",
  ],
  metadata: {
    "source": "home-assistant/core",
    "upstreamPath": "homeassistant/components/oralb",
    "upstreamDomain": "oralb",
    "integrationType": "device",
    "iotClass": "local_push",
    "requirements": [
      "oralb-ble==1.1.0",
    ],
    "dependencies": [
      "bluetooth_adapters",
    ],
    "codeowners": [
      "@bdraco",
      "@Lash-L",
    ],
    "configFlow": true,
    "documentation": "https://www.home-assistant.io/integrations/oralb",
    "loggers": [
      "oralb_ble",
    ],
    "runtime": {
      "type": "read-only-runtime",
      "blocker": "HA uses oralb-ble with ActiveBluetoothProcessorCoordinator/passive Bluetooth advertisements and optional active BLE polling; no HTTP/TCP/TLS/file API is documented for native TypeScript support.",
      "services": [
        "snapshot",
        "status",
        "refresh",
      ],
      "platforms": [
        "sensor",
      ],
      "controls": false,
    },
    "localApi": {
      "status": "blocked-ble-only",
      "implemented": [
        "manual local setup for Oral-B endpoints, snapshots, rawData, snapshotProvider, and injected native clients",
        "runtime mapping for Oral-B device snapshots and Home Assistant platform metadata",
        "safe command delegation to injected client.execute or commandExecutor only",
      ],
      "explicitUnsupported": [
        "native live Oral-B polling/subscription because HA uses oralb-ble, BluetoothServiceInfoBleak, PassiveBluetoothDataProcessor, and ActiveBluetoothProcessorCoordinator rather than HTTP/TCP/TLS/file",
        "BLE adapter/proxy management and active GATT polling without an existing TypeScript BLE dependency",
        "claiming live Oral-B 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",
      ],
    },
  },
};
