From b24222bd1ddfe17345f8bb5b705e7d96ab06a81e Mon Sep 17 00:00:00 2001 From: Allen Porter Date: Tue, 16 Jan 2024 08:05:35 -0800 Subject: [PATCH] Add debugging to assist in debugging already configured error (#108134) --- homeassistant/components/google/config_flow.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/homeassistant/components/google/config_flow.py b/homeassistant/components/google/config_flow.py index a9d707fe4bf6b6..ab38e67479f471 100644 --- a/homeassistant/components/google/config_flow.py +++ b/homeassistant/components/google/config_flow.py @@ -215,6 +215,12 @@ async def async_oauth_create_entry(self, data: dict) -> FlowResult: _LOGGER.error("Error reading primary calendar: %s", err) return self.async_abort(reason="cannot_connect") await self.async_set_unique_id(primary_calendar.id) + + if found := self.hass.config_entries.async_entry_for_domain_unique_id( + self.handler, primary_calendar.id + ): + _LOGGER.debug("Found existing '%s' entry: %s", primary_calendar.id, found) + self._abort_if_unique_id_configured() return self.async_create_entry( title=primary_calendar.id,