mirror of
https://github.com/tomaae/homeassistant-mikrotik_router.git
synced 2025-07-29 06:54:29 +02:00
Added default name to port uid #60
This commit is contained in:
parent
1e109f3dc6
commit
71a4b7c812
2 changed files with 6 additions and 1 deletions
|
@ -259,6 +259,11 @@ class MikrotikControllerPortDeviceTracker(MikrotikControllerDeviceTracker):
|
|||
"""Return true if the port is connected to the network."""
|
||||
return self._data["running"]
|
||||
|
||||
@property
|
||||
def unique_id(self):
|
||||
"""Return a unique identifier for this port."""
|
||||
return f"{self._inst.lower()}-{self._sid_data['sid']}-{self._data['port-mac-address']}_{self._data['default-name']}"
|
||||
|
||||
@property
|
||||
def icon(self):
|
||||
"""Return the icon."""
|
||||
|
|
|
@ -233,7 +233,7 @@ class MikrotikControllerPortSwitch(MikrotikControllerSwitch):
|
|||
@property
|
||||
def unique_id(self) -> str:
|
||||
"""Return a unique identifier for this port."""
|
||||
return f"{self._inst.lower()}-enable_switch-{self._data['port-mac-address']}"
|
||||
return f"{self._inst.lower()}-enable_switch-{self._data['port-mac-address']}_{self._data['default-name']}"
|
||||
|
||||
@property
|
||||
def icon(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue