Update usage of async_entries to use _async_current_entries (#50187)
This commit is contained in:
parent
c3eee9800a
commit
a4ea9b3cd3
28 changed files with 40 additions and 67 deletions
|
@ -218,7 +218,7 @@ class MySensorsConfigFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
|
|||
return self.async_show_form(step_id="gw_tcp", data_schema=schema, errors=errors)
|
||||
|
||||
def _check_topic_exists(self, topic: str) -> bool:
|
||||
for other_config in self.hass.config_entries.async_entries(DOMAIN):
|
||||
for other_config in self._async_current_entries():
|
||||
if topic == other_config.data.get(
|
||||
CONF_TOPIC_IN_PREFIX
|
||||
) or topic == other_config.data.get(CONF_TOPIC_OUT_PREFIX):
|
||||
|
@ -329,7 +329,7 @@ class MySensorsConfigFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
|
|||
] = self._normalize_persistence_file(
|
||||
user_input[CONF_PERSISTENCE_FILE]
|
||||
)
|
||||
for other_entry in self.hass.config_entries.async_entries(DOMAIN):
|
||||
for other_entry in self._async_current_entries():
|
||||
if CONF_PERSISTENCE_FILE not in other_entry.data:
|
||||
continue
|
||||
if real_persistence_path == self._normalize_persistence_file(
|
||||
|
@ -338,7 +338,7 @@ class MySensorsConfigFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
|
|||
errors[CONF_PERSISTENCE_FILE] = "duplicate_persistence_file"
|
||||
break
|
||||
|
||||
for other_entry in self.hass.config_entries.async_entries(DOMAIN):
|
||||
for other_entry in self._async_current_entries():
|
||||
if _is_same_device(gw_type, user_input, other_entry):
|
||||
errors["base"] = "already_configured"
|
||||
break
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue