From a7df2462507693d76a8bdb3522583cfe5c8b9d5c Mon Sep 17 00:00:00 2001 From: Bruce Eckstein Date: Thu, 4 Nov 2021 05:31:28 -0400 Subject: [PATCH] removed range checking on rlt and mtt as garadget preforms this check. if garadget should change their range in the future, as they have done between version 1.20 and 1.24, nymea will not limit what the user can enter. --- garadget/integrationplugingaradget.cpp | 10 +++++----- garadget/integrationplugingaradget.json | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/garadget/integrationplugingaradget.cpp b/garadget/integrationplugingaradget.cpp index 8528a2f2..386bce8e 100644 --- a/garadget/integrationplugingaradget.cpp +++ b/garadget/integrationplugingaradget.cpp @@ -141,7 +141,7 @@ void IntegrationPluginGaradget::executeAction(ThingActionInfo *info) QString conftype = ""; int actint = 0; if (action.actionTypeId() == garadgetSrtActionTypeId) { - if ( (action.paramValue(garadgetSrtActionSrtParamTypeId).toInt() > -1) and (action.paramValue(garadgetSrtActionSrtParamTypeId).toInt() < 81)) { + if (action.paramValue(garadgetSrtActionSrtParamTypeId).toInt() > -1) { actint = action.paramValue( garadgetSrtActionSrtParamTypeId).toInt(); conftype = "srt"; } else { @@ -150,8 +150,8 @@ void IntegrationPluginGaradget::executeAction(ThingActionInfo *info) } } if (action.actionTypeId() == garadgetMttActionTypeId) { - if ( (action.paramValue( garadgetMttActionMttParamTypeId).toInt() > 4) and (action.paramValue( garadgetMttActionMttParamTypeId).toInt() < 61) ){ - actint = action.paramValue( garadgetMttActionMttParamTypeId).toInt() * 1000; + if (action.paramValue( garadgetMttActionMttParamTypeId).toInt() > 0) { + actint = action.paramValue( garadgetMttActionMttParamTypeId).toInt(); conftype = "mtt"; } else { name = name + "/command"; @@ -159,7 +159,7 @@ void IntegrationPluginGaradget::executeAction(ThingActionInfo *info) } } if (action.actionTypeId() == garadgetRltActionTypeId) { - if ( (action.paramValue( garadgetRltActionRltParamTypeId).toInt() > 9) and (action.paramValue( garadgetRltActionRltParamTypeId).toInt() < 2001) ){ + if (action.paramValue( garadgetRltActionRltParamTypeId).toInt() > 0) { actint = action.paramValue(garadgetRltActionRltParamTypeId).toInt(); conftype = "rlt"; } else { @@ -246,7 +246,7 @@ void IntegrationPluginGaradget::publishReceived(const QString &topic, const QByt QJsonObject jo = jsonDoc.object(); thing->setStateValue(garadgetSrtStateTypeId,jo.value(QString("srt")).toInt()); thing->setStateValue(garadgetRltStateTypeId,jo.value(QString("rlt")).toInt()); - thing->setStateValue(garadgetMttStateTypeId,jo.value(QString("mtt")).toInt()/1000); + thing->setStateValue(garadgetMttStateTypeId,jo.value(QString("mtt")).toInt()); qCDebug(dcGaradget) << "System Configuration" << "srt =" << thing->stateValue(garadgetSrtStateTypeId).toInt() << "rlt =" << thing->stateValue(garadgetRltStateTypeId).toInt()<< "mtt =" << thing->stateValue(garadgetMttStateTypeId).toInt() * 1000; } if (topic.endsWith("/set-config")){ diff --git a/garadget/integrationplugingaradget.json b/garadget/integrationplugingaradget.json index 394989b1..f3b09691 100644 --- a/garadget/integrationplugingaradget.json +++ b/garadget/integrationplugingaradget.json @@ -97,7 +97,7 @@ { "id": "acda9268-4663-46d1-a409-231d648e6fc8" , "name": "mtt", - "displayName": "Door Moving Time in 5-60 Sec", + "displayName": "Door Moving Time 5000-60000 ms", "displayNameEvent": "Door Moving Time changed", "displayNameAction": "Set Door Moving Time value", "type": "int",