From 558a49cb6647e7be1d27a204f80830c824d2c0d6 Mon Sep 17 00:00:00 2001 From: Manu <4445816+tr4nt0r@users.noreply.github.com> Date: Wed, 18 Feb 2026 19:48:37 +0100 Subject: [PATCH] Fix data update in WebhookFlowHandler to preserve existing entry data (#163372) --- homeassistant/helpers/config_entry_flow.py | 2 +- tests/helpers/test_config_entry_flow.py | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/homeassistant/helpers/config_entry_flow.py b/homeassistant/helpers/config_entry_flow.py index d736f3abb84..7e38dff3a31 100644 --- a/homeassistant/helpers/config_entry_flow.py +++ b/homeassistant/helpers/config_entry_flow.py @@ -265,7 +265,7 @@ class WebhookFlowHandler(config_entries.ConfigFlow): if self.source == config_entries.SOURCE_RECONFIGURE: if self.hass.config_entries.async_update_entry( entry=entry, - data={"webhook_id": webhook_id, "cloudhook": cloudhook}, + data={**entry.data, "webhook_id": webhook_id, "cloudhook": cloudhook}, ): self.hass.config_entries.async_schedule_reload(entry.entry_id) return self.async_abort( diff --git a/tests/helpers/test_config_entry_flow.py b/tests/helpers/test_config_entry_flow.py index e05c20f8726..4e29972191a 100644 --- a/tests/helpers/test_config_entry_flow.py +++ b/tests/helpers/test_config_entry_flow.py @@ -517,7 +517,12 @@ async def test_webhook_reconfigure_flow( ) -> None: """Test webhook reconfigure flow.""" config_entry = MockConfigEntry( - domain="test_single", data={"webhook_id": "12345", "cloudhook": False} + domain="test_single", + data={ + "webhook_id": "12345", + "cloudhook": False, + "other_entry_data": "not_changed", + }, ) config_entry.add_to_hass(hass) @@ -546,6 +551,7 @@ async def test_webhook_reconfigure_flow( } assert config_entry.data["webhook_id"] == "12345" assert config_entry.data["cloudhook"] is False + assert config_entry.data["other_entry_data"] == "not_changed" async def test_webhook_reconfigure_cloudhook(