▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
I have a set of yeelight Smart LED light bulbs. Yeelight is a great brand because there’s an official Python Library from yeelight that allows you to control your bulbs and write custom flows in python! Unfortunately, it lacks basic features. For example:
I wrote this package yeelight-extras
that extends the
official library adding in these extra features. Here’s an example of
how easy it is to control lights with my library.
from yeelight_extras import Bulb, Group
= Bulb('bulb1') # Connect to bulb by name
b1 = Bulb('192.168.1.54') # Connect to bulb by ip address
b2
= Group([b1,b2]) # Create a group
g
# Turn ON all bulbs in group
g.turn_on()
'power') # Get bulb property by name
g.get_property(# Groups with multiple bulbs will return list (ie. ['on', 'on'])
'#88a7ff') # Set group to hex color
g.set_color(255, 0, 0) # Set group to RGB color
g.set_color('candle_flicker') # Set group to display flow by name
g.set_flow('ghost_event') # Set group to display scene by name
g.set_scene(
# Turn OFF all bulbs in group g.turn_off()