mirror of
https://github.com/home-assistant/core.git
synced 2025-04-24 17:27:52 +00:00
Use mysensors child description as entity name (#60420)
* using description for instance name if not empty * Apply suggestions from code review * Apply suggestions from code review Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
This commit is contained in:
parent
5a72c9f7c3
commit
ec7b1e574f
@ -131,6 +131,10 @@ class MySensorsDevice:
|
||||
@property
|
||||
def name(self) -> str:
|
||||
"""Return the name of this entity."""
|
||||
child = self._child
|
||||
|
||||
if child.description:
|
||||
return str(child.description)
|
||||
return f"{self.node_name} {self.child_id}"
|
||||
|
||||
@property
|
||||
|
Loading…
x
Reference in New Issue
Block a user