mirror of
https://github.com/tomaae/homeassistant-mikrotik_router.git
synced 2025-07-14 11:24:31 +02:00
added description variable to prioritize entry comment over name
This commit is contained in:
parent
89d2dc9513
commit
18f2e56691
2 changed files with 6 additions and 0 deletions
|
@ -279,6 +279,11 @@ class MikrotikControllerSwitch(SwitchEntity, RestoreEntity):
|
|||
@property
|
||||
def name(self) -> str:
|
||||
"""Return the name."""
|
||||
if self.entity_description.data_name_comment and self._data["comment"]:
|
||||
return (
|
||||
f"{self._inst} {self.entity_description.name} {self._data['comment']}"
|
||||
)
|
||||
|
||||
return f"{self._inst} {self.entity_description.name} {self._data[self.entity_description.data_name]}"
|
||||
|
||||
@property
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue