Skip to content

Commit f083f06

Browse files
committed
docs: Updated README examples.
1 parent 1cec560 commit f083f06

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

README.md

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,11 @@ python3 -m pip install busylight_core
5656
```python
5757
from busylight_core import Light
5858

59-
# Find all connected lights
60-
lights = Light.available()
61-
print(f"Found {len(lights)} device(s)")
59+
lights = Light.all_lights()
6260

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:
6664
light.on((255, 0, 0)) # Turn on red
6765
light.off() # Turn off
6866
```
@@ -73,16 +71,20 @@ if lights:
7371
```python
7472
from busylight_core import Light
7573

74+
red = (255, 0, 0)
75+
green = (0, 128, 0)
76+
yellow = (255, 255, 0)
77+
7678
light = Light.first_light()
7779

78-
# Available - green
79-
light.on((0, 255, 0))
80+
# Available
81+
light.on(green)
8082

81-
# In meeting - red
82-
light.on((255, 0, 0))
83+
# In meeting
84+
light.on(red)
8385

84-
# Away - yellow
85-
light.on((255, 255, 0))
86+
# Away
87+
light.on(yellow)
8688

8789
light.off()
8890
```

0 commit comments

Comments
 (0)