Set single_config_entry in canary (#131485)

This commit is contained in:
epenet 2024-11-25 00:55:33 +01:00 committed by GitHub
parent 8b71362ae1
commit 43e467a309
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 4 additions and 6 deletions

View File

@ -62,9 +62,6 @@ class CanaryConfigFlow(ConfigFlow, domain=DOMAIN):
self, user_input: dict[str, Any] | None = None self, user_input: dict[str, Any] | None = None
) -> ConfigFlowResult: ) -> ConfigFlowResult:
"""Handle a flow initiated by the user.""" """Handle a flow initiated by the user."""
if self._async_current_entries():
return self.async_abort(reason="single_instance_allowed")
errors = {} errors = {}
default_username = "" default_username = ""

View File

@ -7,5 +7,6 @@
"documentation": "https://www.home-assistant.io/integrations/canary", "documentation": "https://www.home-assistant.io/integrations/canary",
"iot_class": "cloud_polling", "iot_class": "cloud_polling",
"loggers": ["canary"], "loggers": ["canary"],
"requirements": ["py-canary==0.5.4"] "requirements": ["py-canary==0.5.4"],
"single_config_entry": true
} }

View File

@ -14,7 +14,6 @@
"cannot_connect": "[%key:common::config_flow::error::cannot_connect%]" "cannot_connect": "[%key:common::config_flow::error::cannot_connect%]"
}, },
"abort": { "abort": {
"single_instance_allowed": "[%key:common::config_flow::abort::single_instance_allowed%]",
"unknown": "[%key:common::config_flow::error::unknown%]" "unknown": "[%key:common::config_flow::error::unknown%]"
} }
}, },

View File

@ -872,7 +872,8 @@
"name": "Canary", "name": "Canary",
"integration_type": "hub", "integration_type": "hub",
"config_flow": true, "config_flow": true,
"iot_class": "cloud_polling" "iot_class": "cloud_polling",
"single_config_entry": true
}, },
"ccm15": { "ccm15": {
"name": "Midea ccm15 AC Controller", "name": "Midea ccm15 AC Controller",