Skip to content

Solve complexity warning - #956

Merged
bouwew merged 1 commit into
mainfrom
fix-complex
Nov 21, 2026
Merged

bouwew merged 1 commit into
mainfrom
fix-complex

Conversation

@bouwew

@bouwew bouwew commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • Refactor
    • Schedule controls continue to support on and off states, including “Off” selections. Requests are ignored when no active schedule is available or when the requested state is already in effect, avoiding unnecessary updates. After a successful change, the displayed schedule state stays in sync.

@coderabbitai

coderabbitai Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

set_schedule_state now uses helper methods to normalize the requested state, resolve the schedule, detect whether a write is needed, build the XML payload, and update cached schedule activity after a successful write.

Changes: Schedule state updates

Layer / File(s) Summary
Resolve and apply schedule state
plugwise/smile.py
set_schedule_state delegates state validation, schedule-name resolution, update detection, XML construction, and cached activity updates to helpers. It returns without writing when no schedule resolves or when the helper detects that no update is needed.

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

Change: Refactor

Possibly related PRs

Suggested reviewers: compatech

Merge Risk: Minimal · up to 2ea7d

This refactors schedule state handling to reduce code complexity while keeping the same behavior. No actionable merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title "Solve complexity warning" is vague about the change. The raw summary shows that set_schedule_state in plugwise/smile.py was refactored into helper methods for state normalization, schedule-…
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.
Full details: Title check

Explanation

The title "Solve complexity warning" is vague about the change. The raw summary shows that set_schedule_state in plugwise/smile.py was refactored into helper methods for state normalization, schedule-name resolution, update detection, and XML construction, which addresses the complexity warning. The title names the motivation but not the refactor, so it is only partially descriptive. It is not off-topic, and it is not a generic phrase such as "misc updates". The PR objectives confirm the aim is to address a complexity warning in set_schedule_state().

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: fa3cf50b-8cac-4a7c-a34f-266bca3a240d
Commits

Reviewing files that changed from the base of the PR and between b76318d and 2ea7d3a.

Files selected for processing: 1

  • plugwise/smile.py

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

@sonarqubecloud

Copy link
Copy Markdown

@coderabbitai
coderabbitai Bot requested a review from CoMPaTech November 21, 2026 11:49
@codecov

codecov Bot commented Nov 21, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.95%. Comparing base (b76318d) to head (2ea7d3a).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #956   +/-   ##
=======================================
  Coverage   99.95%   99.95%           
=======================================
  Files          21       21           
  Lines        4235     4254   +19     
=======================================
+ Hits         4233     4252   +19     
  Misses          2        2           

☔ 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.

@bouwew
bouwew marked this pull request as ready for review November 21, 2026 11:52
@bouwew
bouwew requested a review from a team as a code owner November 21, 2026 11:52
@bouwew
bouwew merged commit 28e5677 into main Nov 21, 2026
30 checks passed
@bouwew
bouwew deleted the fix-complex branch November 21, 2026 11:53

This branch was successfully deployed

2 active deployments
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.

1 participant