mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 21:27:38 +00:00
Fix exception when a unifi config entry is ignored (#45735)
* Fix exception when a unifi config entry is ignored * Fix existing test
This commit is contained in:
parent
1fd3a86239
commit
88c4031e57
@ -244,7 +244,7 @@ class UnifiFlowHandler(config_entries.ConfigFlow, domain=UNIFI_DOMAIN):
|
|||||||
def _host_already_configured(self, host):
|
def _host_already_configured(self, host):
|
||||||
"""See if we already have a unifi entry matching the host."""
|
"""See if we already have a unifi entry matching the host."""
|
||||||
for entry in self._async_current_entries():
|
for entry in self._async_current_entries():
|
||||||
if not entry.data:
|
if not entry.data or CONF_CONTROLLER not in entry.data:
|
||||||
continue
|
continue
|
||||||
if entry.data[CONF_CONTROLLER][CONF_HOST] == host:
|
if entry.data[CONF_CONTROLLER][CONF_HOST] == host:
|
||||||
return True
|
return True
|
||||||
|
@ -595,7 +595,7 @@ async def test_form_ssdp_gets_form_with_ignored_entry(hass):
|
|||||||
await setup.async_setup_component(hass, "persistent_notification", {})
|
await setup.async_setup_component(hass, "persistent_notification", {})
|
||||||
entry = MockConfigEntry(
|
entry = MockConfigEntry(
|
||||||
domain=UNIFI_DOMAIN,
|
domain=UNIFI_DOMAIN,
|
||||||
data={},
|
data={"not_controller_key": None},
|
||||||
source=config_entries.SOURCE_IGNORE,
|
source=config_entries.SOURCE_IGNORE,
|
||||||
)
|
)
|
||||||
entry.add_to_hass(hass)
|
entry.add_to_hass(hass)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user