fix: handle "not charging" message

This commit is contained in:
2023-09-09 21:26:06 +02:00
parent 2db8a2c009
commit 54e59fa0eb

View File

@@ -101,6 +101,8 @@ def battery():
plain = int(bat.split('%')[0][-3:].rstrip('%').lstrip(',')) plain = int(bat.split('%')[0][-3:].rstrip('%').lstrip(','))
## imediatelly return if full and on supply ## ## imediatelly return if full and on supply ##
if "not charging" in bat.lower():
return hl_utils.color_panel(bat, GREEN)
if bat.startswith("Full") or bat.startswith('Unknown') or "100%" in bat or "99%" in bat: if bat.startswith("Full") or bat.startswith('Unknown') or "100%" in bat or "99%" in bat:
return hl_utils.color_panel("On Supply and fully charged", GREEN) return hl_utils.color_panel("On Supply and fully charged", GREEN)