battery: separate out publishing from updating

to allow smart battery drivers to use the battery class and
filling in additional information in case it makes sense.
This commit is contained in:
Matthias Grob
2021-12-07 21:06:51 +01:00
parent e70d70468a
commit fdc40880d0
10 changed files with 40 additions and 17 deletions
@@ -406,7 +406,7 @@ Syslink::handle_message(syslink_message_t *msg)
_battery.setConnected(true);
_battery.updateVoltage(vbat);
_battery.updateBatteryStatus(t);
_battery.updateAndPublishBatteryStatus(t);
// Update battery charge state
if (charging) {