Skip to content

Commit

Permalink
added toInteger function to battery
Browse files Browse the repository at this point in the history
  • Loading branch information
KurtSanders committed May 23, 2020
1 parent 092ab41 commit 9a1653f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Testing/jkp/bitbar-output-app.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -412,13 +412,13 @@ def getBatteryInfo(dev) {
return "N/A"
}
if(batteryMap) {
if(state.batteryWarningPct == null || state.batteryWarningPct < 0 || state.batteryWarningPct > 100 ) {
if(state.batteryWarningPct == null || state.batteryWarningPct.toInteger() < 0 || state.batteryWarningPct.toInteger() > 100 ) {
state.batteryWarningPct = 50
}
if(batteryMap <= state.batteryWarningPct){
return [batteryMap, batteryWarningPctEmoji == null?" :grimacing: ":" " + batteryWarningPctEmoji + " "]
if(batteryMap.toInteger() <= state.batteryWarningPct.toInteger()){
return ["${batteryMap}%", batteryWarningPctEmoji == null?" :grimacing: ":" " + batteryWarningPctEmoji + " "]
}
return [batteryMap, ""]
return ["${batteryMap}%", ""]
}
}
return "N/A"
Expand Down

0 comments on commit 9a1653f

Please sign in to comment.