Avoid non-ASCII chars
This commit is contained in:
parent
65ddc634df
commit
d63896d465
@ -40,12 +40,12 @@ class Battery:
|
|||||||
|
|
||||||
def __init__(self, batinfo):
|
def __init__(self, batinfo):
|
||||||
self.bat = batinfo
|
self.bat = batinfo
|
||||||
self.normalize_µ()
|
self.normalize_micro()
|
||||||
|
|
||||||
def normalize_µ(self):
|
def normalize_micro(self):
|
||||||
for key, µvalue in self.bat.items():
|
for key, microvalue in self.bat.items():
|
||||||
if re.match(r"(VOLTAGE|CHARGE|CURRENT|POWER|ENERGY)_(NOW|FULL|MIN)(_DESIGN)?", key):
|
if re.match(r"(VOLTAGE|CHARGE|CURRENT|POWER|ENERGY)_(NOW|FULL|MIN)(_DESIGN)?", key):
|
||||||
self.bat[key] = float(µvalue) / 1000000.0
|
self.bat[key] = float(microvalue) / 1000000.0
|
||||||
|
|
||||||
def percentage(self, design=False):
|
def percentage(self, design=False):
|
||||||
return self._percentage("_DESIGN" if design else "") * 100
|
return self._percentage("_DESIGN" if design else "") * 100
|
||||||
|
Loading…
Reference in New Issue
Block a user