From 652e9769fda82767560f2ae0651311867a7fc110 Mon Sep 17 00:00:00 2001 From: Michael Zanetti Date: Tue, 3 Sep 2019 18:49:05 +0200 Subject: [PATCH 1/3] Add account interface --- libnymea/interfaces/account.json | 4 ++++ libnymea/interfaces/gateway.json | 1 + libnymea/interfaces/interfaces.qrc | 2 +- 3 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 libnymea/interfaces/account.json diff --git a/libnymea/interfaces/account.json b/libnymea/interfaces/account.json new file mode 100644 index 00000000..a05f4186 --- /dev/null +++ b/libnymea/interfaces/account.json @@ -0,0 +1,4 @@ +{ + "description": "This is used to flag a thing that manages user a user account. It is similar to the gateway interface. For example, if there is a remote API that requires logging in but doesn't really offer any more functionality than that, this account shall be used. Such device classes usually will cause auto-devices implementing the actual features as child devices.", + "extends": "connectable" +} diff --git a/libnymea/interfaces/gateway.json b/libnymea/interfaces/gateway.json index 82c28534..9ae8633a 100644 --- a/libnymea/interfaces/gateway.json +++ b/libnymea/interfaces/gateway.json @@ -1,3 +1,4 @@ { + "description": "The gateway interface is used for gateway devices like bridges to other networks. For instance Ethernet to ZigBee bridges, Ethernet to RF bridges or similar. Typically such device classes implement the actual functionality in child devices that will auto-appear after successful connection to the gateway/bridge.", "extends": "connectable" } diff --git a/libnymea/interfaces/interfaces.qrc b/libnymea/interfaces/interfaces.qrc index 5d70e051..ff13c1f6 100644 --- a/libnymea/interfaces/interfaces.qrc +++ b/libnymea/interfaces/interfaces.qrc @@ -2,6 +2,7 @@ light.json dimmablelight.json + account.json daylightsensor.json colortemperaturelight.json colorlight.json @@ -69,5 +70,4 @@ extendednavigationpad.json closablesensor.json - From 26ab714a3f8957a849a1d01205646da56f6ab8f8 Mon Sep 17 00:00:00 2001 From: Michael Zanetti Date: Tue, 3 Sep 2019 18:59:13 +0200 Subject: [PATCH 2/3] Add loggedIn property --- libnymea/interfaces/account.json | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/libnymea/interfaces/account.json b/libnymea/interfaces/account.json index a05f4186..870bff48 100644 --- a/libnymea/interfaces/account.json +++ b/libnymea/interfaces/account.json @@ -1,4 +1,10 @@ { - "description": "This is used to flag a thing that manages user a user account. It is similar to the gateway interface. For example, if there is a remote API that requires logging in but doesn't really offer any more functionality than that, this account shall be used. Such device classes usually will cause auto-devices implementing the actual features as child devices.", - "extends": "connectable" + "description": "This is used to flag a thing that manages user a user account. It is similar to the gateway interface. For example, if there is a remote API that requires logging in but doesn't really offer any more functionality than that, this account shall be used. It inherits \"connectable\" which is used to flag if the remote server is unreachable. In addition, the \"loggedIn\" state indicates if the login fails. A client may reconfigure the device then to login again. Such device classes usually will cause auto-devices implementing the actual features as child devices.", + "extends": "connectable", + "states": [ + { + "name": "loggedIn", + "type": "bool" + } + ] } From 80aeee77ab24d17510d0210fb5bcb3fb4829cee9 Mon Sep 17 00:00:00 2001 From: Michael Zanetti Date: Tue, 3 Sep 2019 23:44:42 +0200 Subject: [PATCH 3/3] Add userDisplayName --- libnymea/interfaces/account.json | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/libnymea/interfaces/account.json b/libnymea/interfaces/account.json index 870bff48..539d7dec 100644 --- a/libnymea/interfaces/account.json +++ b/libnymea/interfaces/account.json @@ -1,10 +1,15 @@ { - "description": "This is used to flag a thing that manages user a user account. It is similar to the gateway interface. For example, if there is a remote API that requires logging in but doesn't really offer any more functionality than that, this account shall be used. It inherits \"connectable\" which is used to flag if the remote server is unreachable. In addition, the \"loggedIn\" state indicates if the login fails. A client may reconfigure the device then to login again. Such device classes usually will cause auto-devices implementing the actual features as child devices.", + "description": "This is used to flag a thing that manages user a user account. It is similar to the gateway interface. For example, if there is a remote API that requires logging in but doesn't really offer any more functionality than that, this account shall be used. It inherits \"connectable\" which is used to flag if the remote server is unreachable. In addition, the \"loggedIn\" state indicates if the login fails. While logged in, the \"userDisplayName\" state should give the user's name in a pretty printed form. A client may reconfigure the device then to login again. Such device classes usually will cause auto-devices implementing the actual features as child devices.", "extends": "connectable", "states": [ { "name": "loggedIn", "type": "bool" + }, + { + "name": "userDisplayName", + "type": "QString" } + ] }