Use assignment expressions 07 (#57787)

This commit is contained in:
Marc Mueller 2021-10-17 20:24:34 +02:00 committed by GitHub
parent 2b72b7b7b9
commit 4f8148f9ea
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
22 changed files with 39 additions and 73 deletions

View file

@ -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)