Metadata-Version: 2.4
Name: daybetter-led-strip
Version: 0.1.2
Summary: Control Daybetter RGB LED strips over BLE
Author-email: Siddhant Kameswar <61r7jw39@kameswar.com>
License-Expression: MIT
Project-URL: Homepage, https://github.com/grimsteel/daybetter-led-strip
Project-URL: Issues, https://github.com/grimsteel/daybetter-led-strip/issues
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: bleak
Requires-Dist: bleak-retry-connector
Dynamic: license-file

# daybetter-led-strip

Python package to control Daybetter RGB LED strips over BLE. Uses [`bleak`](https://bleak.readthedocs.io/en/latest/index.html).

## Installation

`daybetter-led-strip` is on PyPI

```sh
$ pip install daybetter-led-strip
```

## Usage

The `DaybetterLedStrip` constructor only requires the device MAC address. After that, the actual underlying device and advertisment data can be updated any number of times using `.update_device`. If the device disconnects for any reason, it will not reconnect.

```python
device = await BleakScanner.find_device_by_filter(lambda _device, data: SERVICE_DISCOVERY in data.service_uuids)
    
led_strip = DaybetterLedStrip(device.address)
await led_strip.update_device(device, None)

# turn on
await led_strip.set_power(True)

await asyncio.sleep(1)

await led_strip.set_color((255, 0, 0))

await led_strip.set_power(False)
# Must be called when done using
await led_strip.disconnect()
```

A complete example program is provided in `examples/test.py`.

This package was created for use in Home Assistant, which may explain some of the API choices.
