We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 0770f40 + 6069baa commit 40bb659Copy full SHA for 40bb659
1 file changed
lib/bq27441/bq27441/device.py
@@ -186,6 +186,15 @@ def capacity_remaining(self):
186
187
def state_of_charge(self):
188
"""Return remaining charge %"""
189
+ try:
190
+ result = self.soc(SocMeasureType.FILTERED)
191
+ return result
192
+ except Exception as e:
193
+ print("Failed to get state of charge (soc): %s" % e)
194
+ sys.print_exception(e)
195
+
196
+ def state_of_health(self):
197
+ """Return state of health %"""
198
try:
199
result = self.soh(SohMeasureType.PERCENT)
200
return result
0 commit comments