Use assignment expressions 07 (#57787)
This commit is contained in:
parent
2b72b7b7b9
commit
4f8148f9ea
22 changed files with 39 additions and 73 deletions
|
@ -48,8 +48,7 @@ class NestDeviceInfo:
|
|||
return trait.custom_name
|
||||
# Build a name from the room/structure. Note: This room/structure name
|
||||
# is not associated with a home assistant Area.
|
||||
parent_relations = self._device.parent_relations
|
||||
if parent_relations:
|
||||
if parent_relations := self._device.parent_relations:
|
||||
items = sorted(parent_relations.items())
|
||||
names = [name for id, name in items]
|
||||
return " ".join(names)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue