Skip to content

Commit 35fd7a0

Browse files
committed
chore(config_flow): use DOMAIN constant + clear pending cred after commit
Two small cleanups in async_oauth_create_entry / _commit_pending_credential: - Replace the two remaining "u_tec" string literals with the DOMAIN constant for consistency with the rest of the file (and with async_migrate_entry, which already uses DOMAIN throughout). - Clear self._pending_credential after the successful commit. Not a bug today (the flow doesn't loop back), but prevents a footgun if anyone later adds a retry path that would re-commit the same cred.
1 parent dfd494b commit 35fd7a0

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

custom_components/u_tec/config_flow.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,8 @@ async def async_oauth_create_entry(
186186
"""
187187
if self._pending_credential is not None:
188188
await self._commit_pending_credential()
189-
data = {**data, "auth_implementation": "u_tec"}
189+
self._pending_credential = None
190+
data = {**data, "auth_implementation": DOMAIN}
190191

191192
if self.source == SOURCE_RECONFIGURE:
192193
entry = self._get_reconfigure_entry()
@@ -267,7 +268,7 @@ async def _commit_pending_credential(self) -> None:
267268
self.hass,
268269
DOMAIN,
269270
self._pending_credential,
270-
"u_tec",
271+
DOMAIN,
271272
)
272273

273274
if storage is not None:

0 commit comments

Comments
 (0)