fix(soccer): use correct ScrollHelper constructor signature#31
fix(soccer): use correct ScrollHelper constructor signature#31ChuckBuilds merged 1 commit intomainfrom
Conversation
ScrollHelper.__init__() only accepts (display_width, display_height, logger) but soccer's ScrollDisplay was passing scroll_speed and target_fps kwargs, causing a TypeError. Fix to use the correct 3-arg constructor and configure via setter methods (matching hockey-scoreboard's working pattern). Also fixes is_scroll_complete() to call the correct method name on ScrollHelper (is_scroll_complete, not is_complete). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
📝 WalkthroughWalkthroughThe changes refactor ScrollHelper initialization from a guarded construction to a simplified positional-argument approach, followed by a dedicated private configuration method that applies scroll settings, converts speed to pixels-per-frame, and enables frame-based scrolling. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 3 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
⚔️ Resolve merge conflicts (beta)
Tip Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord. 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. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
plugins/soccer-scoreboard/scroll_display.py (1)
154-180: Remove the redundant firstset_scroll_speedcall on line 156.Line 156 sets
scroll_speed(px/s), but line 180 unconditionally overwrites it withpixels_per_frame(px/frame). The first call has no effect and can be removed.♻️ Suggested refactor
- # Set scroll speed (pixels per second in time-based mode) - scroll_speed = scroll_settings.get('scroll_speed', 50.0) - self.scroll_helper.set_scroll_speed(scroll_speed) - # Set scroll delay + scroll_speed = scroll_settings.get('scroll_speed', 50.0) scroll_delay = scroll_settings.get('scroll_delay', 0.01) self.scroll_helper.set_scroll_delay(scroll_delay)
ScrollHelper.init() only accepts (display_width, display_height, logger) but soccer's ScrollDisplay was passing scroll_speed and target_fps kwargs, causing a TypeError. Fix to use the correct 3-arg constructor and configure via setter methods (matching hockey-scoreboard's working pattern).
Also fixes is_scroll_complete() to call the correct method name on ScrollHelper (is_scroll_complete, not is_complete).
Summary by CodeRabbit