{
  "pluginAlias": "HubspacePlatform",
  "pluginType": "platform",
  "singular": true,
  "strictValidation": true,
  "customUi": true,
  "headerDisplay": "## Hubspace Platform\n\nSign in with your Hubspace (Home Depot) account. Tokens are cached locally — you will **not** be re-prompted on every restart.",
  "footerDisplay": "See the [README](https://github.com/ctrlcmdshft/homebridge-hubspace-platform#readme) for full documentation and troubleshooting tips.",
  "schema": {
    "type": "object",
    "properties": {
      "name": {
        "title": "Platform Name",
        "type": "string",
        "default": "Hubspace"
      },
      "username": {
        "title": "Hubspace Username (email)",
        "type": "string",
        "format": "email",
        "placeholder": "you@example.com"
      },
      "password": {
        "title": "Hubspace Password",
        "type": "string",
        "format": "password",
        "placeholder": "Your Hubspace password"
      },
      "pollingInterval": {
        "title": "Polling Interval (seconds)",
        "type": "integer",
        "default": 300,
        "minimum": 10,
        "maximum": 600,
        "description": "How often to poll device state as a fallback (10–600 s). When omitted, the plugin uses 300 s with Conclave enabled or 30 s when Conclave is disabled. Set a lower value if a device does not reliably emit push events."
      },
      "tokenCachePath": {
        "title": "Token Cache Path (advanced)",
        "type": "string",
        "description": "Override the path for the cached auth token file. Leave blank to use the Homebridge storage directory (recommended)."
      },
      "debug": {
        "title": "Enable Debug Logging",
        "type": "boolean",
        "default": false,
        "description": "Log API calls, token refreshes, Conclave push details, unsupported-device capability summaries, and device discovery decisions. Enable temporarily while troubleshooting."
      },
      "verbose": {
        "title": "Enable Verbose Logging",
        "type": "boolean",
        "default": false,
        "description": "Log every device state value on each update. Very noisy; use only when gathering data for a bug report or new device support request. Implies debug."
      },
      "exposeComfortBreeze": {
        "title": "Expose Comfort Breeze Switch",
        "type": "boolean",
        "default": false,
        "description": "Show Comfort Breeze as a separate HomeKit switch tile for supported fans. When disabled (default), Comfort Breeze is hidden and the fan tile tap toggles power directly."
      },
      "exposeMasterPowerSwitch": {
        "title": "Expose Master Power Switch",
        "type": "boolean",
        "default": false,
        "description": "Show the ceiling-fan master power (power[primary]) as a separate HomeKit switch tile. Only applies to fans that have a dedicated fan-power field alongside a master power field."
      },
      "exposeStatusFault": {
        "title": "Expose Status Fault on Fans and Lights",
        "type": "boolean",
        "default": false,
        "description": "Add a non-standard fault indicator to fan and light services when Hubspace reports the device offline. Visible in third-party HomeKit apps such as Eve or Controller for HomeKit; Apple Home may not display it."
      },
      "invertOutletStatus": {
        "title": "Invert Outlet Status",
        "type": "boolean",
        "default": false,
        "description": "Invert the reported on/off state for outlets and plugs. Enable if your outlet appears on in HomeKit when it is physically off."
      },
      "disableConclave": {
        "title": "Disable Conclave Push",
        "type": "boolean",
        "default": false,
        "description": "Disable the real-time Conclave push connection and fall back to polling only. Use this if you experience persistent connection issues."
      },
      "excludedDevices": {
        "title": "Excluded Devices",
        "type": "string",
        "default": "",
        "description": "Comma-separated Hubspace friendly names to hide from HomeKit, matched case-insensitively. Useful for duplicate devices, unwanted sub-devices, or devices managed by another plugin."
      }
    },
    "required": ["username", "password"],
    "additionalProperties": false
  },
  "layout": [
    {
      "type": "fieldset",
      "title": "Hubspace Account",
      "items": [
        {
          "key": "username",
          "type": "email"
        },
        {
          "key": "password",
          "type": "password"
        }
      ]
    },
    {
      "type": "fieldset",
      "title": "Device Options",
      "items": [
        "exposeComfortBreeze",
        "exposeMasterPowerSwitch",
        "exposeStatusFault",
        "invertOutletStatus",
        "excludedDevices"
      ]
    },
    {
      "type": "fieldset",
      "title": "Advanced",
      "expandable": true,
      "expanded": false,
      "items": ["disableConclave", "pollingInterval", "debug", "verbose", "name", "tokenCachePath"]
    }
  ]
}
