def _set_group_bri_hue_sat_trans(bridge, group_id, bri, hue, sat, trans): g = Group(bridge, group_id) g.transitiontime = trans g.on = True g.brightness = bri g.hue = hue g.saturation = sat
def detect_button(pkt): if pkt.haslayer(DHCP): b = Bridge('192.168.1.103') b.connect() if pkt[Ether].src in MAC_ADDRESS_DICT.keys(): #Toggle Jacobs Room Lights print "Button Press Detected", pkt[Ether].src, MAC_ADDRESS_DICT[pkt[Ether].src] roomGroup = Group(b,MAC_ADDRESS_DICT[pkt[Ether].src]) roomGroup.on = not roomGroup.on
def _set_group_bri(bridge, group_id, bri): g = Group(bridge, group_id) g.transitiontime = default_transitiontime g.on = True g.brightness = bri
# test_light.on = False # sleep(2) print(b.groups) nb_group = b.groups #print(len(nb_group)) print(b.get_group_id_by_name('control_group')) #print(b.lights) #b.create_group('control_group', [3, 4, 5]) b.set_group(group_id='control_group', parameter='lights', value=[5]) gr0 = Group(b, 'control_group') gr0.on = True gr0.brightness = 254 gr0.colortemp_k = 3500 sleep(3) gr0.on = False b.set_group(group_id='control_group', parameter='lights', value=[3, 4]) gr0 = Group(b, 'control_group') gr0.on = True gr0.brightness = 254 gr0.colortemp_k = 3500 sleep(3) gr0.on = False # print(b.get_group_id_by_name('control_group')) print(b.groups)