Repository navigation
Conversation
set_image_setting() and set_image_linked_setting() switch off the settings in
the way before they retry a write. If the retry, or the read before it,
raised, the caller only saw the error and never learned that the device had
already changed, and a consumer showing those settings was wrong until its
next poll.
The raised ISAPIError now has an also_changed attribute with the same
{path: value} content as ImageWriteResult.also_changed. It is empty for every
other error.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Contributor
Author
|
This too is from comments left in HA PRs for improvement. |
10 of 22 tasks
set_image_setting reads the current values again before switching a blocker off. A document that could not be parsed there raised ET.ParseError, which callers do not expect, and without also_changed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CqtSBY5RLaetEg5m4j4r6U
baylanger
marked this pull request as ready for review
November 22, 2026 16:53
This branch has not been deployed
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.
set_image_setting()andset_image_linked_setting()resolve conflicts by switching the blocking settings off, in a request of their own, before they retry the change. If the retry (or the read before it) then raised, for example a timeout or a rejected password, the caller only saw the error and never learned that the device had already changed. A consumer that shows those settings is then wrong until its next poll, and nobody is told that a setting was switched off.ISAPIErrornow has analso_changedattribute ({path: new value}, likeImageWriteResult.also_changed). It is empty for every error except those raised by the conflict handling after a blocker was switched off. Existing code that catches the error is not affected. Documented in the README.Tests: 5 new cases in
test/test_image_write.py(a connection error and a 401 after the blockers were switched off, a linked setting, nothing to report when the first request fails, the default). The whole suite passes (283 tests).Written with Claude Code (Claude Sonnet 5.5).