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

export const watergateDomain = "watergate";
export const watergateDefaultName = "Watergate";

export type TWatergateRawData = TSimpleLocalRawData;
export interface IWatergateSnapshot extends ISimpleLocalSnapshot {}
export interface IWatergateConfig extends ISimpleLocalConfig {}
export interface IHomeAssistantWatergateConfig extends IWatergateConfig {}

export const watergateProfile: ISimpleLocalIntegrationProfile = {
  domain: "watergate",
  displayName: "Watergate",
  manufacturer: "Watergate",
  model: "Watergate controller",
  defaultName: "Watergate",
  defaultPort: 80,
  defaultProtocol: "http",
  status: "control-runtime",
  platforms: [
    "switch",
    "sensor"
  ],
  serviceDomains: [
    "switch"
  ],
  controlServices: [
    "turn_on",
    "turn_off",
    "toggle"
  ],
  discoverySources: [
    "manual",
    "mdns",
    "ssdp",
    "http",
    "custom"
  ],
  discoveryKeywords: [
    "watergate",
    "irrigation"
  ],
  metadata: {
    source: "home-assistant/core",
    upstreamPath: "homeassistant/components/watergate",
    upstreamDomain: "watergate",
    integrationType: "device",
    iotClass: "local_push",
    qualityScale: "silver",
    requirements: [
      "watergate-local-api==2025.1.0"
    ],
    dependencies: [
      "http",
      "webhook"
    ],
    afterDependencies: [],
    codeowners: [
      "@adam-the-hero"
    ],
    configFlow: true,
    runtime: {
      type: "control-runtime",
      services: [
        "snapshot",
        "status",
        "refresh",
        "turn_on",
        "turn_off",
        "toggle"
      ],
      platforms: [
        "switch",
        "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"
      ]
    }
  }
};
