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
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 29 additions and 52 deletions

View file

@ -49,8 +49,7 @@ async def async_setup_entry(
# Add switch from config file
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):