Use assignment expressions [K-Z] (#66881)

This commit is contained in:
Marc Mueller 2022-02-19 17:19:46 +01:00 committed by GitHub
parent d76687d672
commit 6e49b0e122
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
20 changed files with 22 additions and 51 deletions

View file

@ -319,8 +319,7 @@ class NestFlowHandler(
if user_input is not None and not errors:
# Create the subscriber id and/or verify it already exists. Note that
# the existing id is used, and create call below is idempotent
subscriber_id = data.get(CONF_SUBSCRIBER_ID, "")
if not subscriber_id:
if not (subscriber_id := data.get(CONF_SUBSCRIBER_ID, "")):
subscriber_id = _generate_subscription_id(cloud_project_id)
_LOGGER.debug("Creating subscriber id '%s'", subscriber_id)
# Create a placeholder ConfigEntry to use since with the auth we've already created.