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

export const kegtronDomain = "kegtron";
export const kegtronDefaultName = "Kegtron";

export type TKegtronRawData = TSimpleLocalRawData;
export interface IKegtronSnapshot extends ISimpleLocalSnapshot {}
export interface IKegtronConfig extends ISimpleLocalConfig {
  url?: string;
  macAddress?: string;
  deviceId?: string;
}

export const kegtronProfile: ISimpleLocalIntegrationProfile = {
  domain: kegtronDomain,
  displayName: "Kegtron",
  manufacturer: "Kegtron",
  model: "Kegtron local integration",
  defaultName: kegtronDefaultName,
  defaultProtocol: 'local',
  status: "read-only-runtime",
  platforms: [
    "sensor",
  ],
  serviceDomains: [],
  controlServices: [],
  discoverySources: [
    'manual',
    'custom',
  ],
  discoveryKeywords: [
    "kegtron",
    "Kegtron",
  ],
  metadata: {
    "source": "home-assistant/core",
    "upstreamPath": "homeassistant/components/kegtron",
    "upstreamDomain": "kegtron",
    "integrationType": "device",
    "iotClass": "local_push",
    "requirements": [
      "kegtron-ble==1.0.2",
    ],
    "dependencies": [
      "bluetooth_adapters",
    ],
    "codeowners": [
      "@Ernst79",
    ],
    "configFlow": true,
    "documentation": "https://www.home-assistant.io/integrations/kegtron",
    "runtime": {
      "type": "read-only-runtime",
      "services": [
        "snapshot",
        "status",
        "refresh",
      ],
      "platforms": [
        "sensor",
      ],
      "controls": false,
    },
    "localApi": {
      "implemented": [
        "manual local setup for Kegtron endpoints, snapshots, rawData, snapshotProvider, and injected native clients",
        "runtime mapping for Kegtron device snapshots and Home Assistant platform metadata",
        "safe command delegation to injected client.execute or commandExecutor only",
      ],
      "explicitUnsupported": [
        "native live Kegtron updates: Home Assistant receives passive BLE advertisements through bluetooth_adapters and kegtron-ble==1.0.2; this repo has no BLE scanner stack or kegtron BLE advertisement decoder dependency",
        "claiming live Kegtron polling, BLE subscription, pairing, 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",
      ],
    },
  },
};
