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

export const bsblanDomain = "bsblan";
export const bsblanDefaultName = "BSB-LAN";

export type TBsblanRawData = TSimpleLocalRawData;
export interface IBsblanSnapshot extends ISimpleLocalSnapshot {}
export interface IBsblanConfig extends ISimpleLocalConfig {}
export interface IHomeAssistantBsblanConfig extends IBsblanConfig {}

export const bsblanProfile: ISimpleLocalIntegrationProfile = {
  domain: "bsblan",
  displayName: "BSB-LAN",
  manufacturer: "BSB-LAN",
  model: "Heating gateway",
  defaultName: "BSB-LAN",
  defaultProtocol: "local",
  status: "control-runtime",
  platforms: [
    "climate",
    "sensor",
    "switch"
  ],
  serviceDomains: [
    "climate",
    "switch"
  ],
  controlServices: [
    "set_temperature",
    "turn_on",
    "turn_off",
    "toggle"
  ],
  discoverySources: [
    "manual",
    "mdns",
    "ssdp",
    "http",
    "custom"
  ],
  discoveryKeywords: [
    "bsblan",
    "heating",
    "boiler"
  ],
  metadata: {
    source: "home-assistant/core",
    upstreamPath: "homeassistant/components/bsblan",
    upstreamDomain: "bsblan",
    integrationType: "device",
    iotClass: "local_polling",
    qualityScale: "silver",
    requirements: [
      "python-bsblan==5.2.0"
    ],
    dependencies: [],
    afterDependencies: [],
    codeowners: [
      "@liudger"
    ],
    configFlow: true,
    sample: {
      boiler_temperature: 58,
      target_temperature: 21,
      burner: true
    },
    runtime: {
      type: "control-runtime",
      services: [
        "snapshot",
        "status",
        "refresh",
        "set_temperature",
        "turn_on",
        "turn_off",
        "toggle"
      ],
      platforms: [
        "climate",
        "sensor",
        "switch"
      ],
      controls: true
    },
    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"
      ]
    }
  }
};
