mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 21:27:38 +00:00
Fix exception in hunterdouglas_powerview with ignored config entry (#35482)
This commit is contained in:
parent
a6d587b6cd
commit
87e0f04515
@ -126,7 +126,9 @@ class ConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
|
|||||||
def _host_already_configured(self, host):
|
def _host_already_configured(self, host):
|
||||||
"""See if we already have a hub with the host address configured."""
|
"""See if we already have a hub with the host address configured."""
|
||||||
existing_hosts = {
|
existing_hosts = {
|
||||||
entry.data[CONF_HOST] for entry in self._async_current_entries()
|
entry.data[CONF_HOST]
|
||||||
|
for entry in self._async_current_entries()
|
||||||
|
if CONF_HOST in entry.data
|
||||||
}
|
}
|
||||||
return host in existing_hosts
|
return host in existing_hosts
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@ from homeassistant import config_entries, setup
|
|||||||
from homeassistant.components.hunterdouglas_powerview.const import DOMAIN
|
from homeassistant.components.hunterdouglas_powerview.const import DOMAIN
|
||||||
|
|
||||||
from tests.async_mock import AsyncMock, MagicMock, patch
|
from tests.async_mock import AsyncMock, MagicMock, patch
|
||||||
from tests.common import load_fixture
|
from tests.common import MockConfigEntry, load_fixture
|
||||||
|
|
||||||
|
|
||||||
def _get_mock_powerview_userdata(userdata=None, get_resources=None):
|
def _get_mock_powerview_userdata(userdata=None, get_resources=None):
|
||||||
@ -102,6 +102,9 @@ async def test_form_homekit(hass):
|
|||||||
"""Test we get the form with homekit source."""
|
"""Test we get the form with homekit source."""
|
||||||
await setup.async_setup_component(hass, "persistent_notification", {})
|
await setup.async_setup_component(hass, "persistent_notification", {})
|
||||||
|
|
||||||
|
ignored_config_entry = MockConfigEntry(domain=DOMAIN, data={}, source="ignore")
|
||||||
|
ignored_config_entry.add_to_hass(hass)
|
||||||
|
|
||||||
mock_powerview_userdata = _get_mock_powerview_userdata()
|
mock_powerview_userdata = _get_mock_powerview_userdata()
|
||||||
with patch(
|
with patch(
|
||||||
"homeassistant.components.hunterdouglas_powerview.UserData",
|
"homeassistant.components.hunterdouglas_powerview.UserData",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user