{
  "pluginAlias": "StreamTriggers",
  "pluginType": "platform",
  "singular": true,
  "schema": {
    "type": "object",
    "properties": {
      "name": {
        "title": "Name",
        "type": "string",
        "default": "Stream Triggers"
      },
      "channelsUrl": {
        "title": "Channels URL",
        "description": "Endpoint serving the channel list (omni-notify's /api/trigger-channels). Used when the static channel list below is empty.",
        "type": "string",
        "default": "http://omni.boris/api/trigger-channels"
      },
      "channelsRefreshInterval": {
        "title": "Channel Refresh Interval (ms)",
        "description": "How often to re-fetch the channel list and re-sync switches. 0 disables all background fetching, including the retry after a failed startup fetch.",
        "type": "integer",
        "minimum": 0,
        "default": 3600000
      },
      "channels": {
        "title": "Channels (static override)",
        "description": "Optional static channel list. When non-empty, the Channels URL is never fetched.",
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "key": {
              "title": "Key",
              "description": "Short unique id, e.g. \"destiny\". Also seeds the accessory UUID.",
              "type": "string",
              "required": true
            },
            "displayName": {
              "title": "Display Name",
              "description": "Defaults to the capitalized key.",
              "type": "string"
            },
            "type": {
              "title": "Type",
              "type": "string",
              "oneOf": [
                { "title": "YouTube", "enum": ["youtube"] },
                { "title": "Twitch", "enum": ["twitch"] },
                { "title": "Kick", "enum": ["kick"] }
              ],
              "required": true
            },
            "url": {
              "title": "URL",
              "description": "YouTube: channel live page (required), e.g. https://www.youtube.com/@destiny/live. Kick: channel link (optional), e.g. https://kick.com/vinesauce, tried as a deep link.",
              "type": "string"
            }
          }
        }
      },
      "credentialsDir": {
        "title": "Credentials Directory",
        "description": "Where homebridge-appletv-enhanced stores Apple TV pairings.",
        "type": "string",
        "default": "/var/lib/homebridge/appletv-enhanced"
      },
      "appleTvId": {
        "title": "Apple TV ID",
        "description": "Defaults to auto-discovery: the single subdirectory of the credentials directory containing a credentials.txt.",
        "type": "string"
      },
      "atvremotePath": {
        "title": "atvremote Path",
        "description": "atvremote binary from appletv-enhanced's venv.",
        "type": "string",
        "default": "/var/lib/homebridge/appletv-enhanced/.venv/bin/atvremote"
      },
      "ytDlpPath": {
        "title": "yt-dlp Path",
        "description": "Override for testing. Defaults to a self-managed binary that is downloaded and refreshed automatically.",
        "type": "string"
      },
      "suffix": {
        "title": "Switch Name Suffix",
        "description": "Appended to switch display names to avoid collisions with HomeKit scene names.",
        "type": "string",
        "default": " Trigger"
      },
      "resetDelay": {
        "title": "Reset Delay (ms)",
        "description": "How long a switch reads \"on\" before auto-resetting to off.",
        "type": "integer",
        "minimum": 1,
        "default": 2000
      }
    }
  }
}
