EVBox: Update EV charger interface to use double
parent
793a95636f
commit
d9b9a4a8bf
|
|
@ -259,7 +259,7 @@ void IntegrationPluginEVBox::executeAction(ThingActionInfo *info)
|
||||||
quint16 maxChargingCurrent = thing->stateValue("maxChargingCurrent").toUInt();
|
quint16 maxChargingCurrent = thing->stateValue("maxChargingCurrent").toUInt();
|
||||||
port->sendCommand(EVBoxPort::Command68, 60, power ? maxChargingCurrent : 0, serial);
|
port->sendCommand(EVBoxPort::Command68, 60, power ? maxChargingCurrent : 0, serial);
|
||||||
} else if (actionType.name() == "maxChargingCurrent") {
|
} 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);
|
port->sendCommand(EVBoxPort::Command68, 60, maxChargingCurrent, serial);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -279,7 +279,7 @@ void IntegrationPluginEVBox::finishPendingAction(Thing *thing)
|
||||||
if (actionType.name() == "power") {
|
if (actionType.name() == "power") {
|
||||||
thing->setStateValue("power", info->action().paramValue(actionType.id()));
|
thing->setStateValue("power", info->action().paramValue(actionType.id()));
|
||||||
} else if (actionType.name() == "maxChargingCurrent") {
|
} 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);
|
info->finish(Thing::ThingErrorNoError);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -56,11 +56,12 @@
|
||||||
"name": "maxChargingCurrent",
|
"name": "maxChargingCurrent",
|
||||||
"displayName": "Maximum charging current",
|
"displayName": "Maximum charging current",
|
||||||
"displayNameAction": "Set maximum charging current",
|
"displayNameAction": "Set maximum charging current",
|
||||||
"type": "uint",
|
"type": "double",
|
||||||
"writable": true,
|
"writable": true,
|
||||||
"unit": "Ampere",
|
"unit": "Ampere",
|
||||||
"minValue": "6",
|
"minValue": "6",
|
||||||
"maxValue": "32",
|
"maxValue": "32",
|
||||||
|
"stepSize": 1.0,
|
||||||
"defaultValue": 6
|
"defaultValue": 6
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
@ -157,11 +158,12 @@
|
||||||
"name": "maxChargingCurrent",
|
"name": "maxChargingCurrent",
|
||||||
"displayName": "Maximum charging current",
|
"displayName": "Maximum charging current",
|
||||||
"displayNameAction": "Set maximum charging current",
|
"displayNameAction": "Set maximum charging current",
|
||||||
"type": "uint",
|
"type": "double",
|
||||||
"writable": true,
|
"writable": true,
|
||||||
"unit": "Ampere",
|
"unit": "Ampere",
|
||||||
"minValue": "6",
|
"minValue": "6",
|
||||||
"maxValue": "32",
|
"maxValue": "32",
|
||||||
|
"stepSize": 1.0,
|
||||||
"defaultValue": 6
|
"defaultValue": 6
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue