Skip to content

Fix retry loop exhausting API quota when initialization fails#16

Merged
TillBrede merged 2 commits into
symcon:masterfrom
bumaas:master
Jun 19, 2026
Merged

Fix retry loop exhausting API quota when initialization fails#16
TillBrede merged 2 commits into
symcon:masterfrom
bumaas:master

Conversation

@bumaas

@bumaas bumaas commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Problem

When InitializeDevice() is called and the device is offline or the API rate limit is hit mid-way through setupSettings(), the InitializationSignature attribute was only written at the end of the successful code path (inside the if ($this->createStates()) block).

This meant that on every subsequent trigger (e.g. IM_CHANGESTATUS, FM_CONNECT, CONNECTED event), needsInitialization() returned true and InitializeDevice() was called again — exhausting the daily API quota of 1000 requests.

Fix

Move WriteAttributeString('InitializationSignature', ...) to the beginning of InitializeDevice(), before any API calls. This ensures the signature is stored immediately, so repeated initialization attempts are suppressed even when the device is offline or an error occurs mid-initialization.

Changes

  • Home Connect Device/module.php: Move WriteAttributeString('InitializationSignature', ...) to the start of InitializeDevice()
  • library.json: Bump build to 11

🤖 Generated with Claude Code

bumaas and others added 2 commits June 19, 2026 08:56
Write InitializationSignature at the start of InitializeDevice() instead
of at the end. Previously, if createStates() failed (device offline) or
setupSettings() was interrupted (rate limit hit mid-way), the signature
was never written. Any subsequent IM_CHANGESTATUS or CONNECTED event would
re-trigger InitializeDevice(), burning through the 1000 requests/day limit.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@TillBrede TillBrede merged commit ffbe8c3 into symcon:master Jun 19, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants