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

export const valloxDomain = "vallox";
export const valloxDefaultName = "Vallox";

export type TValloxRawData = TSimpleLocalRawData;
export interface IValloxSnapshot extends ISimpleLocalSnapshot {}
export interface IValloxConfig extends ISimpleLocalConfig {}
export interface IHomeAssistantValloxConfig extends IValloxConfig {}

export const valloxProfile: ISimpleLocalIntegrationProfile = {
  domain: "vallox",
  displayName: "Vallox",
  manufacturer: "Vallox",
  model: "Ventilation unit",
  defaultName: "Vallox",
  defaultPort: 80,
  defaultProtocol: "websocket",
  status: "control-runtime",
  platforms: [
    "fan",
    "sensor",
    "climate"
  ],
  serviceDomains: [
    "fan",
    "climate"
  ],
  controlServices: [
    "turn_on",
    "turn_off",
    "set_percentage",
    "set_temperature"
  ],
  discoverySources: [
    "manual",
    "mdns",
    "ssdp",
    "http",
    "custom"
  ],
  discoveryKeywords: [
    "vallox",
    "ventilation"
  ],
  metadata: {
    source: "home-assistant/core",
    upstreamPath: "homeassistant/components/vallox",
    upstreamDomain: "vallox",
    integrationType: "device",
    iotClass: "local_polling",
    requirements: [
      "vallox-websocket-api==6.0.0"
    ],
    dependencies: [],
    afterDependencies: [],
    codeowners: [
      "@andre-richter",
      "@slovdahl",
      "@viiru-",
      "@yozik04"
    ],
    configFlow: true,
    runtime: {
      type: "control-runtime",
      services: [
        "snapshot",
        "status",
        "refresh",
        "turn_on",
        "turn_off",
        "set_percentage",
        "set_temperature"
      ],
      platforms: [
        "fan",
        "sensor",
        "climate"
      ],
      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"
      ]
    }
  }
};
