Skip to content

Fall back to color without saved movies - #53

Merged
jschlyter merged 1 commit into
jschlyter:mainfrom
simon-lee-1:fix-empty-movie-turn-on
Sep 10, 2026
Merged

jschlyter merged 1 commit into
jschlyter:mainfrom
simon-lee-1:fix-empty-movie-turn-on

Conversation

@simon-lee-1

@simon-lee-1 simon-lee-1 commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

When the default mode is movie but no movies are saved, turn_on() succeeds without displaying anything. Fall back to color in that case while preserving explicit defaults and valid movie mode.

Tests cover empty movies, saved movies, and non-movie defaults.

Summary by CodeRabbit

  • Bug Fixes
    • Improved turn-on behavior when Movie mode is selected by falling back to Color mode if no saved movies are available.
    • Preserved Movie mode when saved movies exist.
    • Avoided unnecessary movie checks for other supported default modes.

@coderabbitai

coderabbitai Bot commented Sep 10, 2026 •

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: ab1baea8-1119-4d75-b33b-690baf1c219e

📥 Commits

Reviewing files that changed from the base of the PR and between 3f8ea55 and a6f986e.

📒 Files selected for processing (2)
  • tests/test_turn_on.py
  • ttls/client.py

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

Twinkly.turn_on() now checks for saved movies when the default mode is "movie". It selects "color" when no movies exist and preserves explicit non-movie modes. Tests cover each behavior.

Changes

Turn-on mode selection

Layer / File(s) Summary
Movie fallback and mode tests
ttls/client.py, tests/test_turn_on.py
turn_on() checks saved movies for movie mode, falls back to "color" when the list is empty, and retains "movie" when a movie exists. Tests verify that non-movie modes skip the movie query.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: olen

Merge Risk: ⚪ Minimal · up to a6f98

Devices with movie mode selected but no saved movies now turn on in color mode; covered cases preserve existing movie and explicit non-movie behavior, with no active merge-blocking risk.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 42.86% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 7 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: turn_on() falls back to color mode when no saved movies exist.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@jschlyter
jschlyter merged commit 83fa4c8 into jschlyter:main Sep 10, 2026
6 checks passed
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.

2 participants