Allow single entry in Downloader (#114957)

This commit is contained in:
Joost Lekkerkerker 2024-04-05 19:45:14 +02:00 committed by GitHub
parent e1575678ed
commit 5194215074
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 4 additions and 8 deletions

View File

@ -25,9 +25,6 @@ class DownloaderConfigFlow(ConfigFlow, domain=DOMAIN):
"""Handle the initial step.""" """Handle the initial step."""
errors: dict[str, str] = {} errors: dict[str, str] = {}
if self._async_current_entries():
return self.async_abort(reason="single_instance_allowed")
if user_input is not None: if user_input is not None:
try: try:
await self._validate_input(user_input) await self._validate_input(user_input)
@ -48,9 +45,6 @@ class DownloaderConfigFlow(ConfigFlow, domain=DOMAIN):
async def async_step_import(self, user_input: dict[str, Any]) -> ConfigFlowResult: async def async_step_import(self, user_input: dict[str, Any]) -> ConfigFlowResult:
"""Handle a flow initiated by configuration file.""" """Handle a flow initiated by configuration file."""
if self._async_current_entries():
return self.async_abort(reason="single_instance_allowed")
try: try:
await self._validate_input(user_input) await self._validate_input(user_input)
except DirectoryDoesNotExist: except DirectoryDoesNotExist:

View File

@ -4,5 +4,6 @@
"codeowners": ["@erwindouna"], "codeowners": ["@erwindouna"],
"config_flow": true, "config_flow": true,
"documentation": "https://www.home-assistant.io/integrations/downloader", "documentation": "https://www.home-assistant.io/integrations/downloader",
"quality_scale": "internal" "quality_scale": "internal",
"single_config_entry": true
} }

View File

@ -1299,7 +1299,8 @@
"downloader": { "downloader": {
"name": "Downloader", "name": "Downloader",
"integration_type": "hub", "integration_type": "hub",
"config_flow": true "config_flow": true,
"single_config_entry": true
}, },
"dremel_3d_printer": { "dremel_3d_printer": {
"name": "Dremel 3D Printer", "name": "Dremel 3D Printer",