Fix max settings if no cable connected and improve discovery result texts
This commit is contained in:
parent
ee30d86f94
commit
7c4a21c006
@ -60,7 +60,7 @@ void IntegrationPluginGoECharger::discoverThings(ThingDiscoveryInfo *info)
|
|||||||
|
|
||||||
qCDebug(dcGoECharger()) << "Checking discovered" << networkDeviceInfo;
|
qCDebug(dcGoECharger()) << "Checking discovered" << networkDeviceInfo;
|
||||||
// Filter by hostname
|
// Filter by hostname
|
||||||
if (!networkDeviceInfo.hostName().contains("go-eCharger"))
|
if (!networkDeviceInfo.hostName().toLower().contains("go-echarger"))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// We need also the mac address
|
// We need also the mac address
|
||||||
@ -71,14 +71,14 @@ void IntegrationPluginGoECharger::discoverThings(ThingDiscoveryInfo *info)
|
|||||||
if (networkDeviceInfo.hostName().isEmpty()) {
|
if (networkDeviceInfo.hostName().isEmpty()) {
|
||||||
title = networkDeviceInfo.address().toString();
|
title = networkDeviceInfo.address().toString();
|
||||||
} else {
|
} else {
|
||||||
title = "go-eCharger (" + networkDeviceInfo.address().toString() + ")";
|
title = "go-eCharger";
|
||||||
}
|
}
|
||||||
|
|
||||||
QString description;
|
QString description;
|
||||||
if (networkDeviceInfo.macAddressManufacturer().isEmpty()) {
|
if (networkDeviceInfo.macAddressManufacturer().isEmpty()) {
|
||||||
description = networkDeviceInfo.macAddress();
|
description = networkDeviceInfo.address().toString();
|
||||||
} else {
|
} else {
|
||||||
description = networkDeviceInfo.macAddress() + " (" + networkDeviceInfo.macAddressManufacturer() + ")";
|
description = networkDeviceInfo.address().toString() + " (" + networkDeviceInfo.macAddressManufacturer() + ")";
|
||||||
}
|
}
|
||||||
|
|
||||||
ThingDescriptor descriptor(goeHomeThingClassId, title, description);
|
ThingDescriptor descriptor(goeHomeThingClassId, title, description);
|
||||||
@ -368,7 +368,11 @@ void IntegrationPluginGoECharger::update(Thing *thing, const QVariantMap &status
|
|||||||
thing->setStateValue(goeHomeCableType2AmpereStateTypeId, cableLimit);
|
thing->setStateValue(goeHomeCableType2AmpereStateTypeId, cableLimit);
|
||||||
|
|
||||||
// Set the limit for the max charging amps
|
// Set the limit for the max charging amps
|
||||||
thing->setStateMaxValue(goeHomeMaxChargingCurrentStateTypeId, qMin(amaLimit, cableLimit));
|
if (cableLimit != 0) {
|
||||||
|
thing->setStateMaxValue(goeHomeMaxChargingCurrentStateTypeId, qMin(amaLimit, cableLimit));
|
||||||
|
} else {
|
||||||
|
thing->setStateMaxValue(goeHomeMaxChargingCurrentStateTypeId, amaLimit);
|
||||||
|
}
|
||||||
|
|
||||||
// Parse nrg array
|
// Parse nrg array
|
||||||
uint voltagePhaseA = 0; uint voltagePhaseB = 0; uint voltagePhaseC = 0;
|
uint voltagePhaseA = 0; uint voltagePhaseB = 0; uint voltagePhaseC = 0;
|
||||||
|
|||||||
@ -122,8 +122,8 @@
|
|||||||
"type": "uint",
|
"type": "uint",
|
||||||
"unit": "Ampere",
|
"unit": "Ampere",
|
||||||
"minValue": 6,
|
"minValue": 6,
|
||||||
"maxValue": 20,
|
"maxValue": 32,
|
||||||
"defaultValue": 0.00,
|
"defaultValue": 0,
|
||||||
"writable": true
|
"writable": true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user