diff --git a/custom_components/mikrotik_router/device_tracker.py b/custom_components/mikrotik_router/device_tracker.py index 840ffcb..a7cb840 100644 --- a/custom_components/mikrotik_router/device_tracker.py +++ b/custom_components/mikrotik_router/device_tracker.py @@ -22,6 +22,7 @@ from homeassistant.util.dt import utcnow from homeassistant.components.device_tracker.const import SourceType from .device_tracker_types import SENSOR_TYPES, SENSOR_SERVICES +from .coordinator import MikrotikCoordinator from .entity import _skip_sensor, MikrotikEntity from .helper import format_attribute from .const import ( @@ -118,6 +119,16 @@ async def async_setup_entry( class MikrotikDeviceTracker(MikrotikEntity, ScannerEntity): """Representation of a device tracker.""" + def __init__( + self, + coordinator: MikrotikCoordinator, + entity_description, + uid: str | None = None, + ): + """Initialize entity""" + super().__init__(coordinator, entity_description, uid) + self._attr_name = None + @property def ip_address(self) -> str: """Return the primary ip address of the device.""" @@ -169,11 +180,6 @@ class MikrotikHostDeviceTracker(MikrotikDeviceTracker): ) return timedelta(seconds=track_network_hosts_timeout) - @property - def name(self) -> Any: - """Return the name.""" - return None - @property def is_connected(self) -> bool: """Return true if the host is connected to the network.""" diff --git a/custom_components/mikrotik_router/device_tracker_types.py b/custom_components/mikrotik_router/device_tracker_types.py index 3b5fe3d..2ec7f6d 100644 --- a/custom_components/mikrotik_router/device_tracker_types.py +++ b/custom_components/mikrotik_router/device_tracker_types.py @@ -33,6 +33,7 @@ class MikrotikDeviceTrackerEntityDescription(SwitchEntityDescription): data_path: str | None = None data_attribute: str = "available" data_name: str | None = None + data_name_comment: bool = False data_uid: str | None = None data_reference: str | None = None data_attributes_list: List = field(default_factory=lambda: [])