From 655e3a7f38b938d276f8044077be6515a5c8dda2 Mon Sep 17 00:00:00 2001 From: Michael Zanetti Date: Thu, 30 Jul 2020 17:21:13 +0200 Subject: [PATCH 1/4] Rework garage door interfaces --- libnymea/interfaces/extendedclosable.json | 3 ++- libnymea/interfaces/extendedstatefulgaragedoor.json | 11 +++++++++++ libnymea/interfaces/garagedoor.json | 3 +++ libnymea/interfaces/garagegate.json | 3 ++- libnymea/interfaces/impulsegaragedoor.json | 9 +++++++++ libnymea/interfaces/statefulgaragedoor.json | 11 +++++++++++ 6 files changed, 38 insertions(+), 2 deletions(-) create mode 100644 libnymea/interfaces/extendedstatefulgaragedoor.json create mode 100644 libnymea/interfaces/garagedoor.json create mode 100644 libnymea/interfaces/impulsegaragedoor.json create mode 100644 libnymea/interfaces/statefulgaragedoor.json diff --git a/libnymea/interfaces/extendedclosable.json b/libnymea/interfaces/extendedclosable.json index c6c72663..d5ca5085 100644 --- a/libnymea/interfaces/extendedclosable.json +++ b/libnymea/interfaces/extendedclosable.json @@ -10,7 +10,8 @@ "name": "percentage", "type": "int", "minimumValue": 0, - "maximumValue": 100 + "maximumValue": 100, + "writable": true } ] } diff --git a/libnymea/interfaces/extendedstatefulgaragedoor.json b/libnymea/interfaces/extendedstatefulgaragedoor.json new file mode 100644 index 00000000..f618bd11 --- /dev/null +++ b/libnymea/interfaces/extendedstatefulgaragedoor.json @@ -0,0 +1,11 @@ +{ + "description": "A garage door which can be controlled like an extended closable, that is, by reporting and taking a percentage of the position", + "extends": ["garagedoor", "extendedclosable"], + "states": [ + { + "name": "state", + "type": "QString", + "allowedValues": ["open", "closed", "opening", "closing", "intermediate"] + } + ] +} diff --git a/libnymea/interfaces/garagedoor.json b/libnymea/interfaces/garagedoor.json new file mode 100644 index 00000000..9e34542d --- /dev/null +++ b/libnymea/interfaces/garagedoor.json @@ -0,0 +1,3 @@ +{ + "description": "The base for all garage door interfaces. Can be used by the client to filter for garage doors in the system." +} diff --git a/libnymea/interfaces/garagegate.json b/libnymea/interfaces/garagegate.json index 615104c2..e692e7e9 100644 --- a/libnymea/interfaces/garagegate.json +++ b/libnymea/interfaces/garagegate.json @@ -1,5 +1,6 @@ { - "extends": "closable", + "deprecated": "Use statefulgaragedoor instead", + "extends": ["garagedoor", "closable"], "states": [ { "name": "state", diff --git a/libnymea/interfaces/impulsegaragedoor.json b/libnymea/interfaces/impulsegaragedoor.json new file mode 100644 index 00000000..15155c3c --- /dev/null +++ b/libnymea/interfaces/impulsegaragedoor.json @@ -0,0 +1,9 @@ +{ + "extends": "garagedoor", + "description": "This interface is for the simplest form of garage doors which can be controlled only via an impulse. Triggering the impulse will start moving the door, triggering it again will stop the movement. Triggering it yet another time will start movement in the reverse direction. Note that there is no feedback channel on such devices. The system has no chance of knowing the current state this device is actually in.", + "actions": [ + { + "name": "triggerImpulse" + } + ] +} diff --git a/libnymea/interfaces/statefulgaragedoor.json b/libnymea/interfaces/statefulgaragedoor.json new file mode 100644 index 00000000..cd0c9ecb --- /dev/null +++ b/libnymea/interfaces/statefulgaragedoor.json @@ -0,0 +1,11 @@ +{ + "description": "A garagedoor which can be controller like a closable, with open and close actions. It can report whether it's opened or closed or standing still something in between (intermediate position) as well as reporting that it's moving (opening/closing).", + "extends": ["garagedoor", "closable"], + "states": [ + { + "name": "state", + "type": "QString", + "allowedValues": ["open", "closed", "opening", "closing", "intermediate"] + } + ] +} From dfb62108fe146657fb3bf5b379cf8eb7d90abf9a Mon Sep 17 00:00:00 2001 From: Michael Zanetti Date: Fri, 31 Jul 2020 17:22:06 +0200 Subject: [PATCH 2/4] inherit properly --- libnymea/interfaces/extendedstatefulgaragedoor.json | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/libnymea/interfaces/extendedstatefulgaragedoor.json b/libnymea/interfaces/extendedstatefulgaragedoor.json index f618bd11..088cdfc6 100644 --- a/libnymea/interfaces/extendedstatefulgaragedoor.json +++ b/libnymea/interfaces/extendedstatefulgaragedoor.json @@ -1,11 +1,4 @@ { "description": "A garage door which can be controlled like an extended closable, that is, by reporting and taking a percentage of the position", - "extends": ["garagedoor", "extendedclosable"], - "states": [ - { - "name": "state", - "type": "QString", - "allowedValues": ["open", "closed", "opening", "closing", "intermediate"] - } - ] + "extends": ["statefulgaragedoor", "extendedclosable"] } From f66c3c4a606e6d611d9d47dc75046bf975d3dfad Mon Sep 17 00:00:00 2001 From: Michael Zanetti Date: Fri, 31 Jul 2020 17:42:51 +0200 Subject: [PATCH 3/4] add new interfaces to qrc --- libnymea/interfaces/interfaces.qrc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libnymea/interfaces/interfaces.qrc b/libnymea/interfaces/interfaces.qrc index 3fc8c284..17be9710 100644 --- a/libnymea/interfaces/interfaces.qrc +++ b/libnymea/interfaces/interfaces.qrc @@ -8,6 +8,10 @@ colortemperaturelight.json doorbell.json colorlight.json + garagedoor.json + impulsegaragedoor.json + statefulgaragedoor.json + extendedstatefulgaragedoor.json garagegate.json gateway.json notifications.json From 075046ff70593a654c8fec143e5148905446ab00 Mon Sep 17 00:00:00 2001 From: Michael Zanetti Date: Sat, 1 Aug 2020 00:26:22 +0200 Subject: [PATCH 4/4] Add simplegaragedoor --- libnymea/interfaces/interfaces.qrc | 1 + libnymea/interfaces/simplegaragedoor.json | 4 ++++ 2 files changed, 5 insertions(+) create mode 100644 libnymea/interfaces/simplegaragedoor.json diff --git a/libnymea/interfaces/interfaces.qrc b/libnymea/interfaces/interfaces.qrc index 17be9710..188c79a9 100644 --- a/libnymea/interfaces/interfaces.qrc +++ b/libnymea/interfaces/interfaces.qrc @@ -10,6 +10,7 @@ colorlight.json garagedoor.json impulsegaragedoor.json + simplegaragedoor.json statefulgaragedoor.json extendedstatefulgaragedoor.json garagegate.json diff --git a/libnymea/interfaces/simplegaragedoor.json b/libnymea/interfaces/simplegaragedoor.json new file mode 100644 index 00000000..657394d6 --- /dev/null +++ b/libnymea/interfaces/simplegaragedoor.json @@ -0,0 +1,4 @@ +{ + "description": "A Garage door that can take up and down as commands but cannot provide state information", + "extends": ["garagedoor", "closable"] +}