From 8e543f6dbc4b33a021d76fdaaa5aef2a81165164 Mon Sep 17 00:00:00 2001 From: Karl von Randow Date: Tue, 21 Jan 2025 21:45:45 +1300 Subject: [PATCH] chore: reformat config.schema.json --- config.schema.json | 465 ++++++++++++++++++++++++--------------------- 1 file changed, 246 insertions(+), 219 deletions(-) diff --git a/config.schema.json b/config.schema.json index 718bf37..87d8fc3 100644 --- a/config.schema.json +++ b/config.schema.json @@ -1,230 +1,257 @@ { - "pluginAlias": "Roomba2", - "pluginType": "accessory", - "customUi": true, - "customUiPath": "./dist/homebridge-ui", - "schema": { + "pluginAlias": "Roomba2", + "pluginType": "accessory", + "customUi": true, + "customUiPath": "./dist/homebridge-ui", + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "title": "Name", + "required": true + }, + "model": { + "type": "string", + "title": "Model", + "required": true + }, + "serialnum": { + "type": "string", + "title": "Serial Number", + "required": false + }, + "blid": { + "type": "string", + "title": "blid", + "required": true + }, + "robotpwd": { + "type": "string", + "title": "Robot Password", + "required": true + }, + "ipaddress": { + "type": "string", + "title": "IP Address", + "required": true + }, + "debug": { + "type": "boolean", + "title": "Debug logging", + "required": false + }, + "dockContactSensor": { + "type": "boolean", + "title": "Home", + "default": true, + "required": false + }, + "runningContactSensor": { + "type": "boolean", + "title": "Running", + "required": false + }, + "binContactSensor": { + "type": "boolean", + "title": "Bin Full", + "required": false + }, + "dockingContactSensor": { + "type": "boolean", + "title": "Returning Home", + "required": false + }, + "tankContactSensor": { + "type": "boolean", + "title": "Braava Water Tank", + "required": false + }, + "homeSwitch": { + "type": "boolean", + "title": "Home", + "required": false + }, + "cleanBehaviour": { + "type": "string", + "title": "When Roomba is turned on", + "required": true, + "default": "everywhere", + "oneOf": [ + { "title": "Clean everywhere", "enum": ["everywhere"] }, + { "title": "Clean specific rooms", "enum": ["rooms"] } + ] + }, + "mission": { "type": "object", + "title": "Mission Info", "properties": { - "name": { - "type": "string", - "title": "Name", - "required": true - }, - "model": { - "type": "string", - "title": "Model", - "required": true - }, - "serialnum": { - "type": "string", - "title": "Serial Number", - "required": false - }, - "blid": { - "type": "string", - "title": "blid", - "required": true - }, - "robotpwd": { - "type": "string", - "title": "Robot Password", - "required": true - }, - "ipaddress": { - "type": "string", - "title": "IP Address", - "required": true - }, - "debug": { - "type": "boolean", - "title": "Debug logging", - "required": false - }, - "dockContactSensor": { - "type": "boolean", - "title": "Home", - "default": true, - "required": false - }, - "runningContactSensor": { - "type": "boolean", - "title": "Running", - "required": false - }, - "binContactSensor": { - "type": "boolean", - "title": "Bin Full", - "required": false - }, - "dockingContactSensor": { - "type": "boolean", - "title": "Returning Home", - "required": false - }, - "tankContactSensor": { - "type": "boolean", - "title": "Braava Water Tank", - "required": false - }, - "homeSwitch": { - "type": "boolean", - "title": "Home", - "required": false - }, - "cleanBehaviour": { - "type": "string", - "title": "When Roomba is turned on", - "required": true, - "default": "everywhere", - "oneOf": [ - { "title": "Clean everywhere", "enum": ["everywhere"] }, - { "title": "Clean specific rooms", "enum": ["rooms"] } - ] - }, - "mission": { - "type": "object", - "title": "Mission Info", - "properties": { - "ordered": { - "type": "number", - "title": "Clean rooms in order", - "default": 1, - "required": true, - "oneOf": [ - { "title": "Yes", "enum": [1] }, - { "title": "No", "enum": [0] } - ], - "condition": { - "functionBody": "return model.cleanBehaviour === 'rooms';" - } - }, - "pmap_id": { - "type": "string", - "title": "Pmap Id", - "required": true, - "condition": { - "functionBody": "return model.cleanBehaviour === 'rooms';" - } - }, - "regions": { - "type": "array", - "title": "Rooms to be cleaned", - "items": { - "type": "object", - "properties": { - "region_id": { - "type": "string", - "title": "Region Id", - "required": true - }, - "type": { - "type": "string", - "title": "Type", - "default": "rid", - "required": true - }, - "params":{ - "type": "object", - "properties": { - "noAutoPasses": { - "type": "boolean", - "required": false, - "default": false, - "title": "Specify Number of Cleaning Passes" - }, - "twoPass": { - "type": "boolean", - "required": false, - "default": false, - "title": "Two Passes" - } - } - } - } - }, - "condition": { - "functionBody": "return model.cleanBehaviour === 'rooms';" - } + "ordered": { + "type": "number", + "title": "Clean rooms in order", + "default": 1, + "required": true, + "oneOf": [ + { "title": "Yes", "enum": [1] }, + { "title": "No", "enum": [0] } + ], + "condition": { + "functionBody": "return model.cleanBehaviour === 'rooms';" + } + }, + "pmap_id": { + "type": "string", + "title": "Pmap Id", + "required": true, + "condition": { + "functionBody": "return model.cleanBehaviour === 'rooms';" + } + }, + "regions": { + "type": "array", + "title": "Rooms to be cleaned", + "items": { + "type": "object", + "properties": { + "region_id": { + "type": "string", + "title": "Region Id", + "required": true + }, + "type": { + "type": "string", + "title": "Type", + "default": "rid", + "required": true + }, + "params": { + "type": "object", + "properties": { + "noAutoPasses": { + "type": "boolean", + "required": false, + "default": false, + "title": "Specify Number of Cleaning Passes" }, - "user_pmapv_id": { - "type": "string", - "title": "User Pmapv Id", - "required": true, - "condition": { - "functionBody": "return model.cleanBehaviour === 'rooms';" - } + "twoPass": { + "type": "boolean", + "required": false, + "default": false, + "title": "Two Passes" } + } } + } }, - "stopBehaviour": { - "type": "string", - "title": "When Roomba is turned off", - "required": true, - "default": "home", - "oneOf": [ - { "title": "Home", "enum": ["home"] }, - { "title": "Pause", "enum": ["pause"] } - ] - }, - "idleWatchInterval": { - "type": "integer", - "title": "Idle Poll Interval (minutes)", - "description": "How often to poll Roomba's status when it is idle. Defaults to 15 minutes.", - "required": false + "condition": { + "functionBody": "return model.cleanBehaviour === 'rooms';" + } + }, + "user_pmapv_id": { + "type": "string", + "title": "User Pmapv Id", + "required": true, + "condition": { + "functionBody": "return model.cleanBehaviour === 'rooms';" } + } } + }, + "stopBehaviour": { + "type": "string", + "title": "When Roomba is turned off", + "required": true, + "default": "home", + "oneOf": [ + { "title": "Home", "enum": ["home"] }, + { "title": "Pause", "enum": ["pause"] } + ] + }, + "idleWatchInterval": { + "type": "integer", + "title": "Idle Poll Interval (minutes)", + "description": "How often to poll Roomba's status when it is idle. Defaults to 15 minutes.", + "required": false + } + } + }, + "headerDisplay": "For more information and help please consult the [README](https://github.com/homebridge-plugins/homebridge-roomba2#setup).", + "layout": [ + { + "type": "section", + "title": "Display Details", + "items": [ + { "type": "help", "helpvalue": "Details about your Roomba to be displayed in the Home app. You can make up the values you enter here." }, + "name", + "model", + "serialnum" + ] + }, + { + "type": "section", + "title": "Connection", + "items": [ + { "type": "help", "helpvalue": "Please consult the README to obtain these connection values for your Roomba." }, + "blid", + "robotpwd", + "ipaddress" + ] + }, + { + "type": "section", + "title": "Switches", + "items": [ + { "type": "help", "helpvalue": "Switches add additional buttons in the Home app to control Roomba’s behaviour." }, + "homeSwitch" + ] + }, + { + "type": "section", + "title": "Contact Sensors", + "items": [ + { "type": "help", "helpvalue": "Contact sensors appear in the Home app and show what state Roomba is in." }, + "dockContactSensor", + "dockingContactSensor", + "runningContactSensor", + "binContactSensor", + "tankContactSensor" + ] + }, + { + "type": "section", + "title": "Behavior", + "items": ["cleanBehaviour", "mission.pmap_id", "mission.user_pmapv_id", { + "key": "mission.regions", + "type": "array", + "notitle": true, + "items": [ + { + "type": "div", + "displayFlex": true, + "flex-direction": "row", + "items": [ + { + "key": "mission.regions[].region_id", + "notitle": true, + "placeholder": "Region Id" + }, + { + "key": "mission.regions[].type", + "notitle": true, + "placeholder": "Type" + }, + { + "key": "mission.regions[].params.noAutoPasses" + }, + { + "key": "mission.regions[].params.twoPass", + "condition": "mission.regions[arrayIndex].params.noAutoPasses" + } + ] + } + ] + }, "mission.ordered", "stopBehaviour"] }, - "headerDisplay": "For more information and help please consult the [README](https://github.com/homebridge-plugins/homebridge-roomba2#setup).", - "layout": [ - { "type": "section", "title": "Display Details", "items": [ - { "type": "help", "helpvalue": "Details about your Roomba to be displayed in the Home app. You can make up the values you enter here." }, - "name", "model", "serialnum" - ] }, - { "type": "section", "title": "Connection", "items": [ - { "type": "help", "helpvalue": "Please consult the README to obtain these connection values for your Roomba." }, - "blid", "robotpwd", "ipaddress" - ] }, - { "type": "section", "title": "Switches", "items": [ - { "type": "help", "helpvalue": "Switches add additional buttons in the Home app to control Roomba’s behaviour." }, - "homeSwitch" - ] }, - { "type": "section", "title": "Contact Sensors", "items": [ - { "type": "help", "helpvalue": "Contact sensors appear in the Home app and show what state Roomba is in." }, - "dockContactSensor", "dockingContactSensor", "runningContactSensor", "binContactSensor", "tankContactSensor" - ] }, - { "type": "section", "title": "Behavior", "items": [ "cleanBehaviour", "mission.pmap_id", "mission.user_pmapv_id", { - "key": "mission.regions", - "type": "array", - "notitle": true, - "items": [ - { - "type": "div", - "displayFlex": true, - "flex-direction": "row", - "items": [ - { - "key": "mission.regions[].region_id", - "notitle": true, - "placeholder": "Region Id" - }, - { - "key": "mission.regions[].type", - "notitle": true, - "placeholder": "Type" - }, - { - "key": "mission.regions[].params.noAutoPasses" - }, - { - "key": "mission.regions[].params.twoPass", - "condition": "mission.regions[arrayIndex].params.noAutoPasses" - } - ] - } - ] - }, - "mission.ordered", "stopBehaviour" ] }, - { "type": "section", "title": "Additional Options", "items": [ "idleWatchInterval", "debug" ] } - ] + { "type": "section", "title": "Additional Options", "items": ["idleWatchInterval", "debug"] } + ] }