Skip to content

Instantly share code, notes, and snippets.

@forslund
Created August 6, 2020 06:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save forslund/24be357fd6279f252d673c3457c439e9 to your computer and use it in GitHub Desktop.
Save forslund/24be357fd6279f252d673c3457c439e9 to your computer and use it in GitHub Desktop.
rom mycroft_bus_client import MessageBusClient, Message
print('Setting up client to connect to a local mycroft instance')
client = MessageBusClient()
def print_listening(message):
print('Mycroft is listening')
def print_not_listening(message):
print('Mycroft is not listening')
print('Registering handler for listening status...')
client.on('recognizer_loop:record_begin', print_listening)
client.on('recognizer_loop:record_end', print_not_listening)
print('Waiting for messages')
client.run_forever()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment