diff --git a/genericcar/integrationplugingenericcar.cpp b/genericcar/integrationplugingenericcar.cpp index 5e55e7e..b97bf04 100644 --- a/genericcar/integrationplugingenericcar.cpp +++ b/genericcar/integrationplugingenericcar.cpp @@ -25,25 +25,22 @@ #include "integrationplugingenericcar.h" #include "plugininfo.h" -#include -#include - -IntegrationPluginGenericCar::IntegrationPluginGenericCar() -{ - -} +IntegrationPluginGenericCar::IntegrationPluginGenericCar() {} void IntegrationPluginGenericCar::setupThing(ThingSetupInfo *info) { Thing *thing = info->thing(); // Set the min charging current state if the settings value changed - connect(thing, &Thing::settingChanged, this, [thing](const ParamTypeId ¶mTypeId, const QVariant &value){ + connect(thing, &Thing::settingChanged, this, [thing](const ParamTypeId ¶mTypeId, const QVariant &value) { if (paramTypeId == carSettingsCapacityParamTypeId) { thing->setStateValue(carCapacityStateTypeId, value); } else if (paramTypeId == carSettingsMinChargingCurrentParamTypeId) { qCDebug(dcGenericCar()) << "Car minimum charging current settings changed" << value.toUInt() << "A"; thing->setStateValue(carMinChargingCurrentStateTypeId, value); + } else if (paramTypeId == carSettingsMaxChargingCurrentParamTypeId) { + qCDebug(dcGenericCar()) << "Car maximum charging current settings changed" << value.toUInt() << "A"; + thing->setStateValue(carMaxChargingCurrentStateTypeId, value); } else if (paramTypeId == carSettingsPhaseCountParamTypeId) { thing->setStateValue(carPhaseCountStateTypeId, value); } diff --git a/genericcar/integrationplugingenericcar.h b/genericcar/integrationplugingenericcar.h index eb3391d..037f4bf 100644 --- a/genericcar/integrationplugingenericcar.h +++ b/genericcar/integrationplugingenericcar.h @@ -25,13 +25,11 @@ #ifndef INTEGRATIONPLUGINGENERICCAR_H #define INTEGRATIONPLUGINGENERICCAR_H -#include "integrations/integrationplugin.h" -#include "plugintimer.h" +#include + #include "extern-plugininfo.h" -#include - -class IntegrationPluginGenericCar: public IntegrationPlugin +class IntegrationPluginGenericCar : public IntegrationPlugin { Q_OBJECT @@ -42,11 +40,6 @@ public: explicit IntegrationPluginGenericCar(); void setupThing(ThingSetupInfo *info) override; void executeAction(ThingActionInfo *info) override; - -private: - QHash m_pulsesPerTimeframe; - - QHash m_smartMeterTimer; }; #endif // INTEGRATIONPLUGINGENERICCAR_H diff --git a/genericcar/integrationplugingenericcar.json b/genericcar/integrationplugingenericcar.json index cb3ef1d..63db5db 100644 --- a/genericcar/integrationplugingenericcar.json +++ b/genericcar/integrationplugingenericcar.json @@ -25,6 +25,16 @@ "maxValue": 16, "defaultValue": 6 }, + { + "id": "69ae5ffa-b31b-4295-a2a8-61bd7b2fc5da", + "name": "maxChargingCurrent", + "displayName": "Maximal charging current", + "type": "uint", + "unit": "Ampere", + "minValue": 16, + "maxValue": 80, + "defaultValue": 80 + }, { "id": "57f36386-dd71-4ab0-8d2f-8c74a391f90d", "name": "capacity", @@ -60,7 +70,6 @@ "id": "363a2a39-61b6-4109-9cd9-aca7367d12c7", "name": "capacity", "displayName": "Capacity", - "displayNameEvent": "Capacity changed", "type": "double", "unit": "KiloWattHour", "defaultValue": 50 @@ -69,7 +78,6 @@ "id": "d33982d6-6467-4281-b448-68c1b1db088d", "name": "batteryCritical", "displayName": "Battery level critical", - "displayNameEvent": "Battery entered or left critical state", "type": "bool", "defaultValue": false }, @@ -77,7 +85,6 @@ "id": "3f1cca10-8988-4ec6-b937-0775653cde12", "name": "batteryLevel", "displayName": "Battery level", - "displayNameEvent": "Battery level changed", "displayNameAction": "Set battery level", "type": "int", "unit": "Percentage", @@ -90,18 +97,26 @@ "id": "20faf2b8-2b40-4bee-b228-97dbaf0cdffc", "name": "minChargingCurrent", "displayName": "Minimum charging current", - "displayNameEvent": "Minimum charging current changed", "type": "uint", "unit": "Ampere", "minValue": 6, "maxValue": 16, "defaultValue": 6 }, + { + "id": "ad17e812-ba07-47a8-99a4-eefb8b54fc85", + "name": "maxChargingCurrent", + "displayName": "Maximum charging current", + "type": "uint", + "unit": "Ampere", + "minValue": 16, + "maxValue": 80, + "defaultValue": 80 + }, { "id": "c886c062-bf1a-46c5-8e54-aed804a22d57", "name": "phaseCount", "displayName": "Phase count", - "displayNameEvent": "Phase count changed", "type": "uint", "minValue": 1, "maxValue": 3,