{
  "pluginAlias": "iRobotPlatform",
  "pluginType": "platform",
  "singular": true,
  "customUi": true,
  "headerDisplay": "<p align=\"center\"><img width=\"60%\" src=\"https://user-images.githubusercontent.com/75853497/143301930-e2f3bc9a-9f0d-4e03-95f8-c69769712ca5.png\"></p><p align=\"center\">For help and support please visit the <a href=\"https://github.com/taurgis/homebridge-iRobot-v2/wiki\">GitHub Wiki</a>. I hope you find this plugin useful!</p>",
  "schema": {
    "type": "object",
    "properties": {
      "name": {
        "title": "Name",
        "description": "For logging purposes",
        "type": "string",
        "required": true,
        "default": "iRobot"
      },
      "email": {
        "title": "Email",
        "type": "string",
        "required": true,
        "placeholder": "email@example.com",
        "format": "email",
        "condition": {
          "functionBody": "return !model.manualDiscovery"
        }
      },
      "password": {
        "title": "Password",
        "type": "string",
        "required": true,
        "x-schema-form": {
          "type": "password"
        },
        "condition": {
          "functionBody": "return !model.manualDiscovery"
        }
      },
      "roombas": {
        "title": "Roomba's",
        "type": "array",
        "buttonText": "Add Roomba",
        "items": {
          "type": "object",
          "properties": {
            "name": {
              "title": "Device Name",
              "description": "Name to display in custom ui and Homekit",
              "type": "string",
              "required": true,
              "placeholder": "Roomba"
            },
            "blid": {
              "title": "Blid",
              "description": "Your roomba's blid/username (Hint: if you enter your iRobot credentials above you can find your roomba's blid/username in the devices tab above)",
              "type": "string",
              "required": true
            },
            "password": {
              "title": "Password",
              "description": "Your roomba's password (Hint: if you enter your iRobot credentials above you can find your roomba's password in the devices tab above)",
              "required": true,
              "type": "string"
            },
            "autoConfig": {
              "title": "Automatic Configuration",
              "description": "Disable this to manually enter roomba credentials (IP, model, etc)",
              "type": "boolean",
              "default": true,
              "required": true
            },
            "ip": {
              "title": "IP Address",
              "description": "Your roomba's ip address (Hint: if you enter your iRobot credentials above you can find your roomba's ip address in the devices tab above)",
              "type": "string",
              "format": "ipv4",
              "required": true,
              "condition": {
                "functionBody": "return !model.roombas[arrayIndices].autoConfig"
              }
            },
            "model": {
              "title": "Model",
              "description": "Your roomba's model (Hint: if you enter your iRobot credentials above you can find your roomba's model in the devices tab above)",
              "type": "string",
              "required": true,
              "condition": {
                "functionBody": "return !model.roombas[arrayIndices].autoConfig"
              }
            },
            "multiRoom": {
              "title": "Room-By-Room Support",
              "description": "Does your roomba support room-by-room cleaning",
              "type": "boolean",
              "required": true,
              "condition": {
                "functionBody": "return !model.roombas[arrayIndices].autoConfig"
              }
            },
            "info": {
              "title": "Additional Information",
              "type": "object",
              "properties": {
                "sw": {
                  "title": "Software Version",
                  "description": "Your Roomba's software version",
                  "type": "string",
                  "required": false
                },
                "serialNum": {
                  "title": "Serial Number",
                  "description": "Your Roomba's serial number",
                  "type": "string",
                  "required": false
                },
                "mac": {
                  "title": "Mac Address",
                  "description": "Your Roomba's mac address",
                  "type": "string",
                  "required": false
                },
                "ver": {
                  "title": "Protocol Version",
                  "description": "Your Roomba's protocol version (defualt 2)",
                  "type": "number",
                  "default": 2,
                  "max": 3,
                  "min": 1,
                  "required": false
                },
                "sku": {
                  "title": "sku",
                  "description": "Your Roomba's sku",
                  "type": "string",
                  "required": false
                }
              },
              "condition": {
                "functionBody": "return !model.roombas[arrayIndices].autoConfig"
              }
            }
          }
        },
        "condition": {
          "functionBody": "return model.manualDiscovery"
        }
      },
      "manualDiscovery": {
        "title": "Manual Configuration",
        "description": "Select this to manually configure your roomba's instead of using an email & password",
        "type": "boolean",
        "default": false,
        "required": true
      },
      "lowBattery": {
        "title": "Low Battery Warning",
        "type": "integer",
        "required": false,
        "minimum": 0,
        "maximum": 100,
        "default": 20,
        "description": "At What Percent Should Homekit Display Low Battery Warning"
      },
      "offAction": {
        "title": "Off Action",
        "type": "string",
        "default": "pause:dock",
        "oneOf": [
          {
            "title": "Pause And Dock",
            "enum": [
              "pause:dock"
            ]
          },
          {
            "title": "Stop And Dock",
            "enum": [
              "stop:dock"
            ]
          },
          {
            "title": "Pause And Find",
            "enum": [
              "pause:find"
            ]
          },
          {
            "title": "Stop And Find",
            "enum": [
              "stop:find"
            ]
          },
          {
            "title": "Pause",
            "enum": [
              "pause:none"
            ]
          },
          {
            "title": "Stop",
            "enum": [
              "stop:none"
            ]
          }
        ],
        "required": true,
        "description": "What To Do When You Set The Switch To Off"
      },
      "status": {
        "title": "Homekit Active",
        "type": "string",
        "default": "cycle:clean",
        "oneOf": [
          {
            "title": "Job Active",
            "enum": [
              "cycle:clean"
            ]
          },
          {
            "title": "Running",
            "enum": [
              "phase:run"
            ]
          },
          {
            "title": "Not Charging",
            "enum": [
              "inverted:phase:charge"
            ]
          },
          {
            "title": "Always Off",
            "enum": [
              false
            ]
          },
          {
            "title": "Always On",
            "enum": [
              true
            ]
          }
        ],
        "required": true,
        "description": "What To Make Homekit Display As Active"
      },
      "eveStatus": {
        "title": "Eve Inactive",
        "type": "string",
        "default": "inverted:cycle:clean",
        "oneOf": [
          {
            "title": "No Job Active",
            "enum": [
              "inverted:cycle:clean"
            ]
          },
          {
            "title": "Not Cleaning",
            "enum": [
              "inverted:phase:run"
            ]
          },
          {
            "title": "Stopped",
            "enum": [
              "phase:stop"
            ]
          },
          {
            "title": "Charging",
            "enum": [
              "phase:charge"
            ]
          },
          {
            "title": "Docking",
            "enum": [
              "cycle:dock"
            ]
          },
          {
            "title": "Stuck",
            "enum": [
              "phase:stuck"
            ]
          },
          {
            "title": "Always Inactive",
            "enum": [
              false
            ]
          }
        ],
        "required": true,
        "description": "What To Make Eve Display As Inactive"
      },
      "bin": {
        "title": "Roomba Bin",
        "type": "string",
        "default": "filter:contact",
        "oneOf": [
          {
            "title": "Filter, Contact, And Motion",
            "enum": [
              "filter:contact:motion"
            ]
          },
          {
            "title": "Filter And Contact",
            "enum": [
              "filter:contact"
            ]
          },
          {
            "title": "Filter And Motion",
            "enum": [
              "filter:motion"
            ]
          },
          {
            "title": "Contact And Motion",
            "enum": [
              "contact:motion"
            ]
          },
          {
            "title": "Filter",
            "enum": [
              "filter"
            ]
          },
          {
            "title": "Contact",
            "enum": [
              "contact"
            ]
          },
          {
            "title": "Motion",
            "enum": [
              "motion"
            ]
          },
          {
            "title": "None",
            "enum": [
              "none"
            ]
          }
        ],
        "required": true,
        "description": "What To Use To Display If The Roomba's Bin Is Full \n(Filters only show up in eve,\n Contact Sensors give you a notification when the bin is full and when you empty it,\n Motion Sensors only notify you if the bin is full.)"
      },
      "ignoreMultiRoomBin": {
        "title": "Ignore Bin On Multi-Room Roomba's",
        "type": "boolean",
        "default": true,
        "required": true
      },
      "hideStuckSensor": {
        "title": "Hide Stuck Sensor",
        "type": "boolean",
        "required": true,
        "default": false
      },
      "disableMultiRoom": {
        "title": "Disable Multi-Room Support",
        "type": "boolean",
        "required": true,
        "default": false
      }
    }
  }
}
