Allow multiple config entries per host for transmission (#39127)

* Allow multiple integrations per host (check port) #36605

* Add test for allow multiple config entries per host for transmission
This commit is contained in:
J.P. Hutchins
2020-08-23 04:29:44 -07:00
committed by GitHub
parent f295684c10
commit 62b1f23328
2 changed files with 25 additions and 4 deletions

View File

@@ -56,7 +56,10 @@ class TransmissionFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
if user_input is not None:
for entry in self.hass.config_entries.async_entries(DOMAIN):
if entry.data[CONF_HOST] == user_input[CONF_HOST]:
if (
entry.data[CONF_HOST] == user_input[CONF_HOST]
and entry.data[CONF_PORT] == user_input[CONF_PORT]
):
return self.async_abort(reason="already_configured")
if entry.data[CONF_NAME] == user_input[CONF_NAME]:
errors[CONF_NAME] = "name_exists"