Skip to content

Commit 6c42487

Browse files
Remove redundant code
Calling self._abort_if_unique_id_configured() handles this condition.
1 parent b7f731b commit 6c42487

File tree

1 file changed

+0
-11
lines changed

1 file changed

+0
-11
lines changed

custom_components/solaredge_modbus_multi/config_flow.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,6 @@
2525
from .helpers import device_list_from_string, host_valid
2626

2727

28-
@callback
29-
def solaredge_modbus_multi_entries(hass: HomeAssistant):
30-
"""Return the hosts already configured."""
31-
return set(
32-
entry.data[CONF_HOST].lower()
33-
for entry in hass.config_entries.async_entries(DOMAIN)
34-
)
35-
36-
3728
class SolaredgeModbusMultiConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
3829
"""Handle a config flow for SolarEdge Modbus Multi."""
3930

@@ -68,8 +59,6 @@ async def async_step_user(
6859
else:
6960
if not host_valid(user_input[CONF_HOST]):
7061
errors[CONF_HOST] = "invalid_host"
71-
elif user_input[CONF_HOST] in solaredge_modbus_multi_entries(self.hass):
72-
errors[CONF_HOST] = "already_configured"
7362
elif not 1 <= user_input[CONF_PORT] <= 65535:
7463
errors[CONF_PORT] = "invalid_tcp_port"
7564
elif not 1 <= inverter_count <= 32:

0 commit comments

Comments
 (0)