ui: admin telemetry decoder, battery % from board curves, PowerPolicy

- admin screen: telemetry via upstream LPPDataHelpers (ported; fixed its
  1-byte humidity size), every field, per-channel, signed current
  (helpers/ui/telemetry_text)
- battery %: both UIs show ZephyrBoard::getBattPercent() (discharge
  curve / fuel gauge) instead of a linear 3.0-4.2 V estimate
- app/PowerPolicy: low-battery auto-shutdown + v-contact alert +
  autoshutdown CLI on every companion (headless too); under 2000 mV
  counts as no battery; default 3200 mV, stored 3300 migrated once
- one time_sync.c for both UIs; ui_push_radio_state() for all roles
- repeater admin screen in its own file; handleInput split per mode
- dead UI code removed; companion help fits one reply frame
This commit is contained in:
liquidraver
2026-09-25 20:49:48 +02:00
parent d5bd805710
commit 059022403b
34 changed files with 2031 additions and 1765 deletions
+5
View File
@@ -135,6 +135,7 @@ protected:
def("wake", _p->wake_on_msg);
def("scr_off", _p->screen_off_secs);
def("auto_off_mv", _p->auto_shutdown_mv);
def("aoff_set", _p->auto_shutdown_set);
def("vc_en", _p->v_contact_enabled);
def("vc_flags", _p->v_contact_flags);
def("vbat_mv", _p->v_battery_alert_mv);
@@ -316,9 +317,13 @@ bool companionPrefsFromJson(NodePrefs &p, Stream &in)
NodePrefs t = p;
CompanionJson j(&t);
/* Absent keys keep the caller's value: clear the marker first, so a file
* from before it existed is recognised (NodePrefs.h). */
t.auto_shutdown_set = 0;
if (!j.load(in)) {
return false;
}
auto_shutdown_upgrade(&t);
saneRadio(t);
sanitizeNodePrefs(&t);
p = t;