From 6069baa1bf41a61186f1186d0a83b7e0957a68d2 Mon Sep 17 00:00:00 2001 From: Wrench451 Date: Tue, 7 Oct 2025 09:40:36 +0200 Subject: [PATCH] bq27441: update driver --- lib/bq27441/bq27441/device.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/bq27441/bq27441/device.py b/lib/bq27441/bq27441/device.py index 6ee51308..892f76e7 100644 --- a/lib/bq27441/bq27441/device.py +++ b/lib/bq27441/bq27441/device.py @@ -186,6 +186,15 @@ def capacity_remaining(self): def state_of_charge(self): """Return remaining charge %""" + try: + result = self.soc(SocMeasureType.FILTERED) + return result + except Exception as e: + print("Failed to get state of charge (soc): %s" % e) + sys.print_exception(e) + + def state_of_health(self): + """Return state of health %""" try: result = self.soh(SohMeasureType.PERCENT) return result