mirror of https://github.com/wayvr-org/wayvr.git
default to -1 if a device has no battery level.
this is just to make sure the unwrap() doesn't crash; -1 (or any negative value) is used as the "disconnected" value.
This commit is contained in:
parent
c96ead7cf0
commit
e818259b5b
|
|
@ -100,8 +100,8 @@ impl OscSender {
|
||||||
|
|
||||||
for device in &app.input_state.devices {
|
for device in &app.input_state.devices {
|
||||||
|
|
||||||
// i believe soc is the battery level, based on input.rs (status.charge)
|
// soc is the battery level (set to device status.charge)
|
||||||
let level = device.soc.unwrap();
|
let level = device.soc.unwrap_or(-1.0);
|
||||||
let mut parameter = "";
|
let mut parameter = "";
|
||||||
|
|
||||||
match device.role {
|
match device.role {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue