mirror of
https://github.com/mtan93/SmartThingsPublic.git
synced 2026-03-08 05:31:56 +00:00
Update ranges for centralite battery values
This just updates the range to be more conservative as well as match the battery curve better.
This commit is contained in:
@@ -171,8 +171,8 @@ private Map getBatteryResult(rawValue) {
|
|||||||
def pct = batteryMap[volts]
|
def pct = batteryMap[volts]
|
||||||
result.value = pct
|
result.value = pct
|
||||||
} else {
|
} else {
|
||||||
def minVolts = 2.1
|
def minVolts = 2.4
|
||||||
def maxVolts = 3.0
|
def maxVolts = 2.7
|
||||||
def pct = (volts - minVolts) / (maxVolts - minVolts)
|
def pct = (volts - minVolts) / (maxVolts - minVolts)
|
||||||
def roundedPct = Math.round(pct * 100)
|
def roundedPct = Math.round(pct * 100)
|
||||||
if (roundedPct <= 0)
|
if (roundedPct <= 0)
|
||||||
|
|||||||
@@ -274,7 +274,7 @@ private Map getBatteryResult(rawValue) {
|
|||||||
result.value = pct
|
result.value = pct
|
||||||
} else {
|
} else {
|
||||||
def minVolts = 2.1
|
def minVolts = 2.1
|
||||||
def maxVolts = 3.0
|
def maxVolts = 2.7
|
||||||
def pct = (volts - minVolts) / (maxVolts - minVolts)
|
def pct = (volts - minVolts) / (maxVolts - minVolts)
|
||||||
def roundedPct = Math.round(pct * 100)
|
def roundedPct = Math.round(pct * 100)
|
||||||
if (roundedPct <= 0)
|
if (roundedPct <= 0)
|
||||||
|
|||||||
Reference in New Issue
Block a user