Skip to content

Commit 40bb659

Browse files
authored
Merge pull request #1 from Wrench451/main
bq27441: update driver
2 parents 0770f40 + 6069baa commit 40bb659

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

lib/bq27441/bq27441/device.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,15 @@ def capacity_remaining(self):
186186

187187
def state_of_charge(self):
188188
"""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 %"""
189198
try:
190199
result = self.soh(SohMeasureType.PERCENT)
191200
return result

0 commit comments

Comments
 (0)