{
  "pluginAlias": "FlairSE",
  "pluginType": "platform",
  "singular": true,
  "schema": {
    "type": "object",
    "properties": {
      "platform": {
        "title": "Platform",
        "type": "string",
        "default": "FlairSE",
        "readOnly": true
      },
      "clientId": {
        "title": "Client ID",
        "type": "string",
        "description": "Flair API OAuth2 client ID"
      },
      "clientSecret": {
        "title": "Client Secret",
        "type": "string",
        "description": "Flair API OAuth2 client secret"
      },
      "refreshToken": {
        "title": "Refresh Token",
        "type": "string",
        "description": "Optional. If omitted, a browser flow will run on startup and token will be stored securely",
        "markdownDescription": "Leave blank to automatically open a browser for authorization on first launch."
      },
      "pollInterval": {
        "title": "Poll Interval",
        "type": "number",
        "default": 300,
        "description": "How often to refresh device state (seconds)",
        "minimum": 60
      },
      "includePucks": {
        "title": "Add Pucks",
        "type": "boolean",
        "default": true,
        "description": "Add puck accessories"
      },
      "includeVents": {
        "title": "Add Vents",
        "type": "boolean",
        "default": true,
        "description": "Add vent accessories"
      },
      "includeGateways": {
        "title": "Add Gateways",
        "type": "boolean",
        "default": true,
        "description": "Add gateway accessories"
      }
    },
    "required": ["platform", "clientId", "clientSecret"]
  },
  "layout": [
    {
      "type": "fieldset",
      "title": "Flair API Credentials",
      "expandable": false,
      "items": [
        "clientId",
        "clientSecret",
        "refreshToken"
      ]
    },
    {
      "type": "fieldset",
      "title": "Device Options",
      "expandable": false,
      "items": [
        "pollInterval",
        "includePucks",
        "includeVents",
        "includeGateways"
      ]
    }
  ],
  "buttons": [
    {
      "label": "Run OAuth Helper",
      "command": "npm run auth-helper",
      "tooltip": "Open browser and store refresh token"
    }
  ]
}
