From 86c8dd521966854c2d9150111233245168a6c43c Mon Sep 17 00:00:00 2001 From: Tobias Witek Date: Wed, 24 Apr 2019 20:09:03 +0200 Subject: [PATCH] [modules/battery_all] Remove defunct estimate calculation code A decent fallback implementation would require some kind of differential measurement to be able to calculate a rate of change. For now, that is simply more complicated than warranted. Thanks to @stoeps13 for pointing that out! --- bumblebee/modules/battery_all.py | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/bumblebee/modules/battery_all.py b/bumblebee/modules/battery_all.py index 95a38a0..868798f 100644 --- a/bumblebee/modules/battery_all.py +++ b/bumblebee/modules/battery_all.py @@ -45,17 +45,6 @@ class Module(bumblebee.engine.Module): return None elif estimate == power.common.TIME_REMAINING_UNKNOWN: return "" - else: - for path in self._batteries: - try: - with open("{}/power_now".format(path)) as o: - power_now += int(o.read()) - except IOError: - return "n/a" - except Exception: - errors += 1 - - estimate = float( self.energy_now / power_now) except Exception: return "" return bumblebee.util.durationfmt(estimate*60, shorten=True, suffix=True) # estimate is in minutes