fix(philips_hue): retry on transient bridge blips, not just IP changes#187
Merged
Conversation
Self-heal (#183) only retried when rediscovery returned a *different* IP, so a momentary ConnectionError while the bridge stayed at the same address still surfaced as 'Could not reach' (observed live). Now: a quick retry absorbs brief blips, and the rediscovery retry fires whenever the bridge is verified reachable — same IP or new. Adds a regression test (transient at unchanged IP must not error). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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
The self-heal from #183 only retried when rediscovery returned a different IP. So a momentary
ConnectionErrorwhile the bridge stayed at the same address (a brief Wi-Fi/bridge blip) still surfaced as 'Could not reach Hue Bridge' — observed live after #183 merged.Fix
On
ConnectionError: (1) a quick retry at the same IP absorbs a brief blip; (2) if still failing, rediscover (which verifies the bridge is actually reachable) and retry at its current address — same IP or new. A confirmed-reachable bridge is always worth one retry.Test
tests/test_philips_hue.py: transientConnectionErrorat an unchanged IP must not error (RED before, GREEN after). 19 hue/discovery tests pass; ruff clean; manifest regenerated.🤖 Generated with Claude Code