diff --git a/evbox/integrationpluginevbox.cpp b/evbox/integrationpluginevbox.cpp index c608b3bd..ce5a4b51 100644 --- a/evbox/integrationpluginevbox.cpp +++ b/evbox/integrationpluginevbox.cpp @@ -259,7 +259,7 @@ void IntegrationPluginEVBox::executeAction(ThingActionInfo *info) quint16 maxChargingCurrent = thing->stateValue("maxChargingCurrent").toUInt(); port->sendCommand(EVBoxPort::Command68, 60, power ? maxChargingCurrent : 0, serial); } else if (actionType.name() == "maxChargingCurrent") { - int maxChargingCurrent = info->action().paramValue(actionType.id()).toInt(); + int maxChargingCurrent = qRound(info->action().paramValue(actionType.id()).toDouble()); port->sendCommand(EVBoxPort::Command68, 60, maxChargingCurrent, serial); } @@ -279,7 +279,7 @@ void IntegrationPluginEVBox::finishPendingAction(Thing *thing) if (actionType.name() == "power") { thing->setStateValue("power", info->action().paramValue(actionType.id())); } else if (actionType.name() == "maxChargingCurrent") { - thing->setStateValue("maxChargingCurrent", info->action().paramValue(actionType.id())); + thing->setStateValue("maxChargingCurrent", qRound(info->action().paramValue(actionType.id()).toDouble())); } info->finish(Thing::ThingErrorNoError); } diff --git a/evbox/integrationpluginevbox.json b/evbox/integrationpluginevbox.json index 85284dd5..ed81f116 100644 --- a/evbox/integrationpluginevbox.json +++ b/evbox/integrationpluginevbox.json @@ -56,11 +56,12 @@ "name": "maxChargingCurrent", "displayName": "Maximum charging current", "displayNameAction": "Set maximum charging current", - "type": "uint", + "type": "double", "writable": true, "unit": "Ampere", "minValue": "6", "maxValue": "32", + "stepSize": 1.0, "defaultValue": 6 }, { @@ -157,11 +158,12 @@ "name": "maxChargingCurrent", "displayName": "Maximum charging current", "displayNameAction": "Set maximum charging current", - "type": "uint", + "type": "double", "writable": true, "unit": "Ampere", "minValue": "6", "maxValue": "32", + "stepSize": 1.0, "defaultValue": 6 }, {