Skip to content

Commit

Permalink
Fix battery capacity error
Browse files Browse the repository at this point in the history
  • Loading branch information
eagleshot committed Jun 19, 2024
1 parent f93fd23 commit 8cacc70
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# Configuration and filenames
###########################
try:
VERSION = "1.0.4"
VERSION = "1.0.5"

# Get unique hardware id of Raspberry Pi
# See: https://www.raspberrypi.com/documentation/computers/config_txt.html#the-serial-number-filter
Expand Down Expand Up @@ -138,7 +138,7 @@ def get_cpu_serial():
data.add('battery_voltage', battery_voltage)

battery_voltage_half = settings.get("batteryVoltageHalf")
battery_voltage_quarter = (battery_voltage_half-settings.get("lowVoltageThreshold"))*0.5
battery_voltage_quarter = (battery_voltage_half + settings.get("lowVoltageThreshold")) / 2

# Battery voltage between 50% and 25%
if battery_voltage_quarter < battery_voltage < battery_voltage_half:
Expand Down

0 comments on commit 8cacc70

Please sign in to comment.