Skip to content

Commit

Permalink
Revert "Implement csouers 67-70% charging to preserve batt"
Browse files Browse the repository at this point in the history
This reverts commit e3249be.
  • Loading branch information
kegman committed Dec 14, 2018
1 parent 1139bb3 commit 37c68ec
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions selfdrive/thermald.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,16 +195,6 @@ def thermald_thread():
msg.thermal.freeSpace = avail
with open("/sys/class/power_supply/battery/capacity") as f:
msg.thermal.batteryPercent = int(f.read())

#begining of limit charging. read the charging enabled flag in to charging_enabled
with open("/sys/class/power_supply/battery/charging_enabled") as f:
charging_enabled = int(f.read())
if msg.thermal.batteryPercent > 70 and charging_enabled:
os.system("echo 0 > /sys/class/power_supply/battery/charging_enabled")
elif msg.thermal.batteryPercent < 67 and not charging_enabled:
os.system("echo 1 > /sys/class/power_supply/battery/charging_enabled")
#end limit charging

with open("/sys/class/power_supply/battery/status") as f:
msg.thermal.batteryStatus = f.read().strip()
with open("/sys/class/power_supply/battery/current_now") as f:
Expand Down Expand Up @@ -272,7 +262,7 @@ def thermald_thread():
should_start = should_start and msg.thermal.freeSpace > 0.02

# require usb power in passive mode
#should_start = should_start and (not passive or msg.thermal.usbOnline)
should_start = should_start and (not passive or msg.thermal.usbOnline)

# confirm we have completed training and aren't uninstalling
should_start = should_start and accepted_terms and (passive or completed_training) and (not do_uninstall)
Expand Down

0 comments on commit 37c68ec

Please sign in to comment.