added outputs to shadings
This commit is contained in:
parent
dd465cc6ca
commit
9bda2e8e0d
@ -1,3 +1,4 @@
|
|||||||
|
|
||||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||||
* *
|
* *
|
||||||
* Copyright (C) 2019 Bernhard Trinnes <bernhard.trinnes@nymea.io *
|
* Copyright (C) 2019 Bernhard Trinnes <bernhard.trinnes@nymea.io *
|
||||||
@ -84,12 +85,18 @@ DeviceManager::DeviceError DevicePluginGenericInterfaces::executeAction(Device *
|
|||||||
{
|
{
|
||||||
if (device->deviceClassId() == awningDeviceClassId) {
|
if (device->deviceClassId() == awningDeviceClassId) {
|
||||||
if (action.actionTypeId() == awningOpenActionTypeId) {
|
if (action.actionTypeId() == awningOpenActionTypeId) {
|
||||||
|
device->setStateValue(awningClosingOutputStateTypeId, false);
|
||||||
|
device->setStateValue(awningOpeningOutputStateTypeId, true);
|
||||||
return DeviceManager::DeviceErrorNoError;
|
return DeviceManager::DeviceErrorNoError;
|
||||||
}
|
}
|
||||||
if (action.actionTypeId() == awningStopActionTypeId) {
|
if (action.actionTypeId() == awningStopActionTypeId) {
|
||||||
|
device->setStateValue(awningOpeningOutputStateTypeId, false);
|
||||||
|
device->setStateValue(awningClosingOutputStateTypeId, false);
|
||||||
return DeviceManager::DeviceErrorNoError;
|
return DeviceManager::DeviceErrorNoError;
|
||||||
}
|
}
|
||||||
if (action.actionTypeId() == awningCloseActionTypeId) {
|
if (action.actionTypeId() == awningCloseActionTypeId) {
|
||||||
|
device->setStateValue(awningOpeningOutputStateTypeId, false);
|
||||||
|
device->setStateValue(awningClosingOutputStateTypeId, true);
|
||||||
return DeviceManager::DeviceErrorNoError;
|
return DeviceManager::DeviceErrorNoError;
|
||||||
}
|
}
|
||||||
return DeviceManager::DeviceErrorActionTypeNotFound;
|
return DeviceManager::DeviceErrorActionTypeNotFound;
|
||||||
@ -97,12 +104,18 @@ DeviceManager::DeviceError DevicePluginGenericInterfaces::executeAction(Device *
|
|||||||
|
|
||||||
if (device->deviceClassId() == blindDeviceClassId ) {
|
if (device->deviceClassId() == blindDeviceClassId ) {
|
||||||
if (action.actionTypeId() == blindOpenActionTypeId) {
|
if (action.actionTypeId() == blindOpenActionTypeId) {
|
||||||
|
device->setStateValue(blindClosingOutputStateTypeId, false);
|
||||||
|
device->setStateValue(blindOpeningOutputStateTypeId, true);
|
||||||
return DeviceManager::DeviceErrorNoError;
|
return DeviceManager::DeviceErrorNoError;
|
||||||
}
|
}
|
||||||
if (action.actionTypeId() == blindStopActionTypeId) {
|
if (action.actionTypeId() == blindStopActionTypeId) {
|
||||||
|
device->setStateValue(blindOpeningOutputStateTypeId, false);
|
||||||
|
device->setStateValue(blindClosingOutputStateTypeId, false);
|
||||||
return DeviceManager::DeviceErrorNoError;
|
return DeviceManager::DeviceErrorNoError;
|
||||||
}
|
}
|
||||||
if (action.actionTypeId() == blindCloseActionTypeId) {
|
if (action.actionTypeId() == blindCloseActionTypeId) {
|
||||||
|
device->setStateValue(blindOpeningOutputStateTypeId, false);
|
||||||
|
device->setStateValue(blindClosingOutputStateTypeId, true);
|
||||||
return DeviceManager::DeviceErrorNoError;
|
return DeviceManager::DeviceErrorNoError;
|
||||||
}
|
}
|
||||||
return DeviceManager::DeviceErrorActionTypeNotFound;
|
return DeviceManager::DeviceErrorActionTypeNotFound;
|
||||||
@ -110,25 +123,18 @@ DeviceManager::DeviceError DevicePluginGenericInterfaces::executeAction(Device *
|
|||||||
|
|
||||||
if (device->deviceClassId() == shutterDeviceClassId) {
|
if (device->deviceClassId() == shutterDeviceClassId) {
|
||||||
if (action.actionTypeId() == shutterOpenActionTypeId) {
|
if (action.actionTypeId() == shutterOpenActionTypeId) {
|
||||||
|
device->setStateValue(shutterClosingOutputStateTypeId, false);
|
||||||
|
device->setStateValue(shutterOpeningOutputStateTypeId, true);
|
||||||
return DeviceManager::DeviceErrorNoError;
|
return DeviceManager::DeviceErrorNoError;
|
||||||
}
|
}
|
||||||
if (action.actionTypeId() == shutterStopActionTypeId) {
|
if (action.actionTypeId() == shutterStopActionTypeId) {
|
||||||
|
device->setStateValue(shutterOpeningOutputStateTypeId, false);
|
||||||
|
device->setStateValue(shutterClosingOutputStateTypeId, false);
|
||||||
return DeviceManager::DeviceErrorNoError;
|
return DeviceManager::DeviceErrorNoError;
|
||||||
}
|
}
|
||||||
if (action.actionTypeId() == shutterCloseActionTypeId) {
|
if (action.actionTypeId() == shutterCloseActionTypeId) {
|
||||||
return DeviceManager::DeviceErrorNoError;
|
device->setStateValue(shutterOpeningOutputStateTypeId, false);
|
||||||
}
|
device->setStateValue(shutterClosingOutputStateTypeId, true);
|
||||||
return DeviceManager::DeviceErrorActionTypeNotFound;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (device->deviceClassId() == awningDeviceClassId) {
|
|
||||||
if (action.actionTypeId() == awningOpenActionTypeId) {
|
|
||||||
return DeviceManager::DeviceErrorNoError;
|
|
||||||
}
|
|
||||||
if (action.actionTypeId() == awningStopActionTypeId) {
|
|
||||||
return DeviceManager::DeviceErrorNoError;
|
|
||||||
}
|
|
||||||
if (action.actionTypeId() == awningCloseActionTypeId) {
|
|
||||||
return DeviceManager::DeviceErrorNoError;
|
return DeviceManager::DeviceErrorNoError;
|
||||||
}
|
}
|
||||||
return DeviceManager::DeviceErrorActionTypeNotFound;
|
return DeviceManager::DeviceErrorActionTypeNotFound;
|
||||||
|
|||||||
@ -14,6 +14,24 @@
|
|||||||
"displayName": "Awning",
|
"displayName": "Awning",
|
||||||
"createMethods": ["user"],
|
"createMethods": ["user"],
|
||||||
"interfaces": ["awning"],
|
"interfaces": ["awning"],
|
||||||
|
"stateTypes": [
|
||||||
|
{
|
||||||
|
"id": "7cda95f1-beb8-464e-aa75-ef415ed6744c",
|
||||||
|
"name": "openingOutput",
|
||||||
|
"displayName": "Opening output",
|
||||||
|
"displayNameEvent": "Opening output changed",
|
||||||
|
"type": "bool",
|
||||||
|
"defaultValue": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "9b673430-572d-4a9c-85d3-dafadbe541cd",
|
||||||
|
"name": "closingOutput",
|
||||||
|
"displayName": "Closing output",
|
||||||
|
"displayNameEvent": "Closing output changed",
|
||||||
|
"type": "bool",
|
||||||
|
"defaultValue": false
|
||||||
|
}
|
||||||
|
],
|
||||||
"actionTypes": [
|
"actionTypes": [
|
||||||
{
|
{
|
||||||
"id": "979e9c51-5a93-4635-85e3-01874306b229",
|
"id": "979e9c51-5a93-4635-85e3-01874306b229",
|
||||||
@ -38,6 +56,24 @@
|
|||||||
"displayName": "Blind",
|
"displayName": "Blind",
|
||||||
"createMethods": ["user"],
|
"createMethods": ["user"],
|
||||||
"interfaces": ["blind"],
|
"interfaces": ["blind"],
|
||||||
|
"stateTypes": [
|
||||||
|
{
|
||||||
|
"id": "7cda95f1-beb8-464e-aa75-ef415ed6744c",
|
||||||
|
"name": "openingOutput",
|
||||||
|
"displayName": "Opening output",
|
||||||
|
"displayNameEvent": "Opening output changed",
|
||||||
|
"type": "bool",
|
||||||
|
"defaultValue": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "9b673430-572d-4a9c-85d3-dafadbe541cd",
|
||||||
|
"name": "closingOutput",
|
||||||
|
"displayName": "Closing output",
|
||||||
|
"displayNameEvent": "Closing output changed",
|
||||||
|
"type": "bool",
|
||||||
|
"defaultValue": false
|
||||||
|
}
|
||||||
|
],
|
||||||
"actionTypes": [
|
"actionTypes": [
|
||||||
{
|
{
|
||||||
"id": "120dc265-dbbb-4f19-9d31-c372c23479c0",
|
"id": "120dc265-dbbb-4f19-9d31-c372c23479c0",
|
||||||
@ -62,6 +98,24 @@
|
|||||||
"displayName": "Shutter",
|
"displayName": "Shutter",
|
||||||
"createMethods": ["user"],
|
"createMethods": ["user"],
|
||||||
"interfaces": ["shutter"],
|
"interfaces": ["shutter"],
|
||||||
|
"stateTypes": [
|
||||||
|
{
|
||||||
|
"id": "7cda95f1-beb8-464e-aa75-ef415ed6744c",
|
||||||
|
"name": "openingOutput",
|
||||||
|
"displayName": "Opening output",
|
||||||
|
"displayNameEvent": "Opening output changed",
|
||||||
|
"type": "bool",
|
||||||
|
"defaultValue": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "9b673430-572d-4a9c-85d3-dafadbe541cd",
|
||||||
|
"name": "closingOutput",
|
||||||
|
"displayName": "Closing output",
|
||||||
|
"displayNameEvent": "Closing output changed",
|
||||||
|
"type": "bool",
|
||||||
|
"defaultValue": false
|
||||||
|
}
|
||||||
|
],
|
||||||
"actionTypes": [
|
"actionTypes": [
|
||||||
{
|
{
|
||||||
"id": "9deb662d-2378-4345-a898-8742d41e43c1",
|
"id": "9deb662d-2378-4345-a898-8742d41e43c1",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user