Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: abort import of configuration.yaml entry if already imported #30

Merged
merged 1 commit into from
Jan 7, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions custom_components/wibeee/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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"
Expand Down