From d601a055fd4d95f82c5c10eaaa73cf23f2df8cbb Mon Sep 17 00:00:00 2001 From: tomaae <23486452+tomaae@users.noreply.github.com> Date: Fri, 25 Dec 2020 09:27:47 +0100 Subject: [PATCH] If comment is available, use it for a name #75 --- custom_components/mikrotik_router/switch.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/custom_components/mikrotik_router/switch.py b/custom_components/mikrotik_router/switch.py index 8b8107c..b183ff2 100644 --- a/custom_components/mikrotik_router/switch.py +++ b/custom_components/mikrotik_router/switch.py @@ -406,6 +406,9 @@ class MikrotikControllerMangleSwitch(MikrotikControllerSwitch): @property def name(self) -> str: """Return the name of the Mangle switch.""" + if self._data["comment"]: + return f"{self._inst} Mangle {self._data['comment']}" + return f"{self._inst} Mangle {self._data['name']}" @property