def miotColor(color): ''' ''' BLINKER_LOG('need set color: ', color) # if color == 0xFF0000: # 'Red': # # your codes # elif color == 0xFFFF00: # 'Yellow': # # your codes # elif color == 0x0000FF: # 'Blue': # # your codes # elif color == 0x00FF00: # 'Green': # # your codes # elif color == 0xFFFFFF: # 'White': # # your codes # elif color == 0x000000: # 'Black': # # your codes # elif color == 0x00FFFF: # 'Cyan': # # your codes # elif color == 0x800080: # 'Purple': # # your codes # elif color == 0xFFA500: # 'Orange': # # your codes BlinkerMIOT.color(color) BlinkerMIOT.print()
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()