Use assignment expressions [A-I] (#66880)

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

View file

@ -272,8 +272,7 @@ def setup_platform(
devices = []
for conf in discovery_info[ATTR_DISCOVER_DEVICES]:
state = conf.get(ATTR_PARAM)
entity_desc = SENSOR_DESCRIPTIONS.get(state)
if entity_desc is None:
if (entity_desc := SENSOR_DESCRIPTIONS.get(state)) is None:
name = conf.get(ATTR_NAME)
_LOGGER.warning(
"Sensor (%s) entity description is missing. Sensor state (%s) needs to be maintained",