From ffae9361259cb05d1b01643faec7815a04e45d9c Mon Sep 17 00:00:00 2001 From: Michael Zanetti Date: Sun, 7 Jun 2020 23:47:50 +0200 Subject: [PATCH 1/3] Add venetianblind interface And fix a bug in shutter, which should extend closable instead of simpleclosable just like blinds and awnings. --- libnymea/interfaces/interfaces.qrc | 1 + libnymea/interfaces/shutter.json | 2 +- libnymea/interfaces/venetianblind.json | 13 +++++++++++++ 3 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 libnymea/interfaces/venetianblind.json diff --git a/libnymea/interfaces/interfaces.qrc b/libnymea/interfaces/interfaces.qrc index d29e1be4..3fc8c284 100644 --- a/libnymea/interfaces/interfaces.qrc +++ b/libnymea/interfaces/interfaces.qrc @@ -76,5 +76,6 @@ powerswitch.json barcodescanner.json irrigation.json + venetianblind.json diff --git a/libnymea/interfaces/shutter.json b/libnymea/interfaces/shutter.json index 79b21a7c..18140ee9 100644 --- a/libnymea/interfaces/shutter.json +++ b/libnymea/interfaces/shutter.json @@ -1,3 +1,3 @@ { - "extends": "simpleclosable" + "extends": "closable" } diff --git a/libnymea/interfaces/venetianblind.json b/libnymea/interfaces/venetianblind.json new file mode 100644 index 00000000..d17bca57 --- /dev/null +++ b/libnymea/interfaces/venetianblind.json @@ -0,0 +1,13 @@ +{ + "extends": "extendedblind", + "description": "Venetian blinds that can be tilted. Venetian blinds must support an angle and specify the minimum and maximum supported angle. For instance, if a venetian blinds supports tilting from horizontal to vertical by 90°, the minValue should be set to 0° and the maxValue to 90°. For venetian blinds that support tilting both direction, that is, a total of 180°, the minValue should be -90° and the maxValue should be 90°. 0° is always the horizontal position.", + "states": [ + { + "name": "angle", + "type": "double", + "unit": "UnitDegree", + "minValue": "any", + "maxValue": "any" + } + ] +} From 327e06367b389e882cca025edf642764854390c0 Mon Sep 17 00:00:00 2001 From: Michael Zanetti Date: Mon, 8 Jun 2020 00:03:02 +0200 Subject: [PATCH 2/3] Add better description to closables --- libnymea/interfaces/awning.json | 1 + libnymea/interfaces/blind.json | 1 + libnymea/interfaces/closable.json | 1 + libnymea/interfaces/extendedawning.json | 1 + libnymea/interfaces/extendedblind.json | 1 + libnymea/interfaces/extendedclosable.json | 1 + libnymea/interfaces/extendedshutter.json | 1 + libnymea/interfaces/shutter.json | 1 + libnymea/interfaces/simpleclosable.json | 1 + libnymea/interfaces/venetianblind.json | 2 +- 10 files changed, 10 insertions(+), 1 deletion(-) diff --git a/libnymea/interfaces/awning.json b/libnymea/interfaces/awning.json index 18140ee9..f2fd8bad 100644 --- a/libnymea/interfaces/awning.json +++ b/libnymea/interfaces/awning.json @@ -1,3 +1,4 @@ { + "description": "Simple awnings which can be opened and closed. Note that awnings operate inverted compared to other closables.", "extends": "closable" } diff --git a/libnymea/interfaces/blind.json b/libnymea/interfaces/blind.json index 18140ee9..5f05e32b 100644 --- a/libnymea/interfaces/blind.json +++ b/libnymea/interfaces/blind.json @@ -1,3 +1,4 @@ { + "description": "Simple blinds which can be opened and closed.", "extends": "closable" } diff --git a/libnymea/interfaces/closable.json b/libnymea/interfaces/closable.json index 635cc6a3..dc2269b4 100644 --- a/libnymea/interfaces/closable.json +++ b/libnymea/interfaces/closable.json @@ -1,4 +1,5 @@ { + "description": "Interface for generic devices that can be opened and closed. The process of opening or closing can be interrupted by the stop action.", "extends": "simpleclosable", "actions": [ { diff --git a/libnymea/interfaces/extendedawning.json b/libnymea/interfaces/extendedawning.json index b947c4ce..7f8c3884 100644 --- a/libnymea/interfaces/extendedawning.json +++ b/libnymea/interfaces/extendedawning.json @@ -1,3 +1,4 @@ { + "description": "Awnings that support indicating their position and the moving state. Note that awnings operate inverted compared to other closables.", "extends": ["awning", "extendedclosable"] } diff --git a/libnymea/interfaces/extendedblind.json b/libnymea/interfaces/extendedblind.json index e6313d90..403be79d 100644 --- a/libnymea/interfaces/extendedblind.json +++ b/libnymea/interfaces/extendedblind.json @@ -1,3 +1,4 @@ { + "description": "Blinds that support indicating their position and the moving state.", "extends": ["blind", "extendedclosable"] } diff --git a/libnymea/interfaces/extendedclosable.json b/libnymea/interfaces/extendedclosable.json index 1e5e40c8..c6c72663 100644 --- a/libnymea/interfaces/extendedclosable.json +++ b/libnymea/interfaces/extendedclosable.json @@ -1,4 +1,5 @@ { + "description": "A more advanced form of devices that support opening and closing in a more fine grained manner. They can report whether the opening/closing is currently in progress and provide a percentage of the opening/closing position. 0% means fully opened, while 100% indicates the device is fully closed", "extends": "closable", "states": [ { diff --git a/libnymea/interfaces/extendedshutter.json b/libnymea/interfaces/extendedshutter.json index 48ab7ada..345237f2 100644 --- a/libnymea/interfaces/extendedshutter.json +++ b/libnymea/interfaces/extendedshutter.json @@ -1,3 +1,4 @@ { + "description": "Advanced roller shutters that support indicating their position and the moving state.", "extends": ["shutter", "extendedclosable"] } diff --git a/libnymea/interfaces/shutter.json b/libnymea/interfaces/shutter.json index 18140ee9..103a3c91 100644 --- a/libnymea/interfaces/shutter.json +++ b/libnymea/interfaces/shutter.json @@ -1,3 +1,4 @@ { + "description": "Simple roller shutters which can be opened and closed.", "extends": "closable" } diff --git a/libnymea/interfaces/simpleclosable.json b/libnymea/interfaces/simpleclosable.json index 5a932f7f..ba39b203 100644 --- a/libnymea/interfaces/simpleclosable.json +++ b/libnymea/interfaces/simpleclosable.json @@ -1,4 +1,5 @@ { + "description": "Interface for very basic devices that support opening and closing.", "actions": [ { "name": "open" diff --git a/libnymea/interfaces/venetianblind.json b/libnymea/interfaces/venetianblind.json index d17bca57..51a3fa17 100644 --- a/libnymea/interfaces/venetianblind.json +++ b/libnymea/interfaces/venetianblind.json @@ -1,6 +1,6 @@ { - "extends": "extendedblind", "description": "Venetian blinds that can be tilted. Venetian blinds must support an angle and specify the minimum and maximum supported angle. For instance, if a venetian blinds supports tilting from horizontal to vertical by 90°, the minValue should be set to 0° and the maxValue to 90°. For venetian blinds that support tilting both direction, that is, a total of 180°, the minValue should be -90° and the maxValue should be 90°. 0° is always the horizontal position.", + "extends": "extendedblind", "states": [ { "name": "angle", From 24ecbf4f79f630cc40439125bceaa058f7e18181 Mon Sep 17 00:00:00 2001 From: Michael Zanetti Date: Tue, 9 Jun 2020 14:59:11 +0200 Subject: [PATCH 3/3] int precision is enough for the angle Co-authored-by: Christian Fetzer --- libnymea/interfaces/venetianblind.json | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/libnymea/interfaces/venetianblind.json b/libnymea/interfaces/venetianblind.json index 51a3fa17..2facc9c9 100644 --- a/libnymea/interfaces/venetianblind.json +++ b/libnymea/interfaces/venetianblind.json @@ -1,13 +1,14 @@ { - "description": "Venetian blinds that can be tilted. Venetian blinds must support an angle and specify the minimum and maximum supported angle. For instance, if a venetian blinds supports tilting from horizontal to vertical by 90°, the minValue should be set to 0° and the maxValue to 90°. For venetian blinds that support tilting both direction, that is, a total of 180°, the minValue should be -90° and the maxValue should be 90°. 0° is always the horizontal position.", + "description": "Venetian blinds that can be tilted. Venetian blinds must support an angle and specify the minimum and maximum supported angle. For instance, if a venetian blinds supports tilting from horizontal to vertical by 90°, the minValue should be set to 0° and the maxValue to 90°. For venetian blinds that support tilting both direction, that is, a total of 180°, the minValue should be -90° and the maxValue should be 90°. 0° is always the horizontal position. Note that the \"moving\" state should be true when either the percentage or the angle are moving.", "extends": "extendedblind", "states": [ { "name": "angle", - "type": "double", - "unit": "UnitDegree", + "type": "int", + "unit": "Degree", "minValue": "any", - "maxValue": "any" + "maxValue": "any", + "writable": true } ] }