♻️ Extract _try_fetch helper to collapse try/except duplication #47
No reviewers
Labels
No labels
v1.0 · bloquant
v1.0 · majeur
v1.0 · mineur
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
mat/homeassistant-comwatt!47
Loading…
Reference in a new issue
No description provided.
Delete branch "refactor/try-fetch-helper"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Pure, behavior-preserving refactor of
coordinator.py.Collapses the 4 repeated
try/except ComwattAuthError: raise / except Exception: <fallback>blocks (site time-series, device power, device energy, switch refresh) into a single_try_fetch(fn, *args)helper that re-raises auth errors and returnsNoneon any other failure. Call sites guard withis not None/or {}.