Skip to content

Commit

Permalink
Merge pull request #151 from rgomezjnr/add-wizlight-examples
Browse files Browse the repository at this point in the history
Add wizlight examples to README
  • Loading branch information
sbidy authored Jun 5, 2024
2 parents a11d2c7 + d82af61 commit eff3f0d
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 5 deletions.
28 changes: 24 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -191,12 +191,32 @@ Options:
--help Show this message and exit.

Commands:
discover Discover bulb in the local network.
off Turn the bulb off.
on Turn the bulb on.
state Get the current state from the given bulb.
discover Discover bulb in the local network.
off Turn the bulb off.
on Turn the bulb on.
set-state Set the current state of a given bulb.
state Get the current state from the given bulb.
```

### Examples

```
$ wizlight discover --b 192.168.0.101
Search for bulbs in 192.168.0.101 ...
{'ip_address': '192.168.0.101', 'mac_address': 'a8bs4090193d'}
$ wizlight on --ip 192.168.0.101 --k 3000 --brightness 128
Turning on 192.168.0.101
$ wizlight off --ip 192.168.0.101
Turning off 192.168.0.101
$ wizlight state --ip 192.168.0.101
{'mac': 'a8bs4090193d', 'rssi': -57, 'src': '', 'state': False, 'sceneId': 0, 'temp': 3000, 'dimming': 50}
```

Run `wizlight COMMAND --help` to see usage and options.

## Discovery

The discovery works with a UDP Broadcast request and collects all bulbs in the network.
Expand Down
2 changes: 1 addition & 1 deletion pywizlight/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def main() -> None:
help="Define the broadcast address like 192.168.1.255.",
)
async def discover(b: str) -> None:
"""Discovery bulb in the local network."""
"""Discover bulb in the local network."""
click.echo(f"Search for bulbs in {b} ... ")

bulbs = await discovery.find_wizlights(broadcast_address=b)
Expand Down

0 comments on commit eff3f0d

Please sign in to comment.