From 55a7c33ac0959c720a56365bd58de3aac368bf85 Mon Sep 17 00:00:00 2001 From: jbouwh Date: Sun, 5 May 2024 16:10:30 +0000 Subject: [PATCH] Check whole entry data for uniqueness --- homeassistant/components/file/config_flow.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/homeassistant/components/file/config_flow.py b/homeassistant/components/file/config_flow.py index 234d5e679a337..0d24389462a4f 100644 --- a/homeassistant/components/file/config_flow.py +++ b/homeassistant/components/file/config_flow.py @@ -85,9 +85,7 @@ async def async_step_notify( errors: dict[str, str] = {} if user_input: user_input[CONF_PLATFORM] = "notify" - self._async_abort_entries_match( - {key: user_input[key] for key in (CONF_PLATFORM, CONF_FILENAME)} - ) + self._async_abort_entries_match(user_input) filepath: str = os.path.join( self.hass.config.config_dir, user_input[CONF_FILENAME] ) @@ -109,9 +107,7 @@ async def async_step_sensor( errors: dict[str, str] = {} if user_input: user_input[CONF_PLATFORM] = "sensor" - self._async_abort_entries_match( - {key: user_input[key] for key in (CONF_PLATFORM, CONF_FILE_PATH)} - ) + self._async_abort_entries_match(user_input) if not await self.validate_file_path(user_input[CONF_FILE_PATH]): errors[CONF_FILE_PATH] = "not_allowed" else: