Skip to content

Fix light effect not being turned off sometimes#733

Draft
TheJulianJES wants to merge 2 commits intozigpy:devfrom
TheJulianJES:tjj/light_effect
Draft

Fix light effect not being turned off sometimes#733
TheJulianJES wants to merge 2 commits intozigpy:devfrom
TheJulianJES:tjj/light_effect

Conversation

@TheJulianJES
Copy link
Copy Markdown
Contributor

DRAFT. Should be cleaned up further.

Proposed change

This fixes an issue where sending a light turn on command with a color temperature does not cause some lights to switch into color temperature mode if the "color loop" effect is currently active.

Previously, we only turned off the effect after sending color (temp) commands. Now, we also do it before, though only if we're certain that an effect is active, to not send unnecessary packets.

Notes

Lights continue to be one of the most complicated things to do 100% right. This is the one known issue that happens in some cases.

In general, the light class will be cleaned up soon a bit. I want to increase test coverage for all edge cases before, though.
This PR may be adjusted and merged only after that's done. We'll see.

Additional information

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 1, 2026

Codecov Report

❌ Patch coverage is 85.71429% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 97.66%. Comparing base (696ab1c) to head (aeb75e5).

Files with missing lines Patch % Lines
zha/application/platforms/light/__init__.py 85.71% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##              dev     #733      +/-   ##
==========================================
+ Coverage   97.63%   97.66%   +0.03%     
==========================================
  Files          62       62              
  Lines       10814    10825      +11     
==========================================
+ Hits        10558    10572      +14     
+ Misses        256      253       -3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

TheJulianJES added a commit to TheJulianJES/zha that referenced this pull request Apr 1, 2026
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.

[ZHA] Fix light effects not turning off sometimes

1 participant