demo.tracker-v2/code/battery.py

22 lines
483 B
Python
Raw Normal View History

2022-03-03 09:53:51 +08:00
from misc import Power
2022-03-03 09:53:51 +08:00
class Battery(object):
def __init__(self):
pass
def indicate(self, low_power_threshold, low_power_cb):
self.low_power_threshold = low_power_threshold
self.low_power_cb = low_power_cb
pass
def charge(self):
pass
def capacity(self):
Vbatt = Power.getVbatt()
# TODO: Get battery capacity from Vbatt
battery_capacity = Vbatt
return battery_capacity