From 8f1f16d80b1e06ac7ca6f3c340b46ffc8f5f0727 Mon Sep 17 00:00:00 2001 From: Manuel Date: Sun, 24 Dec 2023 09:27:38 +0100 Subject: [PATCH] Fix #898 https://github.com/Louisvdw/dbus-serialbattery/issues/898 --- etc/dbus-serialbattery/battery.py | 11 +---------- etc/dbus-serialbattery/utils.py | 6 +----- 2 files changed, 2 insertions(+), 15 deletions(-) diff --git a/etc/dbus-serialbattery/battery.py b/etc/dbus-serialbattery/battery.py index 8c871261..1db9aa0f 100644 --- a/etc/dbus-serialbattery/battery.py +++ b/etc/dbus-serialbattery/battery.py @@ -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 + ")" diff --git a/etc/dbus-serialbattery/utils.py b/etc/dbus-serialbattery/utils.py index 13a2bbde..97fa9e08 100644 --- a/etc/dbus-serialbattery/utils.py +++ b/etc/dbus-serialbattery/utils.py @@ -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}" @@ -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"]