From ec7b1e574f00e4f5581f3056d130fb2a4ffe2d3c Mon Sep 17 00:00:00 2001 From: bcelary Date: Sat, 27 Nov 2021 01:07:30 +0100 Subject: [PATCH] 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 --- homeassistant/components/mysensors/device.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/homeassistant/components/mysensors/device.py b/homeassistant/components/mysensors/device.py index 0e6c5231bc8..35b15bc3595 100644 --- a/homeassistant/components/mysensors/device.py +++ b/homeassistant/components/mysensors/device.py @@ -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