示例#1
0
def miotBright(bright):
    ''' '''

    BLINKER_LOG('need set brightness: ', bright)

    BlinkerMIOT.brightness(bright)
    BlinkerMIOT.print()
示例#2
0
def miotQuery(queryCode):
    ''' '''

    BLINKER_LOG('MIOT Query codes: ', queryCode)

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