Name | cheshire-no-bleak-limit JSON |
Version |
0.5.7
JSON |
| download |
home_page | None |
Summary | API for Keepsmile, LuckyStyle, Leeleberd, and related smart lights |
upload_time | 2024-11-27 01:32:06 |
maintainer | None |
docs_url | None |
author | David |
requires_python | <3.13,>=3.10 |
license | MIT |
keywords |
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|

# 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](https://github.com/themooer1/cheshire/blob/master/docs/user_guide.md).
```python
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 |
Raw data
{
"_id": null,
"home_page": null,
"name": "cheshire-no-bleak-limit",
"maintainer": null,
"docs_url": null,
"requires_python": "<3.13,>=3.10",
"maintainer_email": null,
"keywords": null,
"author": "David",
"author_email": "davidkuc6@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/89/39/dca0695900970e143bb009eea1fba2dacd540694db5414ad98d93bedf9f7/cheshire_no_bleak_limit-0.5.7.tar.gz",
"platform": null,
"description": "\n# Cheshire\n\nAPI for Keepsmile and related Bluetooth LE lights.\n\n\n## Usage\n\nThe example below scans for Bluetooth LE devices and tries to control any \nwhich are supported.\n\nFor more detailed instructions, see the [user guide](https://github.com/themooer1/cheshire/blob/master/docs/user_guide.md).\n\n```python\nimport asyncio\nfrom bleak import BleakScanner, BleakClient\nfrom cheshire.compiler.state import LightState\nfrom cheshire.generic.command import *\nfrom cheshire.hal.devices import Connection, connect_to_ble_device\n\nasync def main():\n # Discover Bluetooth LE devices\n discover = await BleakScanner.discover()\n connections: list[Connection] = []\n\n # Connect to supported devices\n for bleak_device in discover:\n if bleak_device.name == None:\n continue\n\n # Connect to this device if it's one we support\n if connection := await connect_to_ble_device(bleak_device):\n print(f\"Connected to {bleak_device.name}\")\n\n connections.append(connection)\n\n async def send_all(state: LightState):\n # Push light state to connected devices\n for c in connections:\n await c.apply(state)\n \n\n # Update desired light state\n state = LightState()\n state.update(SwitchCommand(on=True))\n state.update(BrightnessCommand(0x30))\n state.update(RGBCommand(0x0e, 0x0, 0xaa))\n # state.update(EffectCommand(Effect.JUMP_7))\n\n await send_all(state)\n\n\nasyncio.run(main())\n```\n\n## Supported Devices\n| Device | Bluetooth Name | Support |\n|-|-|-|\n| Keepsmile Led Strip Lights | KS03-XXXX | Yes |\n| Keepsmile Led Strip Lights (New) | KS03~XXXX | Yes |\n| Keepsmile Double Side Lighting Led Floor Lamp | ? | Unknown |\n| luckystyle Floor Lamp | KS01-XXXX | Untested |\n\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "API for Keepsmile, LuckyStyle, Leeleberd, and related smart lights",
"version": "0.5.7",
"project_urls": null,
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "b369e654af412c0010f262b1d29aa808edb2edaad1236aadbf97eec43003f797",
"md5": "d7c33995f5f767d15d8713f22de81ba9",
"sha256": "78c31934757f9b28f9a0ed5fa4e8d471c7cfb4dd30525458d00ed88b1071284f"
},
"downloads": -1,
"filename": "cheshire_no_bleak_limit-0.5.7-py3-none-any.whl",
"has_sig": false,
"md5_digest": "d7c33995f5f767d15d8713f22de81ba9",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<3.13,>=3.10",
"size": 12683,
"upload_time": "2024-11-27T01:32:04",
"upload_time_iso_8601": "2024-11-27T01:32:04.521825Z",
"url": "https://files.pythonhosted.org/packages/b3/69/e654af412c0010f262b1d29aa808edb2edaad1236aadbf97eec43003f797/cheshire_no_bleak_limit-0.5.7-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "8939dca0695900970e143bb009eea1fba2dacd540694db5414ad98d93bedf9f7",
"md5": "68758a5c53f549a2ca06538c69f73302",
"sha256": "37e6246fa70fbfdb55bb765ce07c950581606248b423df8cdfe78d23234acbaa"
},
"downloads": -1,
"filename": "cheshire_no_bleak_limit-0.5.7.tar.gz",
"has_sig": false,
"md5_digest": "68758a5c53f549a2ca06538c69f73302",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<3.13,>=3.10",
"size": 7611,
"upload_time": "2024-11-27T01:32:06",
"upload_time_iso_8601": "2024-11-27T01:32:06.255955Z",
"url": "https://files.pythonhosted.org/packages/89/39/dca0695900970e143bb009eea1fba2dacd540694db5414ad98d93bedf9f7/cheshire_no_bleak_limit-0.5.7.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-11-27 01:32:06",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "cheshire-no-bleak-limit"
}