import pyarrow as pa | |
from dora import DoraStatus | |
from utils import speak, play | |
from time import sleep | |
class Operator: | |
def __init__(self): | |
self.location = ["KITCHEN", "OFFICE"] | |
self.music = ["office.mp3"] | |
def speak(self, text: str): | |
speak(text) | |
def play(self, file: str): | |
play(file) | |
def on_event(self, event: dict, send_output) -> DoraStatus: | |
if event["type"] == "INPUT": | |
id = event["id"] | |
# On initialization | |
if id == "init": | |
send_output("go_to", pa.array([""])) | |
elif id == "reached_office": | |
pass | |
elif id == "reached_kitchen": | |
pass | |
return DoraStatus.CONTINUE | |