{
  "pluginAlias": "LoxoneControl",
  "pluginType": "platform",
  "singular": true,
  "customUi": true,
  "strictValidation": false,
  "schema": {
    "type": "object",
    "additionalProperties": true,
    "properties": {
      "name": {
        "title": "Name",
        "type": "string",
        "default": "Loxone Control Platform"
      },
      "platform": {
        "type": "string",
        "default": "LoxoneControl"
      },
      "loxoneMiniServerId": {
        "title": "Loxone Miniserver ID",
        "type": "string",
        "required": true
      },
      "loxoneUser": {
        "title": "Loxone Username",
        "type": "string",
        "required": true
      },
      "loxonePassword": {
        "title": "Loxone Password",
        "type": "string",
        "required": true
      },
      "chromiumPath": {
        "title": "Chromium Path",
        "type": "string",
        "required": false
      },
      "fanLevels": {
        "title": "Levels the fan can be set to, coma separated in the format \"index:levelName\"",
        "type": "string",
        "default": "0:Aus;1:Stufe 1;2:Stufe 2;3:Stufe 3;4:Stufe 4;5:Hyper Speed;6:Nacht;7:Freecolling"
      },
      "verboseLogging": {
        "title": "Verbose Logging, by default only errors are logged",
        "type": "boolean",
        "default": false
      },
      "devices": {
        "type": "array",
        "additionalItems": true,
        "items": {
          "type": "object",
          "additionalProperties": true,
          "properties": {
            "name": {
              "title": "Disply name for homekit",
              "type": "string",
              "required": true
            },
            "identifier": {
              "title": "Identifier for Loxone",
              "type": "string",
              "required": true
            },
            "lightOutlet": {
              "title": "Should this device be handled as outlet?",
              "type": "boolean",
              "condition": {
                "functionBody": "return model.devices[arrayIndices].identifier.includes(\"Beleuchtung\");"
              }
            },
            "fanBathroom": {
              "title": "Should this device be handled as bathroom fan?",
              "type": "boolean",
              "condition": {
                "functionBody": "return model.devices[arrayIndices].identifier.includes(\"Lüftung\");"
              }
            },
            "fanAddButtons": {
              "title": "What additional levels should be available to set? List them coma separated",
              "type": "string",
              "condition": {
                "functionBody": "return model.devices[arrayIndices].identifier.includes(\"Lüftung\");"
              }
            },
            "blindsType": {
              "title": "Type of window covering (blinds have tilt control, awnings do not)",
              "type": "string",
              "default": "blinds",
              "oneOf": [
                { "title": "Blinds", "enum": ["blinds"] },
                { "title": "Awning", "enum": ["awning"] }
              ],
              "condition": {
                "functionBody": "return model.devices[arrayIndices].identifier.includes(\"Jalousie\");"
              }
            }
          }
        }
      }
    }
  }
}
