Skip to content

Commit

Permalink
Check whole entry data for uniqueness
Browse files Browse the repository at this point in the history
  • Loading branch information
jbouwh committed May 5, 2024
1 parent 6619a72 commit 55a7c33
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions homeassistant/components/file/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
)
Expand All @@ -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:
Expand Down

0 comments on commit 55a7c33

Please sign in to comment.