mirror of
https://github.com/home-assistant/core.git
synced 2025-07-24 21:57:51 +00:00
Fix device name for OwnTracks (#96759)
This commit is contained in:
parent
e76254a50f
commit
98e166f795
@ -121,7 +121,10 @@ class OwnTracksEntity(TrackerEntity, RestoreEntity):
|
|||||||
@property
|
@property
|
||||||
def device_info(self) -> DeviceInfo:
|
def device_info(self) -> DeviceInfo:
|
||||||
"""Return the device info."""
|
"""Return the device info."""
|
||||||
return DeviceInfo(identifiers={(OT_DOMAIN, self._dev_id)}, name=self.name)
|
device_info = DeviceInfo(identifiers={(OT_DOMAIN, self._dev_id)})
|
||||||
|
if "host_name" in self._data:
|
||||||
|
device_info["name"] = self._data["host_name"]
|
||||||
|
return device_info
|
||||||
|
|
||||||
async def async_added_to_hass(self) -> None:
|
async def async_added_to_hass(self) -> None:
|
||||||
"""Call when entity about to be added to Home Assistant."""
|
"""Call when entity about to be added to Home Assistant."""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user