Use assignment expressions 37 (#58827)

This commit is contained in:
Marc Mueller
2021-10-31 18:45:27 +01:00
committed by GitHub
parent 8e03102892
commit b6d9e517c2
14 changed files with 29 additions and 52 deletions

View File

@@ -237,8 +237,7 @@ async def async_setup_entry(
entities = []
for packet_id, entity_info in discovery_info[CONF_DEVICES].items():
event = get_rfx_object(packet_id)
if event is None:
if (event := get_rfx_object(packet_id)) is None:
_LOGGER.error("Invalid device: %s", packet_id)
continue
if not supported(event):