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.1.tar.gz (4.9 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.1-py3-none-any.whl (6.0 kB view details)

Uploaded Python 3

File details

Details for the file daybetter_led_strip-0.1.1.tar.gz.

File metadata

  • Download URL: daybetter_led_strip-0.1.1.tar.gz
  • Upload date:
  • Size: 4.9 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.1.tar.gz
Algorithm Hash digest
SHA256 9eeb6c31caa8e24bc6ee1e9c22134c1a296ecc0f919550617c0210759334f712
MD5 281c90a040f6eb9905946c4f1daecde3
BLAKE2b-256 e081f427cda9b861bf64528bf408a266b64b3b41ccd2fce703c503769d774d02

See more details on using hashes here.

Provenance

The following attestation bundles were made for daybetter_led_strip-0.1.1.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.1-py3-none-any.whl.

File metadata

File hashes

Hashes for daybetter_led_strip-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4e281c9afc0a468ae780f99c1b0125dc2ae9fae146c71de6779d0300a4bfee21
MD5 13b439df885d885ef0b22c3d64d84b5f
BLAKE2b-256 d871f7092ca1905ed3ce1efe6aca4b35b82975045321a164c933e652d569e32a

See more details on using hashes here.

Provenance

The following attestation bundles were made for daybetter_led_strip-0.1.1-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