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

export const isy994Domain = "isy994";
export const isy994DefaultName = "Universal Devices ISY/IoX";

export type TIsy994RawData = TSimpleLocalRawData;
export interface IIsy994Snapshot extends ISimpleLocalSnapshot {}
export interface IIsy994Config extends ISimpleLocalConfig {
  url?: string;
  macAddress?: string;
  deviceId?: string;
}
export interface IHomeAssistantIsy994Config extends IIsy994Config {}

export const isy994Profile: ISimpleLocalIntegrationProfile = {
  domain: isy994Domain,
  displayName: "Universal Devices ISY/IoX",
  manufacturer: "Universal Devices ISY/IoX",
  model: "Universal Devices ISY/IoX local integration",
  defaultName: isy994DefaultName,
  defaultPort: 80,
  defaultProtocol: 'http',
  status: "control-runtime",
  platforms: [
    "binary_sensor",
    "button",
    "climate",
    "cover",
    "fan",
    "light",
    "number",
    "select",
    "sensor",
    "switch",
  ],
  serviceDomains: [
    "button",
    "climate",
    "cover",
    "fan",
    "light",
    "number",
    "select",
    "switch",
  ],
  controlServices: [
    "close_cover",
    "delete_zwave_lock_user_code",
    "get_zwave_parameter",
    "open_cover",
    "press",
    "rename_node",
    "select_option",
    "send_node_command",
    "send_program_command",
    "send_raw_node_command",
    "set_hvac_mode",
    "set_temperature",
    "set_value",
    "set_zwave_lock_user_code",
    "set_zwave_parameter",
    "stop_cover",
    "toggle",
    "turn_off",
    "turn_on",
  ],
  discoverySources: [
    'manual',
    'custom',
  ],
  discoveryKeywords: [
    "isy994",
    "Universal Devices ISY/IoX",
    "Isy994",
    "Universal",
    "Devices",
    "ISY/IoX",
  ],
  metadata: {
    "source": "home-assistant/core",
    "upstreamPath": "homeassistant/components/isy994",
    "upstreamDomain": "isy994",
    "integrationType": "hub",
    "iotClass": "local_push",
    "requirements": [
      "pyisy==3.5.1",
    ],
    "codeowners": [
      "@bdraco",
      "@shbatm",
    ],
    "configFlow": true,
    "documentation": "https://www.home-assistant.io/integrations/isy994",
    "loggers": [
      "pyisy",
    ],
    "runtime": {
      "type": "control-runtime",
      "services": [
        "snapshot",
        "status",
        "refresh",
        "close_cover",
        "delete_zwave_lock_user_code",
        "get_zwave_parameter",
        "open_cover",
        "press",
        "rename_node",
        "select_option",
        "send_node_command",
        "send_program_command",
        "send_raw_node_command",
        "set_hvac_mode",
        "set_temperature",
        "set_value",
        "set_zwave_lock_user_code",
        "set_zwave_parameter",
        "stop_cover",
        "toggle",
        "turn_off",
        "turn_on",
      ],
      "platforms": [
        "binary_sensor",
        "button",
        "climate",
        "cover",
        "fan",
        "light",
        "number",
        "select",
        "sensor",
        "switch",
      ],
      "controls": "native ISY/IoX REST control when host/url is configured; otherwise delegated to an injected client.execute or commandExecutor",
    },
    "localApi": {
      "implemented": [
        "native REST polling of /rest/config, /rest/nodes?members=false, and /rest/status over the local ISY/IoX HTTP endpoint",
        "native REST commands for node/group command paths and program command paths when address and command data are provided",
        "manual snapshots, rawData, snapshotProvider, and injected native clients remain supported when no host/url is configured",
      ],
      "explicitUnsupported": [
        "pyisy WebSocket/SOAP event-stream subscription and local_push semantics; this client performs local REST polling only",
        "full pyisy/Home Assistant NodeDef, Insteon, Z-Wave, variable, networking-module, and entity-registry classification parity beyond the REST snapshot fields exposed here",
        "Home Assistant entity registry migrations and repair flows",
        "claiming command success when neither ISY/IoX host/url nor injected client.execute/commandExecutor is configured, or when REST command address data is absent",
      ],
    },
  },
};
