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
1 changed files with 4 additions and 0 deletions
|
@ -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…
Add table
Reference in a new issue