Update state, use curr and update to latest interface

master
Simon Stürz 2021-10-20 15:22:07 +02:00
parent e7775e46ef
commit 175143c2ff
2 changed files with 9 additions and 29 deletions

View File

@ -280,6 +280,8 @@ void IntegrationPluginKeba::setDeviceState(Thing *thing, KeContact::State state)
thing->setStateValue(wallboxActivityStateTypeId, "Authorization rejected");
break;
}
thing->setStateValue(wallboxChargingStateTypeId, state == KeContact::StateCharging);
}
void IntegrationPluginKeba::setDevicePlugState(Thing *thing, KeContact::PlugState plugState)
@ -421,13 +423,11 @@ void IntegrationPluginKeba::onReportTwoReceived(const KeContact::ReportTwo &repo
thing->setStateValue(wallboxError2StateTypeId, reportTwo.error2);
thing->setStateValue(wallboxSystemEnabledStateTypeId, reportTwo.enableSys);
thing->setStateValue(wallboxMaxChargingCurrentStateTypeId, reportTwo.currTimer);
thing->setStateValue(wallboxMaxChargingCurrentGeneralStateTypeId, reportTwo.currentUser);
thing->setStateValue(wallboxMaxChargingCurrentStateTypeId, reportTwo.currentUser);
thing->setStateValue(wallboxMaxChargingCurrentPercentStateTypeId, reportTwo.maxCurrentPercentage);
// Set the state limits according to the hardware limits
thing->setStateMaxValue(wallboxMaxChargingCurrentStateTypeId, reportTwo.currentHardwareLimitation);
thing->setStateMaxValue(wallboxMaxChargingCurrentGeneralStateTypeId, reportTwo.currentHardwareLimitation);
thing->setStateValue(wallboxOutputX2StateTypeId, reportTwo.output);
thing->setStateValue(wallboxInputStateTypeId, reportTwo.input);
@ -462,7 +462,6 @@ void IntegrationPluginKeba::onReportThreeReceived(const KeContact::ReportThree &
thing->setStateValue(wallboxCurrentPhase1EventTypeId, reportThree.currentPhase1);
thing->setStateValue(wallboxCurrentPhase2EventTypeId, reportThree.currentPhase2);
thing->setStateValue(wallboxCurrentPhase3EventTypeId, reportThree.currentPhase3);
thing->setStateValue(wallboxCurrentStateTypeId, reportThree.currentPhase1 + reportThree.currentPhase2 + reportThree.currentPhase3);
thing->setStateValue(wallboxVoltagePhase1EventTypeId, reportThree.voltagePhase1);
thing->setStateValue(wallboxVoltagePhase2EventTypeId, reportThree.voltagePhase2);
thing->setStateValue(wallboxVoltagePhase3EventTypeId, reportThree.voltagePhase3);
@ -579,9 +578,6 @@ void IntegrationPluginKeba::executeAction(ThingActionInfo *info)
QUuid requestId;
if (action.actionTypeId() == wallboxMaxChargingCurrentActionTypeId) {
int milliAmpere = action.param(wallboxMaxChargingCurrentActionMaxChargingCurrentParamTypeId).value().toDouble() * 1000;
requestId = keba->setMaxAmpere(milliAmpere);
} else if(action.actionTypeId() == wallboxMaxChargingCurrentGeneralActionTypeId) {
int milliAmpere = action.param(wallboxMaxChargingCurrentGeneralActionMaxChargingCurrentGeneralParamTypeId).value().toDouble() * 1000;
requestId = keba->setMaxAmpereGeneral(milliAmpere);
} else if(action.actionTypeId() == wallboxPowerActionTypeId) {
requestId = keba->enableOutput(action.param(wallboxPowerActionTypeId).value().toBool());

View File

@ -128,14 +128,12 @@
"defaultValue": false
},
{
"id": "a29c1748-fe97-4830-a56e-e1cc4e618385",
"name": "current",
"displayName": "Current",
"displayNameEvent": "Current changed",
"type": "double",
"unit": "Ampere",
"defaultValue": 0.00,
"suggestLogging": true
"id": "c9785626-2501-478d-8c18-c42ad5d9a269",
"name": "charging",
"displayName": "Charging",
"displayNameEvent": "Charging changed",
"type": "bool",
"defaultValue": false
},
{
"id": "593656f0-babf-4308-8767-68f34e10fb15",
@ -151,20 +149,6 @@
"writable": true,
"suggestLogging": true
},
{
"id": "da0cfb97-0b27-4d8f-bdf7-45b1ca727038",
"name": "maxChargingCurrentGeneral",
"displayName": "Maximal general charging current",
"displayNameEvent": "Maximal general charging current changed",
"displayNameAction": "Set maximal general charging current",
"type": "double",
"unit": "Ampere",
"defaultValue": 6.0,
"minValue": 6.0,
"maxValue": 32.0,
"writable": true,
"suggestLogging": true
},
{
"id": "3c7b83a0-0e42-47bf-9788-dde6aab5ceea",
"name": "maxChargingCurrentPercent",