Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix: Improve DPL nighttime discharging (#1126)
* fix: DPL: start discharging at night logic error the switch "always start discharging battery at night" would cause to stop discharging the battery when there was solar power and the battery was discharged below the start threshold. this change introduces a nighttime discharging boolean variable, which is enabled the instant we decide to start a battery discharge cycle due to nighttime havin arrived. we reset this variable as soon as it is daytime (solar power available). in that case, we allow discharging the battery if the start threshold was reached. this can actually be the case if the battery is charged with cheap electricity during the night. removed comments as they merely spell out what the if statement already expresses quite nicely. * use SunPosition.isDayPeriod() to check for daytime --------- Co-authored-by: Andreas Böhm <[email protected]>
- Loading branch information