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

export const bluemaestroDomain = "bluemaestro";
export const bluemaestroDefaultName = "BlueMaestro";

export type TBluemaestroRawData = TSimpleLocalRawData;
export interface IBluemaestroSnapshot extends ISimpleLocalSnapshot {}
export interface IBluemaestroConfig extends ISimpleLocalConfig {}
export interface IHomeAssistantBluemaestroConfig extends IBluemaestroConfig {}

export const bluemaestroSampleData: TBluemaestroRawData = {
  temperature: 21.2,
  humidity: 42,
  battery: 90,
};

export const bluemaestroProfile: ISimpleLocalIntegrationProfile = {
  domain: "bluemaestro",
  displayName: "BlueMaestro",
  manufacturer: "BlueMaestro",
  model: "BLE sensor",
  defaultName: "BlueMaestro",
  defaultProtocol: "local",
  status: "read-only-runtime",
  platforms: [
    "sensor",
    "binary_sensor"
  ],
  serviceDomains: [],
  controlServices: [],
  discoverySources: [
    "manual",
    "bluetooth",
    "custom"
  ],
  discoveryKeywords: [
    "bluemaestro",
    "blue maestro",
    "ble",
    "sensor"
  ],
  metadata: {
    source: "home-assistant/core",
    upstreamPath: "homeassistant/components/bluemaestro",
    upstreamDomain: "bluemaestro",
    integrationType: "device",
    iotClass: "local_push",
    requirements: [
      "bluemaestro-ble==0.4.1"
    ],
    dependencies: [
      "bluetooth_adapters"
    ],
    afterDependencies: [],
    codeowners: [
      "@bdraco"
    ],
    configFlow: true,
    sampleData: bluemaestroSampleData,
    runtime: {
      type: "read-only-runtime",
      services: [
        "snapshot",
        "status",
        "refresh"
      ],
      platforms: [
        "sensor",
        "binary_sensor"
      ],
      controls: false
    },
    localApi: {
      implemented: [
        "manual local endpoint setup",
        "snapshot, raw data, snapshotProvider, and injected native client operation",
        "generic HTTP/TCP local transport when config.path, config.transport, or documented defaults are supplied"
      ],
      explicitUnsupported: [
        "claiming live command success without injected client.execute or commandExecutor",
        "cloud account flows and remote API polling",
        "device-specific protocol features not represented by snapshot/rawData/client/executor inputs"
      ]
    }
  }
};
