diff --git a/config.schema.json b/config.schema.json index 2ef21e3..98783bd 100644 --- a/config.schema.json +++ b/config.schema.json @@ -2,6 +2,7 @@ "pluginAlias": "HomebridgeAutomation", "pluginType": "platform", "singular": true, + "customUi": true, "headerDisplay": "Homebridge Automation settings", "footerDisplay": "", "schema": { @@ -10,9 +11,12 @@ "automationJs": { "title": "Automation script", "type": "string", + "condition": { + "functionBody": "return false;" + }, "required": false, "placeholder": "automation.listen(function (event) { return; })", - "default": "automation.listen(function (event) { return; })", + "default": "automation.listen(function (event) {\n\treturn;\n})", "description": "Javascript function. Use automation.listen() to define your callback to run on every device status change. Do not enter untrusted code, as any code entered here will run on your Homebridge instance and is not isolated or sandboxed." }, "pin": { @@ -30,11 +34,11 @@ "default": false }, "remoteHost": { - "title": "Remote Control host", + "title": "Remote Control Host", "type": "string", "required": false, "default": "", - "description": "Can be overridden by env var UPSTREAM_API (does not apply if enabled is not set)" + "description": "Can be overridden by env var UPSTREAM_API (does not apply if remoteEnabled is not set)" }, "apiKey": { "title": "Remote Control API Key", @@ -42,35 +46,6 @@ "required": false, "default": "", "description": "" - }, - "disabled_modes": { - "condition": { - "functionBody": "false" - }, - "description": "(Not yet in use - filter updates by accessory type)", - "title": "Disabled Accessory Types", - "type": "array", - "uniqueItems": true, - "items": { - "title": "Disabled Types", - "type": "string", - "enum": [ - "BatteryService", - "InputSource", - "Lightbulb", - "LightSensor", - "MotionSensor", - "Outlet", - "ProtocolInformation", - "ServiceLabel", - "Speaker", - "StatelessProgrammableSwitch", - "Switch", - "Television", - "TemperatureSensor", - "Thermostat" - ] - } } } } diff --git a/homebridge-ui/public/index.html b/homebridge-ui/public/index.html new file mode 100644 index 0000000..cffdad7 --- /dev/null +++ b/homebridge-ui/public/index.html @@ -0,0 +1,192 @@ + + +
+

Homebridge Automation

+ +
+ Loading script editor... +
+
+ + diff --git a/package-lock.json b/package-lock.json index bb59587..293007d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,14 +1,15 @@ { "name": "homebridge-automation", - "version": "0.2.0", + "version": "1.0.0-dev.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "homebridge-automation", - "version": "0.2.0", + "version": "1.0.0-dev.0", "license": "Apache-2.0", "dependencies": { + "@homebridge/plugin-ui-utils": "^1.0.3", "@oznu/hap-client": "^1.9.0", "ws": "^8.13.0", "zod": "^3.21.4" @@ -163,6 +164,11 @@ "integrity": "sha512-i5Df8R63XNPCn+Nj1OgAoRdw9e+jHUQb3CNUbvJneI2iu3j4+OtzQj+5PA1Ce+747NR1SPqZSvyvD483dOT3AA==", "dev": true }, + "node_modules/@homebridge/plugin-ui-utils": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@homebridge/plugin-ui-utils/-/plugin-ui-utils-1.0.3.tgz", + "integrity": "sha512-p2S/czGYNRnRtMICxBUk4Uar+KCezfyxjqfStfxKgykD2082SNayVDncYUK1xRai78EGHCbif9eoyrmDweh4tQ==" + }, "node_modules/@homebridge/put": { "version": "0.0.8", "resolved": "https://registry.npmjs.org/@homebridge/put/-/put-0.0.8.tgz", @@ -3761,6 +3767,11 @@ "integrity": "sha512-i5Df8R63XNPCn+Nj1OgAoRdw9e+jHUQb3CNUbvJneI2iu3j4+OtzQj+5PA1Ce+747NR1SPqZSvyvD483dOT3AA==", "dev": true }, + "@homebridge/plugin-ui-utils": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@homebridge/plugin-ui-utils/-/plugin-ui-utils-1.0.3.tgz", + "integrity": "sha512-p2S/czGYNRnRtMICxBUk4Uar+KCezfyxjqfStfxKgykD2082SNayVDncYUK1xRai78EGHCbif9eoyrmDweh4tQ==" + }, "@homebridge/put": { "version": "0.0.8", "resolved": "https://registry.npmjs.org/@homebridge/put/-/put-0.0.8.tgz", diff --git a/package.json b/package.json index e283233..7154690 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "displayName": "Homebridge Automation", "name": "homebridge-automation", - "version": "0.2.0", + "version": "1.0.0-dev.0", "description": "Command and automate your home using Javascript.", "license": "Apache-2.0", "homepage": "https://tommckenzie.dev/homebridge-automation", @@ -32,6 +32,7 @@ "automation" ], "dependencies": { + "@homebridge/plugin-ui-utils": "^1.0.3", "@oznu/hap-client": "^1.9.0", "ws": "^8.13.0", "zod": "^3.21.4"