Merge remote-tracking branch 'origin/master'

This commit is contained in:
Hosted Weblate 2023-07-09 10:40:38 +02:00
commit f5914899f9
No known key found for this signature in database
GPG key ID: A3FAAA06E6569B4C

View file

@ -50,7 +50,7 @@ const (
timerInactive = "inactive"
minActiveCurrent = 1.0 // minimum current at which a phase is treated as active
minActiveVoltage = 208 // minimum voltage at which a phase is treated as active
minActiveVoltage = 207 // minimum voltage at which a phase is treated as active
guardGracePeriod = 60 * time.Second // allow out of sync during this timespan
phaseSwitchCommandTimeout = 30 * time.Second // do not sync charger enabled/disabled state during this timespan
@ -1261,15 +1261,15 @@ func (lp *Loadpoint) updateChargeVoltages() {
lp.publish("chargeVoltages", chargeVoltages)
// Quine-McCluskey for (¬L1∧L2∧¬L3) ∨ (L1∧L2∧¬L3) ∨ (¬L1∧¬L2∧L3) ∨ (L1∧¬L2∧L3) ∨ (¬L1∧L2∧L3) -> ¬L1 ∧ L3 ∨ L2 ∧ ¬L3 ∨ ¬L2 ∧ L3
if !(u1 > minActiveVoltage) && (u3 > minActiveVoltage) || (u2 > minActiveVoltage) && !(u3 > minActiveVoltage) || !(u2 > minActiveVoltage) && (u3 > minActiveVoltage) {
if !(u1 >= minActiveVoltage) && (u3 >= minActiveVoltage) || (u2 >= minActiveVoltage) && !(u3 >= minActiveVoltage) || !(u2 >= minActiveVoltage) && (u3 >= minActiveVoltage) {
lp.log.WARN.Printf("invalid phase wiring between charge meter and charger")
}
var phases int
if (u1 > minActiveVoltage) || (u2 > minActiveVoltage) || (u3 > minActiveVoltage) {
if (u1 >= minActiveVoltage) || (u2 >= minActiveVoltage) || (u3 >= minActiveVoltage) {
phases = 3
}
if (u1 > minActiveVoltage) && (u2 < minActiveVoltage) && (u3 < minActiveVoltage) {
if (u1 >= minActiveVoltage) && (u2 < minActiveVoltage) && (u3 < minActiveVoltage) {
phases = 1
}