File tree Expand file tree Collapse file tree 1 file changed +14
-12
lines changed Expand file tree Collapse file tree 1 file changed +14
-12
lines changed Original file line number Diff line number Diff line change @@ -56,13 +56,11 @@ python3 -m pip install busylight_core
56
56
``` python
57
57
from busylight_core import Light
58
58
59
- # Find all connected lights
60
- lights = Light.available()
61
- print (f " Found { len (lights)} device(s) " )
59
+ lights = Light.all_lights()
62
60
63
- # Control a specific device
64
- if lights:
65
- light = lights[ 0 ]
61
+ print ( f " Found { len (lights) } light(s) " )
62
+
63
+ for light in lights:
66
64
light.on((255 , 0 , 0 )) # Turn on red
67
65
light.off() # Turn off
68
66
```
@@ -73,16 +71,20 @@ if lights:
73
71
``` python
74
72
from busylight_core import Light
75
73
74
+ red = (255 , 0 , 0 )
75
+ green = (0 , 128 , 0 )
76
+ yellow = (255 , 255 , 0 )
77
+
76
78
light = Light.first_light()
77
79
78
- # Available - green
79
- light.on(( 0 , 255 , 0 ) )
80
+ # Available
81
+ light.on(green )
80
82
81
- # In meeting - red
82
- light.on(( 255 , 0 , 0 ) )
83
+ # In meeting
84
+ light.on(red )
83
85
84
- # Away - yellow
85
- light.on(( 255 , 255 , 0 ) )
86
+ # Away
87
+ light.on(yellow )
86
88
87
89
light.off()
88
90
```
You can’t perform that action at this time.
0 commit comments