Don't use len(SEQUENCE) as condition value (#7249)
* Don't use len(SEQUENCE) as condition value * Update volvooncall.py
This commit is contained in:
parent
15b2473224
commit
cfc023e128
43 changed files with 319 additions and 355 deletions
|
@ -48,7 +48,7 @@ def setup(hass, config):
|
|||
|
||||
if not os.path.isdir(download_path):
|
||||
_LOGGER.error(
|
||||
"Download path %s does not exist. File Downloader not active.",
|
||||
"Download path %s does not exist. File Downloader not active",
|
||||
download_path)
|
||||
|
||||
return False
|
||||
|
@ -76,7 +76,7 @@ def setup(hass, config):
|
|||
match = re.findall(r"filename=(\S+)",
|
||||
req.headers['content-disposition'])
|
||||
|
||||
if len(match) > 0:
|
||||
if match:
|
||||
filename = match[0].strip("'\" ")
|
||||
|
||||
if not filename:
|
||||
|
@ -84,7 +84,7 @@ def setup(hass, config):
|
|||
url).strip()
|
||||
|
||||
if not filename:
|
||||
filename = "ha_download"
|
||||
filename = 'ha_download'
|
||||
|
||||
# Remove stuff to ruin paths
|
||||
filename = sanitize_filename(filename)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue