Skip to content

Commit

Permalink
Add debugging to assist in debugging already configured error (home-a…
Browse files Browse the repository at this point in the history
  • Loading branch information
allenporter authored and frenck committed Jan 19, 2024
1 parent 5521ab0 commit d2feee8
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions homeassistant/components/google/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,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,
Expand Down

0 comments on commit d2feee8

Please sign in to comment.