Skip to content

Commit

Permalink
fix/ocp_missing_context (#104)
Browse files Browse the repository at this point in the history
missed OCPQuery class in previous PR
  • Loading branch information
JarbasAl authored Jul 12, 2024
1 parent 67e3c57 commit 8f29333
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions ovos_bus_client/apis/ocp.py
Original file line number Diff line number Diff line change
Expand Up @@ -529,20 +529,21 @@ def reset(self):
else:
self.has_gui = is_gui_running() or is_gui_connected(self.bus)

def send(self, skill_id: str = None):
@_ensure_message_kwarg()
def send(self, skill_id: str = None, source_message: Optional[Message] = None):
self.query_replies = []
self.query_timeouts = self.config.get("min_timeout", 5)
self.search_start = time.time()
self.searching = True
self.register_events()
if skill_id:
self.bus.emit(Message(f'ovos.common_play.query.{skill_id}',
{"phrase": self.query,
"question_type": self.media_type}))
self.bus.emit(source_message.forward(f'ovos.common_play.query.{skill_id}',
{"phrase": self.query,
"question_type": self.media_type}))
else:
self.bus.emit(Message('ovos.common_play.query',
{"phrase": self.query,
"question_type": self.media_type}))
self.bus.emit(source_message.forward('ovos.common_play.query',
{"phrase": self.query,
"question_type": self.media_type}))

def wait(self):
try:
Expand Down

0 comments on commit 8f29333

Please sign in to comment.