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

export const aqualogicDomain = "aqualogic";
export const aqualogicDefaultName = "AquaLogic";

export type TAqualogicRawData = TSimpleLocalRawData;
export interface IAqualogicSnapshot extends ISimpleLocalSnapshot {}
export interface IAqualogicConfig extends ISimpleLocalConfig {}
export interface IHomeAssistantAqualogicConfig extends IAqualogicConfig {}

export const aqualogicProfile: ISimpleLocalIntegrationProfile = {
  domain: "aqualogic",
  displayName: "AquaLogic",
  manufacturer: "Hayward",
  model: "AquaLogic pool controller",
  defaultName: "AquaLogic",
  defaultProtocol: "local",
  status: "control-runtime",
  platforms: [
    "switch",
    "sensor",
    "climate"
  ],
  serviceDomains: [
    "switch",
    "climate"
  ],
  controlServices: [
    "turn_on",
    "turn_off",
    "toggle",
    "set_temperature"
  ],
  discoverySources: [
    "manual",
    "mdns",
    "ssdp",
    "http",
    "custom"
  ],
  discoveryKeywords: [
    "aqualogic",
    "hayward",
    "pool"
  ],
  metadata: {
    source: "home-assistant/core",
    upstreamPath: "homeassistant/components/aqualogic",
    upstreamDomain: "aqualogic",
    iotClass: "local_push",
    qualityScale: "legacy",
    requirements: [
      "aqualogic==2.6"
    ],
    dependencies: [],
    afterDependencies: [],
    codeowners: [],
    configFlow: true,
    runtime: {
      type: "control-runtime",
      services: [
        "snapshot",
        "status",
        "refresh",
        "turn_on",
        "turn_off",
        "toggle",
        "set_temperature"
      ],
      platforms: [
        "switch",
        "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"
      ]
    }
  }
};
