Simulation: Update ev charger to new interface spec
parent
65e9d98510
commit
37fff92942
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
]
|
||||
|
|
|
|||
Loading…
Reference in New Issue