示例#1
0
def process(topic, msg):
    global Repmsg
    for i in range(0, len(Repmsg)):
        if Repmsg[i]['listenfor'] == topic:
            if Repmsg[i]['whenmsg'] == msg:
                clees_mqtt.publish(Repmsg[i]['sendto'], Repmsg[i]['withmsg'])
示例#2
0
def send_output_deactivated(i):
    global Outputs
    topic = clees_mqtt.gettopicstr('rep', 'o', Outputs[i]['id'])
    clees_mqtt.publish(topic, 'deactivated')
    return (0)
示例#3
0
def send_turnout_thrown(i):
    global Turnouts
    topic = clees_mqtt.gettopicstr('rep', 't', Turnouts[i]['id'])
    clees_mqtt.publish(topic, 'thrown')
    return (0)
示例#4
0
def send_turnout_changing(i):
    global Turnouts
    topic = clees_mqtt.gettopicstr('rep', 't', Turnouts[i]['id'])
    clees_mqtt.publish(topic, 'changing')
    return (0)
示例#5
0
def send_button_deactivated(i):
    global Buttons
    topic = clees_mqtt.gettopicstr('rep', 'b', Buttons[i]['id'])
    msg = 'deactivated'
    clees_mqtt.publish(topic, msg)
    return (0)