Use assignment expressions 14 (#57939)

This commit is contained in:
Marc Mueller 2021-10-21 08:26:01 +02:00 committed by GitHub
parent 4eea618cc4
commit c979e89b70
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
25 changed files with 31 additions and 70 deletions

View file

@ -561,8 +561,7 @@ class SqueezeBoxEntity(MediaPlayerEntity):
player_ids = {
p.entity_id: p.unique_id for p in self.hass.data[DOMAIN][KNOWN_PLAYERS]
}
other_player_id = player_ids.get(other_player)
if other_player_id:
if other_player_id := player_ids.get(other_player):
await self._player.async_sync(other_player_id)
else:
_LOGGER.info("Could not find player_id for %s. Not syncing", other_player)