SamSwift commited on
Commit
1975e4a
·
1 Parent(s): 9b411b3

Update script.py

Browse files
Files changed (1) hide show
  1. script.py +27 -21
script.py CHANGED
@@ -4,37 +4,44 @@ import requests
4
  def activate_hausa(command):
5
  try:
6
  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()):
7
- requests.get('https://blynk.cloud/external/api/update?token=G8ynpU1qu1pivhBZuJwaI542ijnLAOsv&v0=0')
8
- return "Ok, I'm turning on the parlor light"
9
-
10
- 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()):
11
  requests.get('https://blynk.cloud/external/api/update?token=G8ynpU1qu1pivhBZuJwaI542ijnLAOsv&v0=1')
12
- return "Ok, I'm turning off the parlor light"
 
 
 
 
 
 
 
 
 
 
 
13
  else:
14
  return "Couldn't quite understand that, try again"
15
  except (TypeError, AttributeError) as e:
16
  pass
17
 
18
 
19
- def activate_english(command):
20
- try:
21
- if command == 'turn off parlor light':
22
- requests.get('https://blynk.cloud/external/api/update?token=G8ynpU1qu1pivhBZuJwaI542ijnLAOsv&v0=0')
23
- return "Ok, I'm turning on the parlor light"
24
- elif command == 'turn on parlor light':
25
- requests.get('https://blynk.cloud/external/api/update?token=G8ynpU1qu1pivhBZuJwaI542ijnLAOsv&v0=1')
26
- return "Ok, I'm turning off the parlor light"
27
- else:
28
- return "Couldn't quite understand that, try again"
29
- except NoneType as e:
30
- pass
31
 
32
 
33
  def activate_yoruba(command):
34
  try:
35
- if ('tan' in command and 'pá lọ̀' in command.split()) or ('tọ' in command and 'pa lọ̀' in command.split()) or ('tan' in command) or ('tọ́' in command and ' lọ' in command.split()):
36
  requests.get('https://blynk.cloud/external/api/update?token=G8ynpU1qu1pivhBZuJwaI542ijnLAOsv&v0=0')
37
- return "Ok!, I'm turning on the parlor light"
38
 
39
  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()):
40
  requests.get('https://blynk.cloud/external/api/update?token=G8ynpU1qu1pivhBZuJwaI542ijnLAOsv&v0=1')
@@ -43,5 +50,4 @@ def activate_yoruba(command):
43
  return "Couldn't quite understand that, try again"
44
  except (TypeError, AttributeError) as e:
45
  pass
46
-
47
-
 
4
  def activate_hausa(command):
5
  try:
6
  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()):
 
 
 
 
7
  requests.get('https://blynk.cloud/external/api/update?token=G8ynpU1qu1pivhBZuJwaI542ijnLAOsv&v0=1')
8
+ return "Ok, i'm turning on the parlor light!"
9
+
10
+ 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()):
11
+ requests.get('https://blynk.cloud/external/api/update?token=G8ynpU1qu1pivhBZuJwaI542ijnLAOsv&v0=0')
12
+ return "Ok, i'm turning off the parlor light!"
13
+
14
+ 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()):
15
+ requests.get('https://blynk.cloud/external/api/update?token=G8ynpU1qu1pivhBZuJwaI542ijnLAOsv&v2=0')
16
+ return "Ok, i'm turning on the socket!"
17
+ elif ('kashi' in command and 'soketh' 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 ('ka shi' in command and 'soketh' in command.split()) or ('kashe' in command and 'soketh' in command.spilt()):
18
+ requests.get('https://blynk.cloud/external/api/update?token=G8ynpU1qu1pivhBZuJwaI542ijnLAOsv&v2=1')
19
+ return "Ok, i'm turning off the socket!"
20
  else:
21
  return "Couldn't quite understand that, try again"
22
  except (TypeError, AttributeError) as e:
23
  pass
24
 
25
 
26
+ # def activate_english(command):
27
+ # try:
28
+ # if command == 'turn off parlor light':
29
+ # requests.get('https://blynk.cloud/external/api/update?token=G8ynpU1qu1pivhBZuJwaI542ijnLAOsv&v0=0')
30
+ # return "Ok, i'm turning on the parlor light"
31
+ # elif command == 'turn on parlor light':
32
+ # requests.get('https://blynk.cloud/external/api/update?token=G8ynpU1qu1pivhBZuJwaI542ijnLAOsv&v0=1')
33
+ # return "Ok, i'm turning off the parlor light"
34
+ # else:
35
+ # return "Couldn't quite understand that, try again"
36
+ # except NoneType as e:
37
+ # pass
38
 
39
 
40
  def activate_yoruba(command):
41
  try:
42
+ 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ẹ̀ ' in command.split()):
43
  requests.get('https://blynk.cloud/external/api/update?token=G8ynpU1qu1pivhBZuJwaI542ijnLAOsv&v0=0')
44
+ return "Ok!, i'm turning on the parlor light"
45
 
46
  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()):
47
  requests.get('https://blynk.cloud/external/api/update?token=G8ynpU1qu1pivhBZuJwaI542ijnLAOsv&v0=1')
 
50
  return "Couldn't quite understand that, try again"
51
  except (TypeError, AttributeError) as e:
52
  pass
53
+