Closed jdeus closed 1 year ago
When calculating the safest values, max() is systematically used. However, when calculating the HighVoltage_alarm, the HighChargeCurrent_alarm, or the HighTemperature_alarm for example, min() should be used. https://github.com/Dr-Gigavolt/dbus-aggregate-batteries/blob/main/aggregatebatteries.py#L417
max()
HighVoltage_alarm
HighChargeCurrent_alarm
HighTemperature_alarm
min()
Why? OK is 0, Warning is 1 and Alarm is 2. If min used, result wäre OK even if one instance sends 1 or 2.
When calculating the safest values,
max()
is systematically used. However, when calculating theHighVoltage_alarm
, theHighChargeCurrent_alarm
, or theHighTemperature_alarm
for example,min()
should be used. https://github.com/Dr-Gigavolt/dbus-aggregate-batteries/blob/main/aggregatebatteries.py#L417