Created
August 6, 2020 06:54
-
-
Save forslund/24be357fd6279f252d673c3457c439e9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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