Skip to main content

Cheshire Cat

Cheshire

API for Keepsmile and related Bluetooth LE lights.

Usage

The example below scans for Bluetooth LE devices and tries to control any which are supported.

For more detailed instructions, see the user guide.

import asyncio
from bleak import BleakScanner, BleakClient
from cheshire.compiler.state import LightState
from cheshire.generic.command import *
from cheshire.hal.devices import Connection, connect_to_ble_device

async def main():
    # Discover Bluetooth LE devices
    discover = await BleakScanner.discover()
    connections: list[Connection] = []

    # Connect to supported devices
    for bleak_device in discover:
        if bleak_device.name == None:
            continue

        # Connect to this device if it's one we support
        if connection := await connect_to_ble_device(bleak_device):
            print(f"Connected to {bleak_device.name}")

            connections.append(connection)

    async def send_all(state: LightState):
        # Push light state to connected devices
        for c in connections:
            await c.apply(state)
            

    # Update desired light state
    state = LightState()
    state.update(SwitchCommand(on=True))
    state.update(BrightnessCommand(0x30))
    state.update(RGBCommand(0x0e, 0x0, 0xaa))
    # state.update(EffectCommand(Effect.JUMP_7))

    await send_all(state)


asyncio.run(main())

Supported Devices

Device Bluetooth Name Support
Keepsmile Led Strip Lights KS03-XXXX Yes
Keepsmile Led Strip Lights (New) KS03~XXXX Yes
Keepsmile Double Side Lighting Led Floor Lamp ? Unknown
luckystyle Floor Lamp KS01-XXXX Untested

Metadata

Release files for cheshire-no-bleak-limit 0.5.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cheshire-no-bleak-limit 0.5.7
File Size Uploaded Provenance Actions
cheshire_no_bleak_limit-0.5.7.tar.gz 7.6 kB With provenance Details for cheshire_no_bleak_limit-0.5.7.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for cheshire-no-bleak-limit 0.5.7
File Interpreter ABI Platform Actions
cheshire_no_bleak_limit-0.5.7-py3-none-any.whl Python 3 none any Details for cheshire_no_bleak_limit-0.5.7-py3-none-any.whl

Total release size: 20.3 kB

Release files / cheshire_no_bleak_limit-0.5.7.tar.gz

Download URL cheshire_no_bleak_limit-0.5.7.tar.gz
Size 7.6 kB
Tags Source
SHA-256 checksum
How to use checksums
37e6246fa70fbfdb55bb765ce07c950581606248b423df8cdfe78d23234acbaa
BLAKE2b-256 checksum
How to use checksums
8939dca0695900970e143bb009eea1fba2dacd540694db5414ad98d93bedf9f7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.1 CPython/3.12.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 27, 2024.

Transparency log

Release files / cheshire_no_bleak_limit-0.5.7-py3-none-any.whl

Download URL cheshire_no_bleak_limit-0.5.7-py3-none-any.whl
Size 12.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
78c31934757f9b28f9a0ed5fa4e8d471c7cfb4dd30525458d00ed88b1071284f
BLAKE2b-256 checksum
How to use checksums
b369e654af412c0010f262b1d29aa808edb2edaad1236aadbf97eec43003f797
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.1 CPython/3.12.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 27, 2024.

Transparency log

Security for cheshire-no-bleak-limit 0.5.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for cheshire_no_bleak_limit-0.5.7.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 27, 2024.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.5.7 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page