changed unique_id's for device trackers to distinguish between interface and host #24

This commit is contained in:
tomaae 2020-04-09 02:46:09 +02:00
parent a0ebb9a6cf
commit 5521d01e33

View file

@ -164,7 +164,7 @@ class MikrotikControllerPortDeviceTracker(ScannerEntity):
@property
def unique_id(self):
"""Return a unique identifier for this port."""
return f"{self._inst.lower()}-{self._data['port-mac-address']}"
return f"{self._inst.lower()}-interface-{self._data['port-mac-address']}"
@property
def available(self) -> bool:
@ -259,7 +259,7 @@ class MikrotikControllerHostDeviceTracker(ScannerEntity):
@property
def unique_id(self):
"""Return a unique identifier for this host."""
return f"{self._inst.lower()}-{self._data['mac-address']}"
return f"{self._inst.lower()}-host-{self._data['mac-address']}"
@property
def available(self) -> bool: