DPL: use vedirect isdatavalid (#283)
* DPL: use VeDirect.isDataValid() in case the communication to the Victron charger is disrupted, the respective values in VeDirect.veFrame are not invalidated such that we would notice a problem. instead, isDataValid() should be used to make sure that the Victron charger is actually alive and that we can trust to use the reported values. * DPL: simplify canUseDirectSolarPower return statement
This commit is contained in:
parent
8433820529
commit
097d464bbb
@ -216,16 +216,12 @@ bool PowerLimiterClass::canUseDirectSolarPower()
|
||||
CONFIG_T& config = Configuration.get();
|
||||
|
||||
if (!config.PowerLimiter_SolarPassThroughEnabled
|
||||
|| !config.Vedirect_Enabled) {
|
||||
|| !config.Vedirect_Enabled
|
||||
|| !VeDirect.isDataValid()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (VeDirect.veFrame.PPV < 20) {
|
||||
// Not enough power
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
return VeDirect.veFrame.PPV >= 20; // enough power?
|
||||
}
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user