mirror of
https://github.com/home-assistant/core.git
synced 2026-08-24 02:24:51 -05:00
Revert host update on Overkiz local gateway rediscovery (#179422)
This commit is contained in:
@@ -476,18 +476,13 @@ class OverkizConfigFlow(
|
||||
if discovery_info.type == "_kizboxdev._tcp.local.":
|
||||
self._host = f"{discovery_info.hostname[:-1]}:{discovery_info.port}"
|
||||
self._api_type = APIType.LOCAL
|
||||
return await self._process_discovery(
|
||||
gateway_id, updates={CONF_HOST: self._host}
|
||||
)
|
||||
|
||||
return await self._process_discovery(gateway_id)
|
||||
|
||||
async def _process_discovery(
|
||||
self, gateway_id: str, *, updates: dict[str, Any] | None = None
|
||||
) -> ConfigFlowResult:
|
||||
async def _process_discovery(self, gateway_id: str) -> ConfigFlowResult:
|
||||
"""Handle discovery of a gateway."""
|
||||
await self.async_set_unique_id(gateway_id)
|
||||
self._abort_if_unique_id_configured(updates=updates)
|
||||
self._abort_if_unique_id_configured()
|
||||
self.context["title_placeholders"] = {"gateway_id": gateway_id}
|
||||
|
||||
return await self.async_step_user()
|
||||
|
||||
@@ -41,7 +41,7 @@ rules:
|
||||
|
||||
# Gold
|
||||
docs-examples: todo
|
||||
discovery-update-info: done
|
||||
discovery-update-info: todo
|
||||
entity-device-class: done
|
||||
entity-translations: todo
|
||||
docs-data-update: done
|
||||
|
||||
@@ -1322,32 +1322,6 @@ async def test_zeroconf_flow_already_configured(hass: HomeAssistant) -> None:
|
||||
assert result["reason"] == "already_configured"
|
||||
|
||||
|
||||
async def test_local_zeroconf_flow_updates_host(hass: HomeAssistant) -> None:
|
||||
"""Test that rediscovery of a local gateway refreshes the stored host."""
|
||||
config_entry = MockConfigEntry(
|
||||
domain=DOMAIN,
|
||||
unique_id=TEST_GATEWAY_ID,
|
||||
data={
|
||||
"host": "gateway-1234-5678-9123.local:9999",
|
||||
"token": TEST_TOKEN,
|
||||
"verify_ssl": False,
|
||||
"hub": TEST_SERVER,
|
||||
"api_type": "local",
|
||||
},
|
||||
)
|
||||
config_entry.add_to_hass(hass)
|
||||
|
||||
result = await hass.config_entries.flow.async_init(
|
||||
DOMAIN,
|
||||
data=FAKE_ZERO_CONF_INFO_LOCAL,
|
||||
context={"source": config_entries.SOURCE_ZEROCONF},
|
||||
)
|
||||
|
||||
assert result["type"] is FlowResultType.ABORT
|
||||
assert result["reason"] == "already_configured"
|
||||
assert config_entry.data["host"] == "gateway-1234-5678-9123.local:8443"
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
async def setup_rexel_credentials(hass: HomeAssistant) -> None:
|
||||
"""Set up the application credential used by the Rexel OAuth2 flow."""
|
||||
|
||||
Reference in New Issue
Block a user