Use assignment expressions 18 (#57967)
This commit is contained in:
parent
ff853b2d53
commit
f149bef9f3
14 changed files with 29 additions and 64 deletions
|
@ -51,8 +51,7 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(
|
|||
|
||||
def setup_platform(hass, config, add_entities, discovery_info=None):
|
||||
"""Set up the SQL sensor platform."""
|
||||
db_url = config.get(CONF_DB_URL)
|
||||
if not db_url:
|
||||
if not (db_url := config.get(CONF_DB_URL)):
|
||||
db_url = DEFAULT_URL.format(hass_config_path=hass.config.path(DEFAULT_DB_FILE))
|
||||
|
||||
sess = None
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue