Fix Downloader config flow (#114718)

This commit is contained in:
Joost Lekkerkerker 2024-04-03 09:56:19 +02:00 committed by Franck Nijhof
parent 7cb603a226
commit 7a2f6ce430
No known key found for this signature in database
GPG Key ID: D62583BA8AB11CA3

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(