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

export const adsDomain = "ads";
export const adsDefaultName = "ADS";

export type TAdsRawData = TSimpleLocalRawData;
export interface IAdsSnapshot extends ISimpleLocalSnapshot {}
export interface IAdsConfig extends ISimpleLocalConfig {}
export interface IHomeAssistantAdsConfig extends IAdsConfig {}

export const adsProfile: ISimpleLocalIntegrationProfile = {
  domain: "ads",
  displayName: "ADS",
  manufacturer: "Beckhoff",
  model: "ADS PLC",
  defaultName: "ADS",
  defaultPort: 48898,
  defaultProtocol: "tcp",
  status: "control-runtime",
  platforms: [
    "sensor",
    "switch",
    "binary_sensor"
  ],
  serviceDomains: [
    "switch"
  ],
  controlServices: [
    "turn_on",
    "turn_off",
    "toggle"
  ],
  discoverySources: [
    "manual",
    "mdns",
    "ssdp",
    "http",
    "custom"
  ],
  discoveryKeywords: [
    "ads",
    "beckhoff",
    "twincat",
    "plc"
  ],
  metadata: {
    source: "home-assistant/core",
    upstreamPath: "homeassistant/components/ads",
    upstreamDomain: "ads",
    iotClass: "local_push",
    qualityScale: "legacy",
    requirements: [
      "pyads==3.4.0"
    ],
    dependencies: [],
    afterDependencies: [],
    codeowners: [],
    configFlow: true,
    runtime: {
      type: "control-runtime",
      services: [
        "snapshot",
        "status",
        "refresh",
        "turn_on",
        "turn_off",
        "toggle"
      ],
      platforms: [
        "sensor",
        "switch",
        "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"
      ]
    }
  }
};
