mirror of
https://github.com/SlimeVR/SlimeVR-Server.git
synced 2026-11-24 11:01:20 -08:00
hid add "unknown" runtime state (#1693)
This commit is contained in:
1 parent
23df46ca33
commit
2aa8d3a056
1 file changed
+2
-1
@@ -254,9 +254,10 @@ class HIDCommon {
|
||||
}
|
||||
|
||||
// Assign data
|
||||
if (runtime != null) {
|
||||
if (runtime != null && runtime >= 0) {
|
||||
tracker.batteryRemainingRuntime = runtime
|
||||
}
|
||||
// -1: Not known (e.g. not yet calculated after wake up, reusing known value is okay), 0: N/A (e.g. charging)
|
||||
if (batt != null) {
|
||||
tracker.batteryLevel = if (batt == 128) 1f else (batt and 127).toFloat()
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user