Make minimal charging current writable and update the state value on action executed
This commit is contained in:
parent
0382d2f70c
commit
d22f741909
@ -899,6 +899,9 @@ void IntegrationPluginGenericThings::executeAction(ThingActionInfo *info)
|
|||||||
thing->setStateValue(carBatteryLevelStateTypeId, action.paramValue(carBatteryLevelActionBatteryLevelParamTypeId));
|
thing->setStateValue(carBatteryLevelStateTypeId, action.paramValue(carBatteryLevelActionBatteryLevelParamTypeId));
|
||||||
thing->setStateValue(carBatteryCriticalStateTypeId, action.paramValue(carBatteryLevelActionBatteryLevelParamTypeId).toInt() < 10);
|
thing->setStateValue(carBatteryCriticalStateTypeId, action.paramValue(carBatteryLevelActionBatteryLevelParamTypeId).toInt() < 10);
|
||||||
info->finish(Thing::ThingErrorNoError);
|
info->finish(Thing::ThingErrorNoError);
|
||||||
|
} else if (action.actionTypeId() == carMinimalChargingCurrentActionTypeId) {
|
||||||
|
thing->setStateValue(carMinimalChargingCurrentStateTypeId, action.paramValue(carMinimalChargingCurrentActionMinimalChargingCurrentParamTypeId).toUInt());
|
||||||
|
info->finish(Thing::ThingErrorNoError);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Q_ASSERT_X(false, "executeAction", QString("Unhandled thingClassId: %1").arg(thing->thingClassId().toString()).toUtf8());
|
Q_ASSERT_X(false, "executeAction", QString("Unhandled thingClassId: %1").arg(thing->thingClassId().toString()).toUtf8());
|
||||||
|
|||||||
@ -1819,6 +1819,7 @@
|
|||||||
"name": "minimalChargingCurrent",
|
"name": "minimalChargingCurrent",
|
||||||
"displayName": "Minimal charging current",
|
"displayName": "Minimal charging current",
|
||||||
"displayNameEvent": "Minimal charging current changed",
|
"displayNameEvent": "Minimal charging current changed",
|
||||||
|
"displayNameAction": "Set minimal charging current",
|
||||||
"type": "uint",
|
"type": "uint",
|
||||||
"unit": "Ampere",
|
"unit": "Ampere",
|
||||||
"writable": true,
|
"writable": true,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user