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

export const comfoconnectDomain = "comfoconnect";
export const comfoconnectDefaultName = "Zehnder ComfoAir Q";

export type TComfoconnectRawData = TSimpleLocalRawData;
export interface IComfoconnectSnapshot extends ISimpleLocalSnapshot {}
export interface IComfoconnectConfig extends ISimpleLocalConfig {}
export interface IHomeAssistantComfoconnectConfig extends IComfoconnectConfig {}

export const comfoconnectProfile: ISimpleLocalIntegrationProfile = {
  domain: "comfoconnect",
  displayName: "Zehnder ComfoAir Q",
  manufacturer: "Zehnder",
  model: "ComfoAir Q",
  defaultName: "Zehnder ComfoAir Q",
  defaultProtocol: "local",
  status: "control-runtime",
  platforms: [
    "fan",
    "sensor",
    "binary_sensor"
  ],
  serviceDomains: [
    "fan"
  ],
  controlServices: [
    "turn_on",
    "turn_off",
    "set_percentage"
  ],
  discoverySources: [
    "manual",
    "mdns",
    "ssdp",
    "http",
    "custom"
  ],
  discoveryKeywords: [
    "comfoconnect",
    "comfoair",
    "zehnder",
    "ventilation"
  ],
  metadata: {
    source: "home-assistant/core",
    upstreamPath: "homeassistant/components/comfoconnect",
    upstreamDomain: "comfoconnect",
    iotClass: "local_push",
    qualityScale: "legacy",
    requirements: [
      "pycomfoconnect==0.5.1"
    ],
    dependencies: [],
    afterDependencies: [],
    codeowners: [
      "@michaelarnauts"
    ],
    configFlow: true,
    runtime: {
      type: "control-runtime",
      services: [
        "snapshot",
        "status",
        "refresh",
        "turn_on",
        "turn_off",
        "set_percentage"
      ],
      platforms: [
        "fan",
        "sensor",
        "binary_sensor"
      ],
      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"
      ]
    }
  }
};
