Skip to content

Commit

Permalink
Update client.py
Browse files Browse the repository at this point in the history
  • Loading branch information
JarbasAl authored Nov 20, 2024
1 parent 896f0f6 commit f5bb7ea
Showing 1 changed file with 1 addition and 30 deletions.
31 changes: 1 addition & 30 deletions ovos_bus_client/client/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,8 @@
from ovos_bus_client.message import Message, CollectionMessage, GUIMessage
from ovos_bus_client.session import SessionManager, Session

try:
from mycroft_bus_client import MessageBusClient as _MessageBusClientBase
except ImportError:
# TODO - code in the wild does isinstance checks
# this conditional subclassing should be removed ASAP, it is only here for the migration period
# mycroft_bus_client is abandonware until further notice from MycroftAI

class _MessageBusClientBase:
pass


class MessageBusClient(_MessageBusClientBase):
class MessageBusClient:
"""The Mycroft Messagebus Client
The Messagebus client connects to the Mycroft messagebus service
Expand Down Expand Up @@ -435,22 +425,3 @@ def on_message(self, *args):

parsed_message = GUIMessage.deserialize(message)
self.emitter.emit(parsed_message.msg_type, parsed_message)


@deprecated("No direct replacement", "0.1.0")
def echo():
"""
Echo function repeating all input from a user.
"""

from ovos_bus_client.util import create_echo_function
# TODO: Deprecate in 0.1.0
message_bus_client = MessageBusClient()

def repeat_utterance(message):
message.msg_type = 'speak'
message_bus_client.emit(message)

message_bus_client.on('message', create_echo_function(None))
message_bus_client.on('recognizer_loop:utterance', repeat_utterance)
message_bus_client.run_forever()

0 comments on commit f5bb7ea

Please sign in to comment.