{
  "title": "Matterbridge Roborock Vacuum Plugin",
  "description": "matterbridge-roborock-vacuum-plugin v. 1.0.8-rc08 by https://github.com/RinDevJunior",
  "type": "object",
  "required": ["username", "password"],
  "properties": {
    "name": {
      "description": "Plugin name",
      "type": "string",
      "readOnly": true,
      "ui:widget": "hidden"
    },
    "type": {
      "description": "Plugin type",
      "type": "string",
      "readOnly": true,
      "ui:widget": "hidden"
    },
    "whiteList": {
      "description": "(ONLY SET IF YOU HAVE MULTIPLE VACUUMS) Only THE FIRST ONE device with <Name>-<duid> in the list will be exposed. If the list is empty, THE FIRST device will be exposed.",
      "type": "array",
      "items": {
        "type": "string"
      },
      "uniqueItems": true,
      "selectFrom": "name"
    },
    "username": {
      "description": "Roborock username (required for the plugin to work)",
      "type": "string"
    },
    "password": {
      "description": "Roborock password (required for the plugin to work)",
      "type": "string",
      "ui:widget": "password"
    },
    "refreshInterval": {
      "description": "Refresh interval in seconds (default: 60)",
      "type": "number",
      "default": 60
    },
    "enableExperimental": {
      "title": "Enable the experimental feature",
      "type": "object",
      "properties": {
        "enableExperimentalFeature": {
          "title": "Enable Custom Clean Mode",
          "type": "boolean",
          "default": false
        }
      },
      "allOf": [
        {
          "if": {
            "properties": {
              "enableExperimentalFeature": {
                "const": true
              }
            },
            "required": ["enableExperimentalFeature"]
          },
          "then": {
            "properties": {
              "advancedFeature": {
                "title": "Enable Advanced Feature",
                "type": "object",
                "properties": {
                  "showRoutinesAsRoom": {
                    "title": "Show Routines As Room",
                    "type": "boolean",
                    "default": false
                  },
                  "includeDockStationStatus": {
                    "title": "Include Dock Station Status",
                    "type": "boolean",
                    "default": false
                  },
                  "forceRunAtDefault": {
                    "title": "Force Run At Default Implementation",
                    "type": "boolean",
                    "default": false
                  },
                  "useVacationModeToSendVacuumToDock": {
                    "title": "Use Vacation Mode To Send Vacuum To Dock",
                    "type": "boolean",
                    "default": false
                  }
                }
              },
              "cleanModeSettings": {
                "title": "Enable Custom Clean Mode",
                "type": "object",
                "properties": {
                  "enableCleanModeMapping": {
                    "type": "boolean",
                    "default": false
                  }
                },
                "allOf": [
                  {
                    "if": {
                      "properties": {
                        "enableCleanModeMapping": {
                          "const": true
                        }
                      },
                      "required": ["enableCleanModeMapping"]
                    },
                    "then": {
                      "properties": {
                        "vacuuming": {
                          "title": "Vacuuming only",
                          "type": "object",
                          "properties": {
                            "fanMode": {
                              "$ref": "#/$defs/fanMode",
                              "default": "Balanced"
                            },
                            "mopRouteMode": {
                              "$ref": "#/$defs/mopRouteMode"
                            }
                          }
                        },
                        "mopping": {
                          "title": "Mopping only",
                          "type": "object",
                          "properties": {
                            "waterFlowMode": {
                              "$ref": "#/$defs/waterFlowMode"
                            },
                            "mopRouteMode": {
                              "$ref": "#/$defs/mopRouteMode"
                            }
                          },
                          "allOf": [
                            {
                              "if": {
                                "properties": {
                                  "waterFlowMode": {
                                    "const": "CustomizeWithDistanceOff"
                                  }
                                }
                              },
                              "then": {
                                "properties": {
                                  "distanceOff": {
                                    "type": "number",
                                    "description": "Distance Off - Default = 25",
                                    "default": 25
                                  }
                                },
                                "required": ["distanceOff"]
                              }
                            }
                          ]
                        },
                        "vacmop": {
                          "title": "Vacuuming and Mopping",
                          "type": "object",
                          "properties": {
                            "fanMode": {
                              "$ref": "#/$defs/fanMode",
                              "default": "Balanced"
                            },
                            "waterFlowMode": {
                              "$ref": "#/$defs/waterFlowMode"
                            },
                            "mopRouteMode": {
                              "$ref": "#/$defs/mopRouteMode"
                            }
                          },
                          "allOf": [
                            {
                              "if": {
                                "properties": {
                                  "waterFlowMode": {
                                    "const": "CustomizeWithDistanceOff"
                                  }
                                }
                              },
                              "then": {
                                "properties": {
                                  "distanceOff": {
                                    "type": "number",
                                    "description": "Distance Off - Default = 25",
                                    "default": 25
                                  }
                                },
                                "required": ["distanceOff"]
                              }
                            }
                          ]
                        }
                      }
                    }
                  }
                ]
              }
            }
          }
        }
      ]
    },
    "debug": {
      "description": "Enable the debug for the plugin (development only)",
      "type": "boolean",
      "default": false
    },
    "unregisterOnShutdown": {
      "description": "Unregister all devices on shutdown (development only)",
      "type": "boolean",
      "default": false
    }
  },
  "$defs": {
    "fanMode": {
      "type": "string",
      "description": "Suction power mode to use (e.g., 'Quiet', 'Balanced', 'Turbo', 'Max', 'MaxPlus').",
      "enum": ["Quiet", "Balanced", "Turbo", "Max", "MaxPlus"],
      "default": "Balanced"
    },
    "waterFlowMode": {
      "type": "string",
      "description": "Water flow mode to use (e.g., 'Low', 'Medium', 'High', 'CustomizeWithDistanceOff').",
      "enum": ["Low", "Medium", "High", "CustomizeWithDistanceOff"],
      "default": "Medium"
    },
    "mopRouteMode": {
      "type": "string",
      "description": "Mop route intensity to use (e.g., 'Standard', 'Deep', 'DeepPlus', 'Fast').",
      "enum": ["Standard", "Deep", "DeepPlus", "Fast"],
      "default": "Standard"
    }
  }
}
