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

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

    BlinkerAliGenie.powerState(state)
    BlinkerAliGenie.print()
Exemple #2
0
def aligenieColor(color):
    ''' '''

    BLINKER_LOG('need set color: ', color)

    # if color == 'Red':
    #     # your codes
    # elif color == 'Yellow':
    #     # your codes
    # elif color == 'Blue':
    #     # your codes
    # elif color == 'Green':
    #     # your codes
    # elif color == 'White':
    #     # your codes
    # elif color == 'Black':
    #     # your codes
    # elif color == 'Cyan':
    #     # your codes
    # elif color == 'Purple':
    #     # your codes
    # elif color == 'Orange':
    #     # your codes

    BlinkerAliGenie.color(color)
    BlinkerAliGenie.print()
Exemple #3
0
def aligenieRelativeColorTemp(colorTemp):
    ''' '''

    BLINKER_LOG('need set relative colorTemperature: ', colorTemp)

    BlinkerAliGenie.colorTemp(colorTemp)
    BlinkerAliGenie.print()
Exemple #4
0
def aligenieRelativeBright(bright):
    ''' '''

    BLINKER_LOG('need set relative brightness: ', bright)

    BlinkerAliGenie.brightness(bright)
    BlinkerAliGenie.print()
def aligeniePowerState(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

    BlinkerAliGenie.powerState(state, num)
    BlinkerAliGenie.print()
Exemple #6
0
def aligenieQuery(queryCode):
    ''' '''

    BLINKER_LOG('AliGenie Query codes: ', queryCode)

    if queryCode == BLINKER_CMD_QUERY_ALL_NUMBER :
        BLINKER_LOG('AliGenie Query All')
        BlinkerAliGenie.temp(20)
        BlinkerAliGenie.humi(20)
        BlinkerAliGenie.pm25(20)
        BlinkerAliGenie.print()
    else :        
        BlinkerAliGenie.temp(20)
        BlinkerAliGenie.humi(20)
        BlinkerAliGenie.pm25(20)
        BlinkerAliGenie.print()
Exemple #7
0
def aligeniecMode(cmode):
    ''' '''

    BLINKER_LOG('need cancel mode: ', cmode)

    # if mode == BLINKER_CMD_ALIGENIE_READING:
    #     # Your mode function
    # elif mode == BLINKER_CMD_ALIGENIE_MOVIE:
    #     # Your mode function
    # elif mode == BLINKER_CMD_ALIGENIE_SLEEP:
    #     # Your mode function
    # elif mode == BLINKER_CMD_ALIGENIE_HOLIDAY:
    #     # Your mode function
    # elif mode == BLINKER_CMD_ALIGENIE_MUSIC:
    #     # Your mode function
    # elif mode == BLINKER_CMD_ALIGENIE_COMMON:
    #     # Your mode function

    BlinkerAliGenie.mode(cMode)
    BlinkerAliGenie.print()
def aligenieQuery(queryCode):
    ''' '''

    BLINKER_LOG('AliGenie Query codes: ', queryCode)

    if queryCode == BLINKER_CMD_QUERY_ALL_NUMBER :
        BLINKER_LOG('AliGenie Query All')
        BlinkerAliGenie.powerState(oState)
        BlinkerAliGenie.print()
    elif queryCode == BLINKER_CMD_QUERY_POWERSTATE_NUMBER :
        BLINKER_LOG('AliGenie Query Power State')
        BlinkerAliGenie.powerState(oState)
        BlinkerAliGenie.print()
    else :
        BlinkerAliGenie.powerState(oState)
        BlinkerAliGenie.print()
def aligenieQuery(queryCode, num):
    ''' '''

    BLINKER_LOG("AliGenie 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('AliGenie Query All')
        BlinkerAliGenie.powerState(state, num)
        BlinkerAliGenie.print()
    elif queryCode == BLINKER_CMD_QUERY_POWERSTATE_NUMBER:
        BlinkerAliGenie.powerState(state, num)
        BlinkerAliGenie.print()
    else:
        BlinkerAliGenie.powerState(state, num)
        BlinkerAliGenie.print()
Exemple #10
0
def aligenieQuery(queryCode):
    ''' '''

    BLINKER_LOG('AliGenie Query codes: ', queryCode)

    if queryCode == BLINKER_CMD_QUERY_ALL_NUMBER:
        BLINKER_LOG('AliGenie Query All')
        BlinkerAliGenie.powerState(wsState)
        BlinkerAliGenie.color(getColor())
        BlinkerAliGenie.mode(wsMode)
        BlinkerAliGenie.colorTemp(50)
        BlinkerAliGenie.brightness(100)
        BlinkerAliGenie.print()
    elif queryCode == BLINKER_CMD_QUERY_POWERSTATE_NUMBER:
        BLINKER_LOG('AliGenie Query Power State')
        BlinkerAliGenie.powerState(wsState)
        BlinkerAliGenie.print()
    elif queryCode == BLINKER_CMD_QUERY_COLOR_NUMBER:
        BLINKER_LOG('AliGenie Query Color')
        BlinkerAliGenie.color('red')
        BlinkerAliGenie.print()
    elif queryCode == BLINKER_CMD_QUERY_MODE_NUMBER:
        BLINKER_LOG('AliGenie Query Mode')
        BlinkerAliGenie.mode(wsMode)
        BlinkerAliGenie.print()
    elif queryCode == BLINKER_CMD_QUERY_COLORTEMP_NUMBER:
        BLINKER_LOG('AliGenie Query ColorTemperature')
        BlinkerAliGenie.colorTemp(50)
        BlinkerAliGenie.print()
    elif queryCode == BLINKER_CMD_QUERY_BRIGHTNESS_NUMBER:
        BLINKER_LOG('AliGenie Query Brightness')
        BlinkerAliGenie.brightness(100)
        BlinkerAliGenie.print()
    else:
        BlinkerAliGenie.powerState(wsState)
        BlinkerAliGenie.color('red')
        BlinkerAliGenie.mode(wsMode)
        BlinkerAliGenie.colorTemp(50)
        BlinkerAliGenie.brightness(100)
        BlinkerAliGenie.print()