fix: Register MatchTimerComponent with message bus

- Add message_bus.register_component() call in MatchTimerComponent constructor
- Add message_bus.unregister_component() call in shutdown method
- Fixes 'Recipient match_timer not found' warning when sending messages
- Ensures proper message routing to the match timer component
- Component can now receive START_GAME, SCHEDULE_GAMES, and CUSTOM messages
parent c0463982
......@@ -36,6 +36,9 @@ class MatchTimerComponent(ThreadedComponent):
self._timer_lock = threading.RLock()
self._last_update = time.time()
# Register component with message bus
self.message_bus.register_component(self.name)
# Register message handlers
self.message_bus.subscribe(self.name, MessageType.START_GAME, self._handle_start_game)
self.message_bus.subscribe(self.name, MessageType.SCHEDULE_GAMES, self._handle_schedule_games)
......@@ -97,6 +100,9 @@ class MatchTimerComponent(ThreadedComponent):
self.current_fixture_id = None
self.current_match_id = None
# Unregister from message bus
self.message_bus.unregister_component(self.name)
logger.info("MatchTimer component shutdown")
def get_timer_state(self) -> Dict[str, Any]:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment