Use assignment expressions 27 (#58188)

This commit is contained in:
Marc Mueller 2021-10-22 11:29:21 +02:00 committed by GitHub
parent 83e45300c2
commit be201e3ebe
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
22 changed files with 29 additions and 59 deletions

View file

@ -66,8 +66,8 @@ async def async_setup_platform(hass, config, async_add_entities, discovery_info=
unit = config.get(CONF_UNIT_OF_MEASUREMENT)
username = config.get(CONF_USERNAME)
password = config.get(CONF_PASSWORD)
value_template = config.get(CONF_VALUE_TEMPLATE)
if value_template is not None:
if (value_template := config.get(CONF_VALUE_TEMPLATE)) is not None:
value_template.hass = hass
if username and password: