Example #1
0
def update_bulb(bulb):
    smartBulb = SmartBulb(bulb.ipAddr)
    if bulb.onOff:
        smartBulb.turn_on()
    else:
        smartBulb.turn_off()
    if smartBulb.is_color:
        hsv = rgb2hsv(int(bulb.rgbColor[0:2], 16), int(bulb.rgbColor[2:4], 16),
                      int(bulb.rgbColor[4:6], 16))
        smartBulb.hsv = hsv

    smartBulb.brightness = bulb.brightness
Example #2
0
def bulb_turn_off(bulb):
    smartBulb = SmartBulb(bulb.ipAddr)
    smartBulb.turn_off()
    bulb.onOff = False
    bulb.save()
Example #3
0
 def tpBulbOff(self, ip):
     bulb = SmartBulb(ip)
     bulb.turn_off()