Controller

The controller is responsible for handling most of the logic of Dobby and mixing everything together

class dobby.controller.Controller(event_queue, tts_queue, session, recognizer, recognition_timeout, failed_message, confirmation_messages)[source]

Bases: threading.Thread

Threaded controller that holds the main logic of Dobby. It grabs events as they come and put corresponding (according to the database) processed actions in the queue. Error message and confirmation messages are customizable

Parameters:
  • event_queue (Queue.Queue) – where to listen for events
  • tts_queue (Queue.Queue) – where to put the tts from processed actions
  • session (Session) – Dobby database session
  • recognition_timeout (integer) – time to wait for a Command to be recognized once a RecognitionEvent is received
  • failed_message (string) – error message to say when the recognized Command does not match anything in the database
  • confirmation_messages (list) – a random message to say is picked and sent to the action queue whenever a RecognitionEvent is caught
stop()[source]

Stop the thread