Control Daybetter RGB LED strips over BLE
Project description
daybetter-led-strip
Python package to control Daybetter RGB LED strips over BLE. Uses bleak.
Installation
daybetter-led-strip is on PyPI
$ 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.
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.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file daybetter_led_strip-0.1.2.tar.gz.
File metadata
- Download URL: daybetter_led_strip-0.1.2.tar.gz
- Upload date:
- Size: 5.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
db7bb37e80d0ef518a9a26cf3406ad566d91186b8bdddfbe590fa72580f4f7dd
|
|
| MD5 |
1d6a707be29d51da7ab4f9a2915a48e7
|
|
| BLAKE2b-256 |
e1b4e28b342a2916d264ed2e4728023ae34894e013da09628130ad1d9e53cfe3
|
Provenance
The following attestation bundles were made for daybetter_led_strip-0.1.2.tar.gz:
Publisher:
release.yml on grimsteel/daybetter-led-strip
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
daybetter_led_strip-0.1.2.tar.gz -
Subject digest:
db7bb37e80d0ef518a9a26cf3406ad566d91186b8bdddfbe590fa72580f4f7dd - Sigstore transparency entry: 781908223
- Sigstore integration time:
-
Permalink:
grimsteel/daybetter-led-strip@6096c7e6ace2d1661a8e77c4bfc25138b2191a34 -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/grimsteel
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@6096c7e6ace2d1661a8e77c4bfc25138b2191a34 -
Trigger Event:
push
-
Statement type:
File details
Details for the file daybetter_led_strip-0.1.2-py3-none-any.whl.
File metadata
- Download URL: daybetter_led_strip-0.1.2-py3-none-any.whl
- Upload date:
- Size: 6.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
da1396d514f422349c06d795f9bbe1674da2d02daae49dcc858993212c9095bd
|
|
| MD5 |
7f3027f8b1b8cc69f2797c0b99157bf9
|
|
| BLAKE2b-256 |
83eb2194d7f139d69ba0dd0e9d991169d0477a4f74b3a5846034004922516a7f
|
Provenance
The following attestation bundles were made for daybetter_led_strip-0.1.2-py3-none-any.whl:
Publisher:
release.yml on grimsteel/daybetter-led-strip
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
daybetter_led_strip-0.1.2-py3-none-any.whl -
Subject digest:
da1396d514f422349c06d795f9bbe1674da2d02daae49dcc858993212c9095bd - Sigstore transparency entry: 781908234
- Sigstore integration time:
-
Permalink:
grimsteel/daybetter-led-strip@6096c7e6ace2d1661a8e77c4bfc25138b2191a34 -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/grimsteel
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@6096c7e6ace2d1661a8e77c4bfc25138b2191a34 -
Trigger Event:
push
-
Statement type: