We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 23df46c commit 2aa8d3aCopy full SHA for 2aa8d3a
server/core/src/main/java/dev/slimevr/tracking/trackers/hid/HIDCommon.kt
@@ -254,9 +254,10 @@ class HIDCommon {
254
}
255
256
// Assign data
257
- if (runtime != null) {
+ if (runtime != null && runtime >= 0) {
258
tracker.batteryRemainingRuntime = runtime
259
260
+ // -1: Not known (e.g. not yet calculated after wake up, reusing known value is okay), 0: N/A (e.g. charging)
261
if (batt != null) {
262
tracker.batteryLevel = if (batt == 128) 1f else (batt and 127).toFloat()
263
0 commit comments