From ceafa32fdf072b7286f3c301c6106922d3a45427 Mon Sep 17 00:00:00 2001 From: Guido Schmitz Date: Mon, 2 Mar 2026 07:52:14 +0100 Subject: [PATCH] Fix linting --- devolo_home_control_api/helper/uid.py | 4 ++-- devolo_home_control_api/properties/settings_property.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/devolo_home_control_api/helper/uid.py b/devolo_home_control_api/helper/uid.py index 2176118..ac31ae2 100644 --- a/devolo_home_control_api/helper/uid.py +++ b/devolo_home_control_api/helper/uid.py @@ -42,7 +42,7 @@ def get_sub_device_uid_from_element_uid(element_uid: str) -> int | None: :param element_uid: Element UID, something like devolo.MultiLevelSensor:hdm:ZWave:CBC56091/24#2 :return: Sub device UID, something like 2 """ - return None if "#" not in element_uid else int(element_uid.split("#")[-1]) + return None if "#" not in element_uid else int(element_uid.rsplit("#", maxsplit=1)[1]) def get_device_type_from_element_uid(element_uid: str) -> str: @@ -52,7 +52,7 @@ def get_device_type_from_element_uid(element_uid: str) -> str: :param element_uid: Element UID, something like devolo.MultiLevelSensor:hdm:ZWave:CBC56091/24#2 :return: Device type, something like devolo.MultiLevelSensor """ - return element_uid.split(":")[0] + return element_uid.split(":", maxsplit=1)[0] def get_home_id_from_device_uid(device_uid: str) -> str: diff --git a/devolo_home_control_api/properties/settings_property.py b/devolo_home_control_api/properties/settings_property.py index 71eb454..e393dde 100644 --- a/devolo_home_control_api/properties/settings_property.py +++ b/devolo_home_control_api/properties/settings_property.py @@ -66,7 +66,7 @@ def __init__(self, element_uid: str, tz: tzinfo, setter: Callable[..., bool], ** # Depending on the type of setting property, this will create a callable named "set". # However, this methods are not working, if the gateway is connected locally, yet. - self.set = setter_method.get(element_uid.split(".")[0], lambda: False) + self.set = setter_method.get(element_uid.split(".", maxsplit=1)[0], lambda: False) # Clean up attributes which are unwanted. clean_up_list = ["device_uid"]