Skip to content

Commit

Permalink
fixing issue with weird battery values
Browse files Browse the repository at this point in the history
  • Loading branch information
workingmonk committed Mar 1, 2016
1 parent 25db4f5 commit 2d060bd
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ private Map getBatteryResult(rawValue) {
def volts = rawValue / 10
def descriptionText

if (rawValue == 0) {}
if (rawValue == 0 || rawValue == 255) {}
else {
if (volts > 3.5) {
result.descriptionText = "${linkText} battery has too much power (${volts} volts)."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,8 @@ def getTemperature(value) {

def volts = rawValue / 10
def descriptionText
if (volts > 3.5) {
if (rawValue == 0 || rawValue == 255) {}
else if (volts > 3.5) {
result.descriptionText = "${linkText} battery has too much power (${volts} volts)."
}
else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,8 @@ private Map getBatteryResult(rawValue) {

def volts = rawValue / 10
def descriptionText
if (volts > 3.5) {
if (rawValue == 0 || rawValue == 255) {}
else if (volts > 3.5) {
result.descriptionText = "${linkText} battery has too much power (${volts} volts)."
}
else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,8 @@ private Map getBatteryResult(rawValue) {

def volts = rawValue / 10
def descriptionText
if (volts > 3.5) {
if (rawValue == 0 || rawValue == 255) {}
else if (volts > 3.5) {
result.descriptionText = "${linkText} battery has too much power (${volts} volts)."
}
else {
Expand Down

0 comments on commit 2d060bd

Please sign in to comment.