File size: 3,853 Bytes
564de44
 
 
 
 
 
 
1975e4a
 
 
 
 
 
 
7be7990
1975e4a
d6440e0
7be7990
1975e4a
564de44
 
 
 
 
 
1975e4a
 
 
 
 
 
 
 
 
 
 
 
564de44
 
 
 
1975e4a
564de44
1975e4a
564de44
 
 
94c0b94
564de44
 
 
 
1975e4a
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
49
50
51
52
53
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=1')
            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 ('kashe' in command and 'falo' in command.spilt()):
            requests.get('https://blynk.cloud/external/api/update?token=G8ynpU1qu1pivhBZuJwaI542ijnLAOsv&v0=0')
            return "Ok, i'm turning off the parlor light!"
        
        elif ('akan' in command and 'soƙet' in command.split()) or ('akan' in command and 'soketh' in command.split()) or ('akan' in command and 'soket' in command.split()) or ('a kan' in command and 'soketh' in command.split()) or ('a kan' in command and 'soket' in command.split()):
            requests.get('https://blynk.cloud/external/api/update?token=G8ynpU1qu1pivhBZuJwaI542ijnLAOsv&v2=1')
            return "Ok, i'm turning on the socket!"
        elif ('kashi' in command and 'soket' in command.split()) or ('ka shi' in command and 'soketh' in command.split()) or ('kashi' in command and 'soket' in command.split()) or ('kashi' in command and 'soƙet' in command.split()) or ('kashe' in command and 'soket' in command.split()) or ('kashe' in command and 'soketh' in command.spilt()):
            requests.get('https://blynk.cloud/external/api/update?token=G8ynpU1qu1pivhBZuJwaI542ijnLAOsv&v2=0')
            return "Ok, i'm turning off the socket!"
        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 ('tọ' in command and 'ìjẹ̀wo' in command.split()) or ('tan' in command and 'ìjẹowó' in command.split()) or ('tán' in command and 'ìjẹowó' in command.split()) or ('tọ́' in command and 'ìjẹ̀ wó' 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