Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions homeassistant/components/icloud/account.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def setup(self) -> None:

if self.api.requires_2fa:
# Trigger a new log in to ensure the user enters the 2FA code again.
raise PyiCloudFailedLoginException # noqa: TRY301
raise PyiCloudFailedLoginException("2FA Required") # noqa: TRY301
Comment thread
PaulCavill marked this conversation as resolved.
Outdated

except PyiCloudFailedLoginException:
self.api = None
Expand Down Expand Up @@ -151,7 +151,7 @@ def setup(self) -> None:
)

self._devices = {}
self.update_devices()
self.hass.add_job(self.update_devices)
Comment thread
PaulCavill marked this conversation as resolved.
Outdated

def update_devices(self) -> None:
"""Update iCloud devices."""
Expand Down
4 changes: 2 additions & 2 deletions homeassistant/components/icloud/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,8 @@ async def _validate_and_create_entry(self, user_input, step_id):
CONF_GPS_ACCURACY_THRESHOLD: self._gps_accuracy_threshold,
}

# If this is a password update attempt, update the entry instead of creating one
if step_id == "user":
# If this is a password update attempt, don't try and creating one
if step_id == "user" and not self._existing_entry_data:
Comment thread
PaulCavill marked this conversation as resolved.
Outdated
return self.async_create_entry(title=self._username, data=data)

entry = await self.async_set_unique_id(self.unique_id)
Expand Down
Loading