{
  "pluginAlias": "netatmo-security",
  "pluginType": "platform",
  "singular": true,
  "schema": {
    "type": "object",
    "properties": {
      "name": {
        "title": "Name",
        "type": "string",
        "required": true,
        "default": "Netatmo Security Platform",
        "description": "Plugin display name"
      },
      "client_id": {
        "title": "Client ID",
        "type": "string",
        "required": true,
        "default": "",
        "placeholder": "Generated client id from dev.netatmo.com/apps",
        "description": "OAuth 2.0 client for Netatmo API app"
      },
      "client_secret": {
        "title": "Client Secret",
        "type": "string",
        "required": true,
        "default": "",
        "condition": {
          "functionBody": "return model.hide_client_secret === false || model.hide_client_secret.length <= 0;"
        },
        "placeholder": "Generated client secret from dev.netatmo.com/apps",
        "description": "OAuth 2.0 secret for Netatmo API app"
      },
      "hide_client_secret": {
        "title": "Hide Client Secret?",
        "type": "boolean",
        "default": false,
        "required": true,
        "condition": {
          "functionBody": "return model.client_secret != null && model.client_secret.length > 0;"
        },
        "description": "Secure client secret by hiding it"
      },
      "refresh_token": {
        "title": "Refresh Token",
        "type": "string",
        "required": true,
        "default": "",
        "placeholder": "Generated refresh token from dev.netatmo.com",
        "description": "OAuth2 refresh token. Netatmo no longer supports password login: generate this with the token generator on your app at dev.netatmo.com (scope read_camera, plus write_camera for siren control). Used only on first start — the plugin then rotates and persists it automatically."
      },
      "poll_interval": {
        "title": "Poll Interval (seconds)",
        "type": "integer",
        "required": false,
        "default": 20,
        "minimum": 15,
        "maximum": 300,
        "description": "How often the plugin asks Netatmo for door states (default 20s). Vibration events are fetched separately every 60s. This uses about 240 calls/hour in total, below Netatmo's roughly 500 calls/hour per-account limit. Raise this interval if another integration shares the same Netatmo account."
      },
      "webhook_scheme": {
        "title": "Webhook Scheme",
        "type": "string",
        "default": "http",
        "oneOf": [
          { "title": "Use HTTP", "enum": ["http"] },
          { "title": "Use HTTPS", "enum": ["https"] }
        ],
        "description": "Web protocol used in URL",
        "required": true
      },
      "webhook_host": {
        "title": "Webhook Host",
        "type": "string",
        "required": false,
        "default": "",
        "placeholder": "xx.xx.xx.xx",
        "description": "Public IP or Domain"
      },
      "webhook_port": {
        "title": "Webhook Port",
        "type": "string",
        "required": false,
        "default": "",
        "placeholder": "3000",
        "description": "Local listen port"
      },
      "enable_webhook": {
        "title": "Enable Webhook?",
        "type": "boolean",
        "default": false,
        "required": false,
        "description": "Requires port forwarding"
      }
    }
  }
}
