From c9ba3e3c6c6ef4446e988cc99b4791bbf7001437 Mon Sep 17 00:00:00 2001 From: Luis Miranda <161006+luuuis@users.noreply.github.com> Date: Fri, 7 Jan 2022 17:29:30 +0000 Subject: [PATCH] fix: abort import of configuration.yaml entry if already imported --- custom_components/wibeee/config_flow.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/custom_components/wibeee/config_flow.py b/custom_components/wibeee/config_flow.py index bfa7cd806f..660160ec43 100644 --- a/custom_components/wibeee/config_flow.py +++ b/custom_components/wibeee/config_flow.py @@ -8,6 +8,7 @@ from homeassistant import config_entries, exceptions from homeassistant.const import (CONF_HOST, CONF_SCAN_INTERVAL) from homeassistant.core import HomeAssistant, callback +from homeassistant.data_entry_flow import AbortFlow from homeassistant.helpers.aiohttp_client import async_get_clientsession from homeassistant.helpers.device_registry import format_mac @@ -49,6 +50,10 @@ async def async_step_user(self, user_input=None): return self.async_create_entry(title=title, data=data) + except AbortFlow: + # allow this to escape the catch-all below + raise + except NoDeviceInfo: # host is not a Wibeee... errors[CONF_HOST] = "no_device_info"