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

export const arestDomain = "arest";
export const arestDefaultName = "aREST";

export type TArestRawData = TSimpleLocalRawData;
export interface IArestSnapshot extends ISimpleLocalSnapshot {}
export interface IArestConfig extends ISimpleLocalConfig {}
export interface IHomeAssistantArestConfig extends IArestConfig {}

export const arestProfile: ISimpleLocalIntegrationProfile = {
  domain: "arest",
  displayName: "aREST",
  manufacturer: "aREST",
  model: "Local REST device",
  defaultName: "aREST",
  defaultPort: 80,
  defaultProtocol: "http",
  status: "control-runtime",
  platforms: [
    "sensor",
    "switch",
    "binary_sensor"
  ],
  serviceDomains: [
    "switch"
  ],
  controlServices: [
    "turn_on",
    "turn_off",
    "toggle"
  ],
  discoverySources: [
    "manual",
    "mdns",
    "ssdp",
    "http",
    "custom"
  ],
  discoveryKeywords: [
    "arest",
    "arduino",
    "esp8266"
  ],
  metadata: {
    source: "home-assistant/core",
    upstreamPath: "homeassistant/components/arest",
    upstreamDomain: "arest",
    iotClass: "local_polling",
    qualityScale: "legacy",
    requirements: [],
    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"
      ]
    }
  }
};
