File size: 2,847 Bytes
564de44
 
 
 
 
 
 
94c0b94
564de44
 
 
94c0b94
564de44
 
 
 
 
 
 
 
 
 
94c0b94
564de44
 
94c0b94
564de44
 
 
 
 
 
 
 
 
 
94c0b94
564de44
 
 
94c0b94
564de44
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import requests


def activate_hausa(command):
    try:
        if ('kan' in command and 'fallo' in command.split()) or ('kan' in command and 'falo' in command.split()) or ('kan' in command and 'ballo' in command.split()):
            requests.get('https://blynk.cloud/external/api/update?token=G8ynpU1qu1pivhBZuJwaI542ijnLAOsv&v0=0')
            return "Ok, I'm turning on the parlor light"

        elif ('kashi' in command and 'fallo' in command.split()) or ('ka shi' in command and 'fallo' in command.split()) or ('ka shi' in command and 'balo' in command.split()) or ('kashi' in command and 'falo' in command.split()) or ('ka shi' in command and 'falo' in command.split()) or ('ka she' in command and 'balo' in command.spilt()) or ('ka she' in command and 'ballo' in command.spilt()):
            requests.get('https://blynk.cloud/external/api/update?token=G8ynpU1qu1pivhBZuJwaI542ijnLAOsv&v0=1')
            return "Ok, I'm turning off the parlor light"
        else:
            return "Couldn't quite understand that, try again"
    except (TypeError, AttributeError) as e:
        pass


def activate_english(command):
    try:
        if command == 'turn off parlor light':
            requests.get('https://blynk.cloud/external/api/update?token=G8ynpU1qu1pivhBZuJwaI542ijnLAOsv&v0=0')
            return "Ok, I'm turning on the parlor light"
        elif  command == 'turn on parlor light':
            requests.get('https://blynk.cloud/external/api/update?token=G8ynpU1qu1pivhBZuJwaI542ijnLAOsv&v0=1')
            return "Ok, I'm turning off the parlor light"
        else:
            return "Couldn't quite understand that, try again"
    except NoneType as e:
        pass


def activate_yoruba(command):
    try:
        if ('tan' in command and 'pá lọ̀' in command.split()) or ('tọ' in command and 'pa lọ̀' in command.split()) or ('tán' in command and 'pá lọ' in command.split()) or ('tọ́' in command and 'pá lọ' in command.split()):
            requests.get('https://blynk.cloud/external/api/update?token=G8ynpU1qu1pivhBZuJwaI542ijnLAOsv&v0=0')
            return "Ok!, I'm turning on the parlor light"

        elif ('pá' in command and 'pá lọ' in command.split()) or ('pa' in command and 'pa lọ' in command.split()) or ('pa' in command and 'pà lọ' in command.split()) or ('pà' in command and 'pà lọ' in command.split()) or ('ka shi' in command and 'falo' in command.split()) or ('ka she' in command and 'balo' in command.spilt()) or ('ka she' in command and 'ballo' in command.spilt()):
            requests.get('https://blynk.cloud/external/api/update?token=G8ynpU1qu1pivhBZuJwaI542ijnLAOsv&v0=1')
            return "Ok!, I'm turning off the parlor light"
        else:
            return "Couldn't quite understand that, try again"
    except (TypeError, AttributeError) as e:
        pass