Webasto: Update EV charger interface and add full charging current resolution
parent
a7d900e516
commit
2aed3d0f61
|
|
@ -513,7 +513,7 @@ void IntegrationPluginWebasto::executeAction(ThingActionInfo *info)
|
||||||
m_asyncActions.insert(requestId, info);
|
m_asyncActions.insert(requestId, info);
|
||||||
}
|
}
|
||||||
} else if (action.actionTypeId() == webastoLiveMaxChargingCurrentActionTypeId) {
|
} else if (action.actionTypeId() == webastoLiveMaxChargingCurrentActionTypeId) {
|
||||||
int ampere = action.paramValue(webastoLiveMaxChargingCurrentActionMaxChargingCurrentParamTypeId).toUInt();
|
quint16 ampere = static_cast<quint16>(qRound(action.paramValue(webastoLiveMaxChargingCurrentActionMaxChargingCurrentParamTypeId).toDouble()));
|
||||||
thing->setStateValue(webastoLiveMaxChargingCurrentStateTypeId, ampere);
|
thing->setStateValue(webastoLiveMaxChargingCurrentStateTypeId, ampere);
|
||||||
QUuid requestId = connection->setChargeCurrent(ampere);
|
QUuid requestId = connection->setChargeCurrent(ampere);
|
||||||
if (requestId.isNull()) {
|
if (requestId.isNull()) {
|
||||||
|
|
@ -571,7 +571,7 @@ void IntegrationPluginWebasto::executeAction(ThingActionInfo *info)
|
||||||
executeWebastoNextPowerAction(info, power);
|
executeWebastoNextPowerAction(info, power);
|
||||||
}
|
}
|
||||||
} else if (action.actionTypeId() == webastoNextMaxChargingCurrentActionTypeId) {
|
} else if (action.actionTypeId() == webastoNextMaxChargingCurrentActionTypeId) {
|
||||||
quint16 chargingCurrent = action.paramValue(webastoNextMaxChargingCurrentActionMaxChargingCurrentParamTypeId).toUInt();
|
quint16 chargingCurrent = static_cast<quint16>(qRound(action.paramValue(webastoNextMaxChargingCurrentActionMaxChargingCurrentParamTypeId).toDouble()));
|
||||||
qCDebug(dcWebasto()) << "Set max charging current of" << thing << "to" << chargingCurrent << "ampere";
|
qCDebug(dcWebasto()) << "Set max charging current of" << thing << "to" << chargingCurrent << "ampere";
|
||||||
QModbusReply *reply = connection->setChargeCurrent(chargingCurrent);
|
QModbusReply *reply = connection->setChargeCurrent(chargingCurrent);
|
||||||
connect(reply, &QModbusReply::finished, reply, &QModbusReply::deleteLater);
|
connect(reply, &QModbusReply::finished, reply, &QModbusReply::deleteLater);
|
||||||
|
|
@ -620,7 +620,7 @@ void IntegrationPluginWebasto::executeAction(ThingActionInfo *info)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (info->action().actionTypeId() == webastoUniteMaxChargingCurrentActionTypeId) {
|
if (info->action().actionTypeId() == webastoUniteMaxChargingCurrentActionTypeId) {
|
||||||
int maxChargingCurrent = info->action().paramValue(webastoUniteMaxChargingCurrentActionMaxChargingCurrentParamTypeId).toInt();
|
quint16 maxChargingCurrent = static_cast<quint16>(qRound(info->action().paramValue(webastoUniteMaxChargingCurrentActionMaxChargingCurrentParamTypeId).toDouble()));
|
||||||
QModbusReply *reply = evc04Connection->setChargingCurrent(maxChargingCurrent);
|
QModbusReply *reply = evc04Connection->setChargingCurrent(maxChargingCurrent);
|
||||||
connect(reply, &QModbusReply::finished, info, [info, reply, maxChargingCurrent](){
|
connect(reply, &QModbusReply::finished, info, [info, reply, maxChargingCurrent](){
|
||||||
if (reply->error() == QModbusDevice::NoError) {
|
if (reply->error() == QModbusDevice::NoError) {
|
||||||
|
|
|
||||||
|
|
@ -96,10 +96,11 @@
|
||||||
"name": "maxChargingCurrent",
|
"name": "maxChargingCurrent",
|
||||||
"displayName": "Charging current",
|
"displayName": "Charging current",
|
||||||
"displayNameAction": "Set charging current",
|
"displayNameAction": "Set charging current",
|
||||||
"type": "uint",
|
"type": "double",
|
||||||
"unit": "Ampere",
|
"unit": "Ampere",
|
||||||
"minValue": 6,
|
"minValue": 6,
|
||||||
"maxValue": 80,
|
"maxValue": 80,
|
||||||
|
"stepSize": 1.0,
|
||||||
"defaultValue": 6,
|
"defaultValue": 6,
|
||||||
"writable": true
|
"writable": true
|
||||||
},
|
},
|
||||||
|
|
@ -297,10 +298,11 @@
|
||||||
"name": "maxChargingCurrent",
|
"name": "maxChargingCurrent",
|
||||||
"displayName": "Charging current",
|
"displayName": "Charging current",
|
||||||
"displayNameAction": "Set charging current",
|
"displayNameAction": "Set charging current",
|
||||||
"type": "uint",
|
"type": "double",
|
||||||
"unit": "Ampere",
|
"unit": "Ampere",
|
||||||
"minValue": 6,
|
"minValue": 6,
|
||||||
"maxValue": 32,
|
"maxValue": 32,
|
||||||
|
"stepSize": 1.0,
|
||||||
"defaultValue": 6,
|
"defaultValue": 6,
|
||||||
"writable": true
|
"writable": true
|
||||||
},
|
},
|
||||||
|
|
@ -569,10 +571,11 @@
|
||||||
"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",
|
||||||
"unit": "Ampere",
|
"unit": "Ampere",
|
||||||
"minValue": 6,
|
"minValue": 6,
|
||||||
"maxValue": 32,
|
"maxValue": 32,
|
||||||
|
"stepSize": 1.0,
|
||||||
"defaultValue": 6,
|
"defaultValue": 6,
|
||||||
"writable": true
|
"writable": true
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue