|
10 | 10 | from homeassistant import config_entries |
11 | 11 | from homeassistant.config_entries import ConfigEntry, OptionsFlow |
12 | 12 | from homeassistant.const import CONF_HOST, CONF_NAME, CONF_PORT, CONF_SCAN_INTERVAL |
13 | | -from homeassistant.core import HomeAssistant, callback |
| 13 | +from homeassistant.core import callback |
14 | 14 | from homeassistant.data_entry_flow import FlowResult |
15 | 15 | from homeassistant.exceptions import HomeAssistantError |
16 | 16 |
|
@@ -45,15 +45,6 @@ def generate_config_schema(step_id: str, user_input: dict[str, Any]) -> vol.Sche |
45 | 45 | return vol.Schema(schema) |
46 | 46 |
|
47 | 47 |
|
48 | | -@callback |
49 | | -def solaredge_modbus_multi_entries(hass: HomeAssistant): |
50 | | - """Return the hosts already configured.""" |
51 | | - return set( |
52 | | - entry.data[CONF_HOST].lower() |
53 | | - for entry in hass.config_entries.async_entries(DOMAIN) |
54 | | - ) |
55 | | - |
56 | | - |
57 | 48 | class SolaredgeModbusMultiConfigFlow(config_entries.ConfigFlow, domain=DOMAIN): |
58 | 49 | """Handle a config flow for SolarEdge Modbus Multi.""" |
59 | 50 |
|
@@ -88,8 +79,6 @@ async def async_step_user( |
88 | 79 | else: |
89 | 80 | if not host_valid(user_input[CONF_HOST]): |
90 | 81 | errors[CONF_HOST] = "invalid_host" |
91 | | - elif user_input[CONF_HOST] in solaredge_modbus_multi_entries(self.hass): |
92 | | - errors[CONF_HOST] = "already_configured" |
93 | 82 | elif not 1 <= user_input[CONF_PORT] <= 65535: |
94 | 83 | errors[CONF_PORT] = "invalid_tcp_port" |
95 | 84 | elif not 1 <= inverter_count <= 32: |
|
0 commit comments