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

export const btHomeHub5Domain = "bt_home_hub_5";
export const btHomeHub5DefaultName = "BT Home Hub 5";

export interface IBtHomeHub5RawData extends Record<string, unknown> {
  clients?: number;
  wan_up?: boolean;
  wifi_enabled?: boolean;
}

export type TBtHomeHub5RawData = IBtHomeHub5RawData | TSimpleLocalRawData;
export interface IBtHomeHub5Snapshot extends ISimpleLocalSnapshot {}
export interface IBtHomeHub5Config extends ISimpleLocalConfig {
  rawData?: TBtHomeHub5RawData;
}
export interface IHomeAssistantBtHomeHub5Config extends IBtHomeHub5Config {}

export const btHomeHub5Profile: ISimpleLocalIntegrationProfile = {
  domain: "bt_home_hub_5",
  displayName: "BT Home Hub 5",
  manufacturer: "BT",
  model: "Home Hub 5",
  defaultName: "BT Home Hub 5",
  defaultProtocol: "local",
  status: "read-only-runtime",
  platforms: [
    "sensor",
    "binary_sensor"
  ],
  serviceDomains: [],
  controlServices: [],
  discoverySources: [
    "manual",
    "mdns",
    "ssdp",
    "http",
    "custom"
  ],
  discoveryKeywords: [
    "bt",
    "home hub",
    "router"
  ],
  metadata: {
    source: "home-assistant/core",
    upstreamPath: "homeassistant/components/bt_home_hub_5",
    upstreamDomain: "bt_home_hub_5",
    integrationType: "device",
    iotClass: "local_polling",
    qualityScale: "legacy",
    requirements: [
      "bthomehub5-devicelist==0.1.1"
    ],
    dependencies: [],
    afterDependencies: [],
    codeowners: [],
    configFlow: true,
    sample: {
      clients: 7,
      wan_up: true,
      wifi_enabled: true
    },
    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"
      ]
    }
  }
};
