Skip to content

Commit 83da1cd

Browse files
cyberjunkyclaude
andcommitted
feat: add skip_strategies to Client for targeted login testing
Allows disabling specific login strategies at runtime to isolate which path is working or failing: g = Garmin(email, password) g.client.skip_strategies = {"mobile+cffi", "mobile+requests"} g.login(tokenstore) # forces widget+cffi only Valid names: mobile+cffi, mobile+requests, widget+cffi, portal+cffi, portal+requests Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 2e43aca commit 83da1cd

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

garminconnect/client.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,10 @@ def __init__(self, domain: str = "garmin.com", **kwargs: Any) -> None:
204204
self._api_session.mount("https://", api_adapter)
205205

206206
self._tokenstore_path: str | None = None
207+
# Set of strategy names to skip during login, e.g. {"mobile+cffi"}.
208+
# Valid names: mobile+cffi, mobile+requests, widget+cffi,
209+
# portal+cffi, portal+requests
210+
self.skip_strategies: set[str] = set()
207211

208212
@property
209213
def is_authenticated(self) -> bool:
@@ -267,6 +271,11 @@ def login(
267271
lambda: self._portal_web_login_requests(email, password),
268272
),
269273
]
274+
if self.skip_strategies:
275+
strategies = [
276+
(n, fn) for n, fn in strategies if n not in self.skip_strategies
277+
]
278+
_LOGGER.debug("Skipping login strategies: %s", self.skip_strategies)
270279

271280
last_err: Exception | None = None
272281
rate_limited_count = 0

0 commit comments

Comments
 (0)