Fix Downloader config flow (#114718)

This commit is contained in:
Joost Lekkerkerker 2024-04-03 09:56:19 +02:00 committed by GitHub
parent f3ba713289
commit 4a879ce424
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -55,8 +55,9 @@ class DownloaderConfigFlow(ConfigFlow, domain=DOMAIN):
async def _validate_input(self, user_input: dict[str, Any]) -> None: async def _validate_input(self, user_input: dict[str, Any]) -> None:
"""Validate the user input if the directory exists.""" """Validate the user input if the directory exists."""
if not os.path.isabs(user_input[CONF_DOWNLOAD_DIR]): download_path = user_input[CONF_DOWNLOAD_DIR]
download_path = self.hass.config.path(user_input[CONF_DOWNLOAD_DIR]) if not os.path.isabs(download_path):
download_path = self.hass.config.path(download_path)
if not os.path.isdir(download_path): if not os.path.isdir(download_path):
_LOGGER.error( _LOGGER.error(