mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
fix null batteryStr
This commit is contained in:
parent
14fc9b3f3c
commit
cbd8090137
1 changed files with 1 additions and 1 deletions
|
|
@ -122,7 +122,7 @@ data class NodeInfo(
|
|||
|
||||
val batteryLevel get() = deviceMetrics?.batteryLevel
|
||||
val voltage get() = deviceMetrics?.voltage
|
||||
val batteryStr get() = String.format("%d%% %.2fV", batteryLevel, voltage ?: 0)
|
||||
val batteryStr get() = if (batteryLevel in 1..100) String.format("%d%%", batteryLevel) else ""
|
||||
|
||||
/**
|
||||
* true if the device was heard from recently
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue