Sensors: Update gas sensor to changes in interface
parent
b3489fd5c3
commit
9ccfb6b29c
|
|
@ -205,7 +205,7 @@ void IntegrationPluginGenericSensors::executeAction(ThingActionInfo *info)
|
||||||
double newValue = mapDoubleValue(value, 0, 100, min, max);
|
double newValue = mapDoubleValue(value, 0, 100, min, max);
|
||||||
double roundingFactor = qPow(10, info->thing()->setting(gasSensorSettingsAccuracyParamTypeId).toInt());
|
double roundingFactor = qPow(10, info->thing()->setting(gasSensorSettingsAccuracyParamTypeId).toInt());
|
||||||
newValue = qRound(newValue * roundingFactor) / roundingFactor;
|
newValue = qRound(newValue * roundingFactor) / roundingFactor;
|
||||||
thing->setStateValue(gasSensorGasStateTypeId, newValue);
|
thing->setStateValue(gasSensorGasLevelStateTypeId, newValue);
|
||||||
info->finish(Thing::ThingErrorNoError);
|
info->finish(Thing::ThingErrorNoError);
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -570,7 +570,7 @@
|
||||||
"stateTypes": [
|
"stateTypes": [
|
||||||
{
|
{
|
||||||
"id": "5135648f-57b7-44b0-b9d0-c5accad09356",
|
"id": "5135648f-57b7-44b0-b9d0-c5accad09356",
|
||||||
"name": "gas",
|
"name": "gasLevel",
|
||||||
"displayName": "Gas level",
|
"displayName": "Gas level",
|
||||||
"displayNameEvent": "Gas level changed",
|
"displayNameEvent": "Gas level changed",
|
||||||
"type": "double",
|
"type": "double",
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue