Exemplo n.º 1
0
def bi_state_relay_output(key,value):
    relay=control_relay.get("bi_state")
    str1=relay.get(key)
    if value=="on":
        out_str=str1[0]
        print '\n%s relay01 on' %key
        println(out_str)
    else:
        out_str=str1[1]
        print '\n%s relay01 off' %key
        println(out_str)
Exemplo n.º 2
0
def tri_state_relay_output(key,value):
    relay=control_relay.get("tri_state")
    str1=relay.get(key)
    if value=="on":
        out_str=str1.get("off")[1]
        print '\n%s relay02 off' %key
        println(out_str)
        out_str=str1.get("on")[0]
        print '%s relay01 on' %key
        println(out_str)
    elif value=="off":
        out_str=str1.get("off")[1]
        print '\n%s relay01 off' %key
        println(out_str)
        out_str=str1.get("on")[0]
        print '%s relay02 on' %key
        println(out_str)
    else:
        out_str=str1.get("off")[1]
        print '\n%s relay01 off' %key
        println(out_str)
        out_str=str1.get("on")[1]
        print '%s relay02 off' %key
        println(out_str)