From 97b5371a0ec07855d712aa51fc1e470cbc8714bd Mon Sep 17 00:00:00 2001 From: Matthias Oesterheld Date: Wed, 13 Nov 2024 21:30:36 +0100 Subject: [PATCH] add `"pin": true` JSON config property, add default pin, add pin confirmation to toggle, adjust JSON schema --- config.schema.json | 12 ++++++++ resources/settings/properties.xml | 6 ++-- source/HomeAssistantMenuItemFactory.mc | 7 ++++- source/HomeAssistantTapMenuItem.mc | 39 +++++++++++++------------- source/HomeAssistantToggleMenuItem.mc | 21 ++++++++++++-- source/HomeAssistantView.mc | 6 ++-- source/Settings.mc | 2 +- 7 files changed, 65 insertions(+), 28 deletions(-) diff --git a/config.schema.json b/config.schema.json index 0f4d6ec..1e70bba 100644 --- a/config.schema.json +++ b/config.schema.json @@ -37,6 +37,9 @@ "properties": { "confirm": { "$ref": "#/$defs/confirm" + }, + "pin": { + "$ref": "#/$defs/pin" } }, "additionalProperties": false @@ -213,6 +216,9 @@ "confirm": { "$ref": "#/$defs/confirm" }, + "pin": { + "$ref": "#/$defs/pin" + }, "data": { "type": "object", "title": "Your services's parameters", @@ -230,6 +236,12 @@ "default": false, "title": "Confirmation", "description": "Optional confirmation of the action before execution as a precaution." + }, + "pin": { + "type": "boolean", + "default": false, + "title": "PIN Confirmation", + "description": "Optional PIN confirmation of the action before execution as a precaution. Has precedence over 'confirm': true if both are set." } } } diff --git a/resources/settings/properties.xml b/resources/settings/properties.xml index 356dc24..a108e2c 100644 --- a/resources/settings/properties.xml +++ b/resources/settings/properties.xml @@ -66,10 +66,10 @@ 3 - + 0000