Skip to main content

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

daybetter_led_strip-0.1.2.tar.gz (5.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

daybetter_led_strip-0.1.2-py3-none-any.whl (6.0 kB view details)

Uploaded Python 3

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

Hashes for daybetter_led_strip-0.1.2.tar.gz
Algorithm Hash digest
SHA256 db7bb37e80d0ef518a9a26cf3406ad566d91186b8bdddfbe590fa72580f4f7dd
MD5 1d6a707be29d51da7ab4f9a2915a48e7
BLAKE2b-256 e1b4e28b342a2916d264ed2e4728023ae34894e013da09628130ad1d9e53cfe3

See more details on using hashes here.

Provenance

The following attestation bundles were made for daybetter_led_strip-0.1.2.tar.gz:

Publisher: release.yml on grimsteel/daybetter-led-strip

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file daybetter_led_strip-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for daybetter_led_strip-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 da1396d514f422349c06d795f9bbe1674da2d02daae49dcc858993212c9095bd
MD5 7f3027f8b1b8cc69f2797c0b99157bf9
BLAKE2b-256 83eb2194d7f139d69ba0dd0e9d991169d0477a4f74b3a5846034004922516a7f

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page