Skip to content

Commit

Permalink
Update docs and README
Browse files Browse the repository at this point in the history
  • Loading branch information
Betree committed Jan 21, 2018
1 parent 0b5397e commit 9a4fdbd
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 12 deletions.
16 changes: 4 additions & 12 deletions README.md
@@ -1,6 +1,8 @@
![MagicBlue Bulb](https://lut.im/xpaCaUNTaU/k6WRbc71KMMSFIln.jpg)

# MagicBlue - Control your Magic Blue bulbs over bluetooth
# MagicBlue - Cheap bluetooth bulbs

[![Documentation Status](https://readthedocs.org/projects/magicblue/badge/?version=latest)](http://magicblue.readthedocs.io/en/latest/?badge=latest)

The Magic Bulb is, as far as I know, the cheapest bluetooth RGB light bulb
on the market : you can get it for as low as ~8€/9$ on sites like
Expand Down Expand Up @@ -97,17 +99,7 @@ sudo setcap 'cap_net_raw,cap_net_admin+eip' `which hcitool`

### Using it as an API

```python
from magicblue import MagicBlue

bulb_mac_address = 'XX:XX:XX:XX:XX:XX'
bulb = MagicBlue(bulb_mac_address, 9) # Replace 9 by whatever your version is (default: 7)
bulb.connect()
bulb.set_color([255, 0, 0]) # Set red
bulb.set_random_color() # Set random
bulb.turn_off() # Turn off the light
bulb.turn_on() # Set white light
```
Check the [API documentation](http://magicblue.readthedocs.io/en/latest/)

### Using it as a tool
Script must be run as root.
Expand Down
15 changes: 15 additions & 0 deletions docs/index.rst
Expand Up @@ -21,6 +21,21 @@ Contribute
- Issue Tracker: https://github.com/Betree/magicblue/issues
- Source Code: https://github.com/Betree/magicblue

Basic usage
-----------

.. code-block:: python
from magicblue import MagicBlue
bulb_mac_address = 'XX:XX:XX:XX:XX:XX'
bulb = MagicBlue(bulb_mac_address, 9) # Replace 9 by whatever your version is (default: 7)
bulb.connect()
bulb.set_color([255, 0, 0]) # Set red
bulb.set_random_color() # Set random
bulb.turn_off() # Turn off the light
bulb.turn_on() # Set white light
----------------------------------------------------------------------

MagicBlue API reference
Expand Down

0 comments on commit 9a4fdbd

Please sign in to comment.