Fix default value for discharge current limit

If the default type is an int, setting to a fractional value is not possible.

Presumably this is because in
`target.DischargeCurrentLimit = source["discharge_current_limit"] | BATTERY_DISCHARGE_CURRENT_LIMIT;`
the JSON library uses the default to force the expected type and on type mismatch the default is used.

As per https://arduinojson.org/v7/api/jsonvariant/or/:
`defaultValue: the value to return if the JsonVariant is null or incompatible with the requested type.`
This commit is contained in:
Tobias Diedrich 2024-09-28 18:32:16 +02:00 committed by Andreas Böhm
parent c523f066b3
commit 2454cead03

View File

@ -155,7 +155,7 @@
#define BATTERY_JKBMS_INTERFACE 0 #define BATTERY_JKBMS_INTERFACE 0
#define BATTERY_JKBMS_POLLING_INTERVAL 5 #define BATTERY_JKBMS_POLLING_INTERVAL 5
#define BATTERY_ENABLE_DISCHARGE_CURRENT_LIMIT false #define BATTERY_ENABLE_DISCHARGE_CURRENT_LIMIT false
#define BATTERY_DISCHARGE_CURRENT_LIMIT 0 #define BATTERY_DISCHARGE_CURRENT_LIMIT 0.0
#define BATTERY_USE_BATTERY_REPORTED_DISCHARGE_CURRENT_LIMIT false #define BATTERY_USE_BATTERY_REPORTED_DISCHARGE_CURRENT_LIMIT false
#define HUAWEI_ENABLED false #define HUAWEI_ENABLED false