Fixed device tracker names

This commit is contained in:
Tomaae 2023-09-12 12:00:42 +02:00
parent d3a2432eb7
commit 6079affcfa
No known key found for this signature in database
GPG key ID: 2F97770867DAA4E6
2 changed files with 12 additions and 5 deletions

View file

@ -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."""