Skip to content

fix(cen): remove redundant log re-assignment in OWNScenarioPlusCommand builders - #106

Merged
GreenGrassBlueOcean merged 1 commit into
masterfrom
fix/who25-scenario-plus-review-followups
Oct 11, 2026
Merged

GreenGrassBlueOcean merged 1 commit into
masterfrom
fix/who25-scenario-plus-review-followups

Conversation

@GreenGrassBlueOcean

Copy link
Copy Markdown
Contributor

Summary

Follow-up to #91 addressing review feedback from @fedem95 (#91 review) and @GreenGrassBlueOcean (#91 review):

"Minor note: each builder resets _human_readable_log after init already sets it. This is redundant but harmless."

Changes

  1. Remove redundant _human_readable_log re-assignment in OWNScenarioPlusCommand:
    OWNScenarioPlusCommand.__init__ already initializes _human_readable_log = f"Scenario plus {self._where}: {self._action}.".
    The five classmethod builders (turn_on, turn_off, increase, decrease, stop) now directly return cls(...), eliminating redundant re-assignments and matching the pattern used in OWNSceneCommand.
  2. Regression tests in tests/test_who25_scenario_plus.py:
    Extended test_builders_send_the_ts10_frames to assert action, object, and human_readable_log on each builder-constructed command.

Verification

  • ruff check OWNd tests setup.py scripts: clean
  • mypy OWNd tests/typing: 0 issues (26 files)
  • python scripts/verify_library_standards.py: all checks pass
  • python scripts/sync_documentation.py --check: in sync (exit 0)
  • pytest tests/: 1,311 passed

…d builders

Address review feedback on PR #91 from @fedem95 and @GreenGrassBlueOcean:
OWNScenarioPlusCommand.__init__ already initializes _human_readable_log to
'Scenario plus {self._where}: {self._action}.'. Re-assigning it in each
builder (turn_on, turn_off, increase, decrease, stop) was redundant.

Simplify builders to directly return cls(...), matching the pattern in
OWNSceneCommand.
Assert action, object, and human_readable_log on builder commands in
tests/test_who25_scenario_plus.py.
@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@fedem95 fedem95 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved. The builders now rely on init for the human-readable log, and the tests verify the frame and parsed properties for all five commands. All checks pass.

@GreenGrassBlueOcean
GreenGrassBlueOcean merged commit 95ad669 into master Oct 11, 2026
16 checks passed
@GreenGrassBlueOcean
GreenGrassBlueOcean deleted the fix/who25-scenario-plus-review-followups branch October 11, 2026 17:39
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.

3 participants