{
    "pluginAlias": "AmbiBack",
    "pluginType": "accessory",
    "singular": true,
    "headerDisplay": "<img src='https://raw.githubusercontent.com/NeoRame/homebridge-ambiback/master/gfx/AmbiBack_Logo_Horizontal_COLOR.svg' width='50%'>\n\nAmbiBack Bridge control for HomeKit.",
    "schema": {
        "type": "object",
        "properties": {
            "name": {
                "title": "Name",
                "type": "string",
                "required": true,
                "default": "AmbiBack"
            },
            "FW": {
                "title": "Firmware",
                "type": "string",
                "required": true,
                "default": "0.4.225",
                "oneOf": [
                  { "title": "BETA Version 0.4.226", "enum": ["0.4.226"] },
                  { "title": "Latest Version 0.4.225", "enum": ["0.4.225"] },
                  { "title": "0.4.224", "enum": ["0.4.224"] },
                  { "title": "0.3.213", "enum": ["0.3.213"] }
                ]
            },
            "Model": {
                "title": "Model",
                "type": "string",
                "required": true,
                "default": "AmbiBack Bridge",
                "oneOf": [
                  { "title": "AmbiBack Bridge", "enum": ["AmbiBack Bridge"] },
                  { "title": "AmbiBack CAM", "enum": ["AmbiBack CAM"] }
                ]
            },
            "serialNumber": {
                "title": "Serial Number",
                "type": "string",
                "required": false,
                "minLength": 14,
                "maxLength": 14,
                "placeholder": "N30R4MEF0R3V0R"
            },
            "onUrl": {
                "title": " ",
                "type": "string",
                "default": "http://192.168.0.1/setdreamscreenemulation?value=1",
                "required": true
            },
            "offUrl": {
                "title": " ",
                "type": "string",
                "default": "http://192.168.0.1/setdreamscreenemulation?value=0",
                "required": true
            },
            "statusUrl": {
                "title": " ",
                "type": "string",
                "default": "http://192.168.0.1/getparamatersasjson",
                "required": true
            },
            "switchType": {
                "title": "Switch Type",
                "type": "string",
                "default": "stateful",
                "oneOf": [
                  { "title": "Sateful", "enum": ["stateful"] }
                ],
                "required": true
            },
            "statusPattern": {
                "title": "It's Magic",
                "type": "string",
                "default": "(.|\n)*dreamscreenemulation\": \"1\"(.|\n)*,",
                "oneOf": [
                  { "title": "Secret Script ;)", "enum": ["(.|\n)*dreamscreenemulation\": \"1\"(.|\n)*,"] }
                ],
                "required": true
            }
        }
    },
    "layout": [
        {
            "type": "fieldset",
            "items": [
                "name"
            ]
        },
        {
            "type": "fieldset",
            "title": "IP Settings",
            "expanded": true,
            "description": "Please update the Url's with the IP from your AmbiBack. IMPORTANT: Don't delete any of the other stuff!",
            "items": [
                "onUrl",
                "offUrl",
                "statusUrl"
            ]
        },
        {
            "type": "fieldset",
            "title": "Cosmetic Settings",
            "expandable": true,
            "expanded": false,
            "description": "Place here your Infos about Hardware and Firmware, if you want.",
            "items": [
                "serialNumber",
                {
                    "type": "flex",
                    "flex-flow": "row wrap",
                    "items": [
                        "Model",
                        "FW"
                    ]
                }
            ]
        }
    ]
}
