diff --git a/libnymea/interfaces/closable.json b/libnymea/interfaces/closable.json new file mode 100644 index 00000000..71e89f4c --- /dev/null +++ b/libnymea/interfaces/closable.json @@ -0,0 +1,17 @@ +{ + "states": [ + { + "name": "state", + "type": "String", + "allowedValues": ["open", "closed", "opening", "closing"] + } + ], + "actions": [ + { + "name": "open" + }, + { + "name": "close" + } + ] +} diff --git a/libnymea/interfaces/door.json b/libnymea/interfaces/door.json new file mode 100644 index 00000000..244e7153 --- /dev/null +++ b/libnymea/interfaces/door.json @@ -0,0 +1,14 @@ +{ + "extends": "closable", + "states": [ + { + "name": "latched", + "type": "bool" + } + ], + "actions": [ + { + "name": "unlatch" + } + ] +} diff --git a/libnymea/interfaces/garagegate.json b/libnymea/interfaces/garagegate.json index 819342ea..051f95b0 100644 --- a/libnymea/interfaces/garagegate.json +++ b/libnymea/interfaces/garagegate.json @@ -1,18 +1,12 @@ { + "extends": "closable", "states": [ { - "name": "gateState", - "type": "String", - "allowedValues": ["open", "closed", "intermediate", "opening", "closing"] + "name": "intermediatePosition", + "type": "bool" } ], "actions": [ - { - "name": "open" - }, - { - "name": "close" - }, { "name": "stop" }, diff --git a/libnymea/interfaces/interfaces.qrc b/libnymea/interfaces/interfaces.qrc index fca3439c..be88076a 100644 --- a/libnymea/interfaces/interfaces.qrc +++ b/libnymea/interfaces/interfaces.qrc @@ -27,6 +27,8 @@ inputtrigger.json outputtrigger.json power.json + closable.json + door.json