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);
|
device->setStateValue(evChargerPowerStateTypeId, power);
|
||||||
return DeviceManager::DeviceErrorNoError;
|
return DeviceManager::DeviceErrorNoError;
|
||||||
|
|
||||||
} else if(action.actionTypeId() == evChargerPercentageActionTypeId){
|
} else if(action.actionTypeId() == evChargerMaxChargingCurrentActionTypeId){
|
||||||
// get the param value
|
// get the param value
|
||||||
Param currentParam = action.param(evChargerPercentageActionPercentageParamTypeId);
|
Param maxChargeParam = action.param(evChargerMaxChargingCurrentActionMaxChargingCurrentParamTypeId);
|
||||||
int percentage = currentParam.value().toInt();
|
uint maxCharge = maxChargeParam.value().toInt();
|
||||||
qCDebug(dcSimulation()) << "Set percentage" << percentage << "for EV Charger device" << device->name();
|
qCDebug(dcSimulation()) << "Set maximum charging current to" << maxCharge << "for EV Charger device" << device->name();
|
||||||
device->setStateValue(evChargerPercentageStateTypeId, percentage);
|
device->setStateValue(evChargerMaxChargingCurrentStateTypeId, maxCharge);
|
||||||
return DeviceManager::DeviceErrorNoError;
|
return DeviceManager::DeviceErrorNoError;
|
||||||
}
|
}
|
||||||
return DeviceManager::DeviceErrorActionTypeNotFound;
|
return DeviceManager::DeviceErrorActionTypeNotFound;
|
||||||
|
|
|
||||||
|
|
@ -231,14 +231,15 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "87600986-da37-4032-af37-015995910368",
|
"id": "87600986-da37-4032-af37-015995910368",
|
||||||
"name": "percentage",
|
"name": "maxChargingCurrent",
|
||||||
"displayName": "Percentage",
|
"displayName": "Maximum charging current",
|
||||||
"displayNameEvent": "Percentage changed",
|
"displayNameEvent": "MAximum charging current changed",
|
||||||
"displayNameAction": "Set percentage",
|
"displayNameAction": "Set maximum charging current",
|
||||||
"type": "int",
|
"type": "uint",
|
||||||
"minValue": 0,
|
"unit": "MilliAmpere",
|
||||||
"maxValue": 100,
|
"defaultValue": 0,
|
||||||
"defaultValue": 100,
|
"minValue": 6000,
|
||||||
|
"maxValue": 80000,
|
||||||
"writable": true
|
"writable": true
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue