if the last child in a card (div.card > div.card-body) adds bottom
marging, we don't want the card to add more space through its
padding-bottom. most cards have children that add sufficient space
at the bottom anyways.
avoid hidden (but existing) or simply redundant DOM elements from
messing with the style sheet, which uses :last-child in particular to
fix up the margin on the bottom of cards.
when using v-if on a div element, the div will be part of the DOM in
case the condition is true. if we group elements to use v-if on the
group, we shall use a template element, so the group elements appear
as siblings of the other elements.
in particular, these spurious div do not mess up our CSS patch that sets
the bottom margin for the last child in a card to "auto".
it would be nice to have this in the header of the accordion, which is
hard, but doable. however, clicking the button then also toggles the
accordion, which is unacceptable. preventing that seems non-trivial, as
the @click.stop() is not enough. also, nesting interactive elements is
simply bad practice. the button can also go to the right of header, with
reasonable effort, but the corner radii are then messed up and would
need to react interactively (accordion collapsed or not), which is also
a pain.
we now "float" the reset button to the right, add a nice icon, and give
the button some space so it at least looks like it belongs there.
the cards in all information views still used a div.card-body around the
table, which added a margin on all sides of the table. to achieve a
unified look, these cards and tables now look the same as the inverter
channel cards.
we don't need a margin at the bottom of tables in general. not sure why
this is even a thing in bootstrap. this change, in particular, makes the
space between a table and a parent card symmetric on all sides.
this change tries to achieve a pleasing look of input forms by
right-aligning the texts of labels. the input form now looks similar
to a table, achieving a cleaner look, especially for forms where the
labels have varying text lenghts.
the absorption and float voltage setting is retrieved from connected
Victron Ve.Direct MPPTs using the HEX protocol. the values are
displayed in the live view, published to MQTT, and added to Home
Assistent auto-discovery.
This changes the custom current limit so the custom limit is only
applied when any of:
- SoC is valid and not ignored and SoC < threshold
- Voltage is valid and Voltage < threshold
- Voltage is invalid
Independently, if "Use Battery-Reported limit" is enabled and valid, it
is applied (unless a lower custom limit already was applied).
a battery temperature value measured by a Victron smart battery sense
and communicated to a connected Victron MPPT charge controller will now
appear in the live view card.
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
```
Due to a change in the Espressif Arduino core, the TX timeout for the HW CDC
(used in the ESP32-S3, for example) must not be set to 0, as otherwise, an
integer underflow occurs.
Removing the TX timeout is not necessary anymore anyways, because it is now
detected when CDC is not active, and attempts to write will return immediately
until the host read something again. Only when the transmit buffer becomes
full initially, the default timeout of just 100ms takes effect once.
For USB CDC (used with the ESP32-S2, for example), the timeout is not relevant
either.
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.