mirror of
https://github.com/tomaae/homeassistant-mikrotik_router.git
synced 2025-07-10 17:34:29 +02:00
Fixed entity names
This commit is contained in:
parent
2349584551
commit
d3a2432eb7
1 changed files with 3 additions and 1 deletions
|
@ -174,6 +174,8 @@ class MikrotikEntity(CoordinatorEntity[_MikrotikCoordinatorT], Entity):
|
||||||
if self._uid:
|
if self._uid:
|
||||||
self._data = coordinator.data[self.entity_description.data_path][self._uid]
|
self._data = coordinator.data[self.entity_description.data_path][self._uid]
|
||||||
|
|
||||||
|
self._attr_name = self.custom_name
|
||||||
|
|
||||||
@callback
|
@callback
|
||||||
def _handle_coordinator_update(self) -> None:
|
def _handle_coordinator_update(self) -> None:
|
||||||
self._data = self.coordinator.data[self.entity_description.data_path]
|
self._data = self.coordinator.data[self.entity_description.data_path]
|
||||||
|
@ -184,7 +186,7 @@ class MikrotikEntity(CoordinatorEntity[_MikrotikCoordinatorT], Entity):
|
||||||
super()._handle_coordinator_update()
|
super()._handle_coordinator_update()
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def name(self) -> str:
|
def custom_name(self) -> str:
|
||||||
"""Return the name for this entity"""
|
"""Return the name for this entity"""
|
||||||
if not self._uid:
|
if not self._uid:
|
||||||
if self.entity_description.data_name_comment and self._data["comment"]:
|
if self.entity_description.data_name_comment and self._data["comment"]:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue