Exemple #1
0
def duerPowerState(state):
    ''' '''

    BLINKER_LOG('need set power state: ', state)

    BlinkerDuerOS.powerState(state)
    BlinkerDuerOS.print()
Exemple #2
0
def duerPowerState(state, num):
    ''' '''

    BLINKER_LOG("need set outlet: ", num, ", power state: ", state)

    BlinkerDuerOS.powerState(state, num)
    BlinkerDuerOS.print()
def duerPowerState(state, num):
    ''' '''

    BLINKER_LOG("need set outlet: ", num, ", power state: ", state)

    global wsState
    wsState[num] = state

    if num == 0 and state == 'false':
        for i in len(wsState):
            wsState[i] = state

    BlinkerDuerOS.powerState(state, num)
    BlinkerDuerOS.print()
Exemple #4
0
def duerQuery(queryCode, num):
    ''' '''

    BLINKER_LOG("DuerOS Query outlet: ", num, ", codes: ", queryCode)

    if queryCode == BLINKER_CMD_QUERY_ALL_NUMBER:
        BLINKER_LOG('DuerOS Query All')
        BlinkerDuerOS.powerState(wsState, num)
        BlinkerDuerOS.print()
    elif queryCode == BLINKER_CMD_QUERY_POWERSTATE_NUMBER:
        BlinkerDuerOS.powerState(wsState, num)
        BlinkerDuerOS.print()
    else:
        BlinkerDuerOS.powerState(wsState, num)
        BlinkerDuerOS.print()
def duerQuery(queryCode, num):
    ''' '''

    BLINKER_LOG("DuerOS Query outlet: ", num, ", codes: ", queryCode)

    global wsState
    state = 'off'

    for i, val in enumerate(wsState):
        if i == num:
            state = val

    if queryCode == BLINKER_CMD_QUERY_ALL_NUMBER:
        BLINKER_LOG('DuerOS Query All')
        BlinkerDuerOS.powerState(state, num)
        BlinkerDuerOS.print()
    elif queryCode == BLINKER_CMD_QUERY_POWERSTATE_NUMBER:
        BlinkerDuerOS.powerState(state, num)
        BlinkerDuerOS.print()
    else:
        BlinkerDuerOS.powerState(state, num)
        BlinkerDuerOS.print()