Simulation: Update ev charger to new interface spec

master
Michael Zanetti 2019-02-15 16:40:58 +01:00
parent 65e9d98510
commit 37fff92942
2 changed files with 14 additions and 13 deletions

View File

@ -155,12 +155,12 @@ DeviceManager::DeviceError DevicePluginSimulation::executeAction(Device *device,
device->setStateValue(evChargerPowerStateTypeId, power);
return DeviceManager::DeviceErrorNoError;
} else if(action.actionTypeId() == evChargerPercentageActionTypeId){
} else if(action.actionTypeId() == evChargerMaxChargingCurrentActionTypeId){
// get the param value
Param currentParam = action.param(evChargerPercentageActionPercentageParamTypeId);
int percentage = currentParam.value().toInt();
qCDebug(dcSimulation()) << "Set percentage" << percentage << "for EV Charger device" << device->name();
device->setStateValue(evChargerPercentageStateTypeId, percentage);
Param maxChargeParam = action.param(evChargerMaxChargingCurrentActionMaxChargingCurrentParamTypeId);
uint maxCharge = maxChargeParam.value().toInt();
qCDebug(dcSimulation()) << "Set maximum charging current to" << maxCharge << "for EV Charger device" << device->name();
device->setStateValue(evChargerMaxChargingCurrentStateTypeId, maxCharge);
return DeviceManager::DeviceErrorNoError;
}
return DeviceManager::DeviceErrorActionTypeNotFound;

View File

@ -231,14 +231,15 @@
},
{
"id": "87600986-da37-4032-af37-015995910368",
"name": "percentage",
"displayName": "Percentage",
"displayNameEvent": "Percentage changed",
"displayNameAction": "Set percentage",
"type": "int",
"minValue": 0,
"maxValue": 100,
"defaultValue": 100,
"name": "maxChargingCurrent",
"displayName": "Maximum charging current",
"displayNameEvent": "MAximum charging current changed",
"displayNameAction": "Set maximum charging current",
"type": "uint",
"unit": "MilliAmpere",
"defaultValue": 0,
"minValue": 6000,
"maxValue": 80000,
"writable": true
}
]