Ejemplo n.º 1
0
def send_sound(soundid):
    """
    Play a sound on the fonera.
    The parameter is an index into a list of predefined sounds.
    Sad trombone anyone?
    """
    handlers.send("sound {}\n".format(soundid))
Ejemplo n.º 2
0
def send_sound(soundid):
    """
    Play a sound on the fonera.
    The parameter is an index into a list of predefined sounds.
    Sad trombone anyone?
    """
    handlers.send("sound {}\n".format(soundid))
Ejemplo n.º 3
0
def send_status(value):
    """
    Send open or close status to the BITS Fonera.
    Status can be either 0 / 1 or Status.CLOSED / Status.OPEN
    """
    try:
        value = int(value)
    except ValueError:
        value = 1 if value == Status.OPEN else 0

    handlers.send("status {}\n".format(value))
Ejemplo n.º 4
0
def send_status(value):
    """
    Send open or close status to the BITS Fonera.
    Status can be either 0 / 1 or Status.CLOSED / Status.OPEN
    """
    try:
        value = int(value)
    except ValueError:
        value = 1 if value == Status.OPEN else 0

    handlers.send("status {}\n".format(value))
Ejemplo n.º 5
0
def send_message(text):
    """
    A message is added to the list of messages shown on the Fonera display.
    """
    handlers.send("message {}\n".format(base64.b64encode(text.encode('utf-8'))))
Ejemplo n.º 6
0
def send_message(text):
    """
    A message is added to the list of messages shown on the Fonera display.
    """
    handlers.send("message {}\n".format(base64.b64encode(
        text.encode('utf-8'))))