{
  "pluginAlias": "Ring",
  "pluginType": "platform",
  "headerDisplay": "You must supply _either_ **Email & Password** _or_ **Refresh Token**.  Refresh Token is your only option if you have 2fa enabled, but also works without 2fa if you don't want your password in plain text.  See [the wiki](https://github.com/dgreif/ring/wiki/Two-Factor-Auth) for details on generating a refresh token",
  "schema": {
    "type": "object",
    "properties": {
      "email": {
        "title": "Email",
        "type": "string",
        "format": "email",
        "placeholder": "Email"
      },
      "password": {
        "title": "Password",
        "type": "string",
        "placeholder": "Password",
        "options": {
          "hidden": true
        }
      },
      "refreshToken": {
        "title": "Refresh Token",
        "type": "string",
        "description": "Refresh token generated by ring-auth-cli",
        "placeholder": "Refresh Token"
      },
      "alarmOnEntryDelay": {
        "title": "Alarm on Entry Delay",
        "type": "boolean",
        "description": "If enabled, HomeKit will register a delayed entry event as a triggered alarm. Useful if you want to know as soon as someone opens a door with the alarm armed"
      },
      "hideLightGroups": {
        "title": "Hide Light Groups",
        "type": "boolean",
        "description": "Hides Ring lighting groups, allowing you to group lights differently in HomeKit than how you group them in the Ring app"
      },
      "hideDoorbellSwitch": {
        "title": "Hide Doorbell Programmable Switch",
        "type": "boolean",
        "description": "Hides the Programmable Switch for Ring doorbells.  This switch is only useful for triggering an automation when the doorbell is pressed, so most users can safely hide it"
      },
      "hideCameraMotionSensor": {
        "title": "Hide Camera Motion Sensors",
        "type": "boolean"
      },
      "hideCameraSirenSwitch": {
        "title": "Hide Camera Siren Switch",
        "type": "boolean"
      },
      "hideInHomeDoorbellSwitch": {
        "title": "Hide In-Home Doorbell Switch",
        "type": "booolean"
      },
      "hideAlarmSirenSwitch": {
        "title": "Hide Alarm Siren Switch",
        "type": "boolean",
        "description": "Hides switch that allows you to turn on the siren of the Ring Alarm.  Enable this is your Siri commands keep setting off the siren and you don't care about having the switch"
      },
      "showPanicButtons": {
        "title": "Show Panic Buttons",
        "type": "boolean",
        "description": "Creates a new `Panic Buttons` device in HomeKit with `Burglar Alarm` and `Fire Alarm` switches.  **Use these at your own risk.  I do not guarantee functionality in case of emergency, nor do I take responsibility for any false alarms**.  These function just like the SOS sliders in the Ring app."
      },
      "beamDurationSeconds": {
        "title": "Ring Smart Lighting Timer",
        "type": "integer",
        "minimum": 1,
        "maximum": 32767,
        "description": "Ring Smart Lighting will only stay on for a set amount of time.  You can specify that duration here (in seconds).  If not specified, the light will stay on for the last duration used within the Ring app for individual lights, and 60 seconds for lighting groups.  Max value is 32767 which is ~9.1 hours"
      },
      "debug": {
        "title": "Debug Logging",
        "type": "boolean",
        "description": "Turns on additional logging.  In particular, ffmpeg logging."
      },
      "cameraStatusPollingSeconds": {
        "title": "Camera Status Polling",
        "type": "integer",
        "minimum": 1,
        "placeholder": "Get camera status every __ seconds",
        "description": "Camera status (such as light/siren state) does not update live and must be fetched periodically.  By default this is done every 20 seconds"
      },
      "cameraDingsPollingSeconds": {
        "title": "Camera Event Polling",
        "type": "integer",
        "minimum": 1,
        "placeholder": "Get camera events every __ seconds",
        "description": "Camera motion and ding events does not update live and must be fetched periodically.  By default this is done every 2 seconds"
      },
      "locationIds": {
        "title": "Location ID",
        "type": "array",
        "items": {
          "type": "string"
        }
      }
    },
    "oneOf": [
      {
        "required": ["email", "password"]
      },
      {
        "required": ["refreshToken"]
      }
    ]
  },
  "layout": [
    {
      "type": "flex",
      "flex-flow": "row wrap",
      "items": [
        {
          "key": "email",
          "type": "email"
        },
        {
          "key": "password",
          "type": "password"
        }
      ]
    },
    {
      "type": "flex",
      "flex-flow": "row wrap",
      "items": ["refreshToken"]
    },
    {
      "type": "fieldset",
      "title": "Optional Configuration - Only adjust these if you actually need to",
      "expandable": true,
      "items": [
        "alarmOnEntryDelay",
        "hideLightGroups",
        "hideDoorbellSwitch",
        "hideCameraMotionSensor",
        "hideCameraSirenSwitch",
        "hideInHomeDoorbellSwitch",
        "hideAlarmSirenSwitch",
        "showPanicButtons",
        "beamDurationSeconds",
        "debug",
        "cameraStatusPollingSeconds",
        "cameraDingsPollingSeconds",
        {
          "key": "locationIds",
          "add": "Add Another Location ID",
          "type": "array",
          "items": [
            {
              "type": "div",
              "displayFlex": true,
              "flex-direction": "row",
              "items": [
                {
                  "key": "locationIds[]",
                  "placeholder": "Location ID"
                }
              ]
            }
          ]
        },
        {
          "type": "help",
          "helpvalue": "<p>If you have multiple locations configured in Ring but only want some of them in HomeKit, enter the desired location IDs above.  The ID for each location is logged every time homebridge starts.</p>"
        }
      ]
    }
  ]
}
