Fix battery voltage readouts
This commit is contained in:
+5
-1
@@ -125,8 +125,12 @@ async function discoverServices() {
|
||||
// Telemetry notify (1 Hz) — also carries chargeStatus
|
||||
chars.telemetry.addEventListener('characteristicvaluechanged', e => parseTelemetry(e.target.value));
|
||||
await chars.telemetry.startNotifications();
|
||||
// Initial read so values show immediately
|
||||
// Initial read so values show immediately. Also force updateChargeUI() here
|
||||
// because parseTelemetry() only calls it on a *change*, and currentChargeStatus
|
||||
// starts at 0 (discharging) — so a discharging device would never trigger the
|
||||
// update and ciStatus would stay at '--'.
|
||||
parseTelemetry(await chars.telemetry.readValue());
|
||||
updateChargeUI();
|
||||
|
||||
// IMU stream — subscribed on demand via play button
|
||||
chars.imuStream.addEventListener('characteristicvaluechanged', e => parseImuStream(e.target.value));
|
||||
|
||||
Reference in New Issue
Block a user