1
0
Fork 0

add TODO:

This commit is contained in:
Luca Bilke 2022-07-26 20:06:13 +02:00
parent 196040f052
commit e03f8f3896
1 changed files with 1 additions and 0 deletions

View File

@ -134,6 +134,7 @@ def get_battery_cells() -> list:
with open("/sys/class/power_supply/BAT0/capacity", "r") as f:
percent = int(f.read())
if status == "Discharging\n":
# TODO: declare the lambda once and don't repeat the code
icon_color = UNPLUGGED_COLORS[
min(UNPLUGGED_COLORS.keys(), key=lambda x: abs(x - percent))
]