Repository navigation
Conversation
The AP logs 'reports xfer complete' before the new image is moved into /current/<mac>.raw, so the immediate fetch could return the previous image and the image entity stayed one picture behind until the next restart. After a transfer, re-fetch with backoff (1-15 s) until the file differs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Member
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
After a successful
drawcustomto an AP tag, theimage.*_contententity often keeps showing the previous picture until HA restarts or the integration is reloaded.The coordinator fires
SIGNAL_TAG_IMAGE_UPDATEwhen the AP logsreports xfer complete, and the image entity immediately fetches/current/<mac>.raw. The AP logs that message just before the new image is in place, so the fetch can return the old file. Seen here: the AP'supdatelastwas 06:45:20, HA refreshed at 06:45:21 and decoded the previous day's image, while the tag and the AP's/current/<mac>.raw(fetched a few minutes later) had the new one.Fix
On the xfer-complete signal,
ESLImagenow re-fetches with backoff (1, 2, 4, 8, 15 s) until the raw file differs from the one it last fetched, then decodes it. If it never changes (the same picture was sent again), it uses the last fetch. A pending re-fetch is cancelled by a newer transfer or when the entity is removed. Dry-run previews (bytes signal) are unchanged and don't affect the comparison.Only
image.pychanges; independent of #363.Testing
Running locally against an AP with BWRY 2.9" tags. Reloading the integration afterwards showed the correct new image, confirming the AP file was already updated shortly after the event.
🤖 Generated with Claude Code