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.`
* Allow scaleValue() for 32bit values
* Victron: Implement CAN message 0x360
This one-byte message is set to 0xff to request charging below a
certain SoC threshold (10% in my tests).
* Pytes: Add support for native CAN protocol
The recently added PytesCanReceiver.cpp implements the Victron CAN protocol.
This change additionally adds support for the native Pytes CAN
protocol messages.
Features only supported in Pytes protocol:
- High-resolution state of charge / full and remaining mAh
- Charge cycle counter
- Balancing state
Features only supported in Victron protocol:
- FW version
- Serial number
Note that the only known way to select the native Pytes protocol is
via the serial console (Cisco-compatible cables work):
```
login config
setprt PYTES
logout
```
to return to Victron protocol use:
```
login config
setprt VICTRON
logout
```
to return to DIP-switch based protocol setting:
```
login config
setprt DIP
logout
```
when upgrading to cpplint 2.0.0, C-style casts are flagged. since many
of them are in libraries, we will use version 1.6.1 until we figure out
whether we shall ignore C-style casts or if we will replace them.
when changing the security settings (disabling read-only access or
changing the password), existing websocket connections are now closed,
forcing the respective clients to authenticate (with the new password).
otherwise, existing websocket clients keep connected even though the
security settings now expect authentication with a (changed) password.
with ESPAsyncWebServer 3.3.0, the setAuthentication() method became
deprecated and a replacement method was provided which acts as a shim
and uses the new middleware-based approach to setup authentication. in
order to eventually apply a changed "read-only access allowed" setting,
the setAuthentication() method was called periodically. the shim
implementation each time allocates a new AuthenticationMiddleware and
adds it to the chain of middlewares, eventually exhausting the memory.
we now use the new middleware-based approach ourselves and only add the
respective AuthenticatonMiddleware instance once to the respective
websocket server instance.
a regression where enabling unauthenticated read-only access is not
applied until reboot is also fixed. all the AuthenticationMiddleware
instances were never removed from the chain of middlewares when calling
setAuthentication("", "").