Skip to content

Cover light turn on/off command failure paths - #990

Open
zigpy-review-bot wants to merge 1 commit into
zigpy-bot/light-buffer-on-off-during-transitionfrom
zigpy-bot/light-command-failure-coverage
Open

zigpy-review-bot wants to merge 1 commit into
zigpy-bot/light-buffer-on-off-during-transitionfrom
zigpy-bot/light-command-failure-coverage

Conversation

@zigpy-review-bot

Copy link
Copy Markdown
Collaborator

Summary

Adds tests for the light platform's turn on / turn off command failure paths, which a full-suite coverage run of #989 showed as uncovered (they are unrelated to the on_off buffering change). Stacked on #989.

Changes

  • tests/test_light.py only: a failed move_to_level_with_on_off, on, off, move_to_color_temp / move_to_color and the enhanced-transition move_to_level no longer go untested. Each test asserts the entity keeps its previous state, and where the code releases the transitioning flag on failure, that it does.

Testing

tests/test_light.py passes (35 tests: 25 on #989 plus the 10 added here). The previously uncovered failure-handling lines in async_turn_on / async_turn_off / async_handle_color_commands are now hit. Other light-platform gaps (polling, group assume-state paths, color-mode aggregation, the property fallbacks without a color cluster) are left for later.

@codecov

codecov Bot commented Oct 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (zigpy-bot/light-buffer-on-off-during-transition@1365322). Learn more about missing BASE report.

Additional details and impacted files
@@                                Coverage Diff                                 @@
##             zigpy-bot/light-buffer-on-off-during-transition     #990   +/-   ##
==================================================================================
  Coverage                                                   ?   97.81%           
==================================================================================
  Files                                                      ?       61           
  Lines                                                      ?    10878           
  Branches                                                   ?        0           
==================================================================================
  Hits                                                       ?    10640           
  Misses                                                     ?      238           
  Partials                                                   ?        0           

☔ View full report in Codecov by Harness.
📢 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

code quality Improvement to code quality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant