Skip to content

Commit

Permalink
Fix #898
Browse files Browse the repository at this point in the history
  • Loading branch information
mr-manuel committed Dec 24, 2023
1 parent 374537a commit 8f1f16d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 15 deletions.
11 changes: 1 addition & 10 deletions etc/dbus-serialbattery/battery.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,16 +162,7 @@ def connection_name(self) -> str:
return "Serial " + self.port

def custom_name(self) -> str:
"""
Check if the custom name is present in the config file, else return default name
"""
if len(utils.CUSTOM_BATTERY_NAMES) > 0:
for name in utils.CUSTOM_BATTERY_NAMES:
tmp = name.split(":")
if tmp[0].strip() == self.port:
return tmp[1].strip()
else:
return "SerialBattery(" + self.type + ")"
return "SerialBattery(" + self.type + ")"

def product_name(self) -> str:
return "SerialBattery(" + self.type + ")"
Expand Down
6 changes: 1 addition & 5 deletions etc/dbus-serialbattery/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def _get_list_from_config(


# Constants
DRIVER_VERSION = "1.1.20231223dev"
DRIVER_VERSION = "1.1.20231224dev"
zero_char = chr(48)
degree_sign = "\N{DEGREE SIGN}"

Expand Down Expand Up @@ -234,10 +234,6 @@ def _get_list_from_config(
"DEFAULT", "EXCLUDED_DEVICES", lambda v: str(v)
)

CUSTOM_BATTERY_NAMES = _get_list_from_config(
"DEFAULT", "CUSTOM_BATTERY_NAMES", lambda v: str(v)
)

# Auto reset SoC
AUTO_RESET_SOC = "True" == config["DEFAULT"]["AUTO_RESET_SOC"]

Expand Down

0 comments on commit 8f1f16d

Please sign in to comment.