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 ('tan' in command) 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