Example #1
0
    def run(self):
        now = datetime.now()
        hour = now.strftime('%-I')
        minute = now.strftime('%M')
        h = NumberToText.convert(hour)
        m = NumberToText.convert(minute)
        print('The time is ' + h + ' ' + m)

        filenames = [h] + m.split(' ')
        Audio.play('sounds/clock.wav')
        for filename in filenames:
            Audio.play('sounds/clock/' + filename + '.wav')
Example #2
0
    def loop(self):
        # Wait for user input.
        word = Listener().listen()

        # Test for all available commands.
        for command in self.available_commands:
            if word == command.split('/')[-1]:
                self.run_command(command)
                self.load_commands(command)
                self.print_commands()
                return

        # If there is a path, then we are awake. We only want to play an error message if we are awake.
        if self.path:
            print('Command not found')
            Audio.play('sounds/error.wav')
        else:
            print('...')
Example #3
0
 def run(self):
     Audio.play('sounds/nevermind.wav')
     print('OK')
Example #4
0
 def run(self):
     print('Awaiting command')
     Audio.play('sounds/wakeup.wav')
Example #5
0
 def run(self):
     Audio.play('sounds/quit.wav')
     sys.exit()
Example #6
0
 def run(self):
     print('RED ALERT')
     Audio.play('sounds/alert.wav')
Example #7
0
 def run(self):
     Audio.play('sounds/rude.wav')
Example #8
0
 def run(self):
     print(choice(config.DINNER_OPTIONS))
     Audio.play('sounds/dinner.wav')