コード例 #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))
コード例 #2
0
ファイル: notifier.py プロジェクト: thypon/bits-server
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))
コード例 #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))
コード例 #4
0
ファイル: notifier.py プロジェクト: thypon/bits-server
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))
コード例 #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'))))
コード例 #6
0
ファイル: notifier.py プロジェクト: thypon/bits-server
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'))))