Fix stuck light transitioning flag after task cancellation#672
Draft
TheJulianJES wants to merge 4 commits intozigpy:devfrom
Draft
Fix stuck light transitioning flag after task cancellation#672TheJulianJES wants to merge 4 commits intozigpy:devfrom
TheJulianJES wants to merge 4 commits intozigpy:devfrom
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## dev #672 +/- ##
==========================================
- Coverage 97.44% 97.43% -0.02%
==========================================
Files 62 62
Lines 10731 10740 +9
==========================================
+ Hits 10457 10464 +7
- Misses 274 276 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
DRAFT.
The Git diff is horrible to look at, but it's just
try/finallybeing added in those parts and one small guard (59611bf).AI summary
When a
mode: restartautomation fires while a light turn-on or turn-off is in progress, Home Assistant cancels the running asyncio task. If that cancellation lands betweenasync_transition_set_flag()andasync_transition_start_timer(), the_transitioning_individualflag is leftTruewith no timer to clear it. The light then ignores all incoming attribute reports indefinitely.async_turn_onandasync_turn_offintry/finallyblocks. Thefinallyclause callsasync_transition_complete()when the flag is stuck (set but no timer running), covering task cancellation and unexpected exceptions.move_to_levelcall in thenew_color_provided_while_offpath failed, the code returned without callingasync_transition_complete()or starting the transition timer — leaving the flag stuck.