Skip to content

Commit 7f9a985

Browse files
committed
feat(temp-spike): removed redundant scaling to 100
1 parent cf42037 commit 7f9a985

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/thermopro_ble/parser.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@
3636
# A*tanh(B*x+C)+D
3737
# Where A,B,C,D are the variables to optimize for. This yielded the below function
3838
def tp96_battery(voltage: int) -> float:
39-
raw = 0.52317286 * tanh(voltage / 273.624277936 - 8.76485439394) + 0.5106925
40-
clamped = max(0, min(raw, 1))
41-
return round(clamped * 100, 2)
39+
raw = 52.317286 * tanh(voltage / 273.624277936 - 8.76485439394) + 51.06925
40+
clamped = max(0, min(raw, 100))
41+
return round(clamped, 2)
4242

4343

4444
class ThermoProBluetoothDeviceData(BluetoothData):

0 commit comments

Comments
 (0)