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))
示例#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))
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))
示例#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))
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'))))
示例#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'))))