Skip to main content

This package provides a xAAL gateway for Yeelight lights. It supports most Yeelight lights and bulbs. You have to enable local control on your Yeelight device to use this package. You can do this by enabling the “LAN Control” option in the Yeelight app.

The gateway loads bulbs from the configuration file and creates a xAAL device for each of them. Check yeelight.ini after the first run to see the devices created. A gateway.basic device is also registered on the bus, tracking connected (embedded) and disconnected (inactive) bulbs.

Notes

This gateway uses the asyncio API provided by the Yeelight library (yeelight.aio.AsyncBulb) and the xAAL AsyncEngine.

Boot & Connect flow

On startup, setup() loads bulbs from config and starts async_listen on each. The Yeelight library handles reconnection automatically:

  • While connected: push notifications arrive in real time; sync() is rarely needed.

  • If a bulb disconnects: backoff (15s) then retry, and on_properties({connected: False/True}) updates the gateway status.

Important: if a bulb is offline at boot, async_listen fails immediately with no retry. The bulb will only be picked up later by discover() (which runs every 300 seconds). This is a limitation of the library.

Rate limiting

Yeelight bulbs enforce a hardware limit of 60 commands/minute. To stay under this limit:

  • turn_on / turn_off skip if already in the target state.

  • sync() coalesces multiple get_properties calls into one, and is skipped if a push notification arrived within the last 300ms.

  • discover() is the only periodic poll (every 300s).

Metadata

Release files for xaal.yeelight 0.4.1

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

Source distribution (sdist)

Source distribution for xaal.yeelight 0.4.1
File Size Uploaded
xaal_yeelight-0.4.1.tar.gz 6.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for xaal.yeelight 0.4.1
File Interpreter ABI Platform
xaal_yeelight-0.4.1-py3-none-any.whl Python 3 none any Details

Total release size: 12.4 kB

Release files / xaal_yeelight-0.4.1.tar.gz

Download URL xaal_yeelight-0.4.1.tar.gz
Size 6.3 kB
Tags Source
SHA-256 checksum
How to use checksums
54f8b4acc6b98b66e58ba648e1fe1dd73e14d019ce67c40c132d27c42340531d
BLAKE2b-256 checksum
How to use checksums
ef6ea0dee209fc290f40498b87dd99337b1c5d54373e683127d9ccf114ef108e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.13

Release files / xaal_yeelight-0.4.1-py3-none-any.whl

Download URL xaal_yeelight-0.4.1-py3-none-any.whl
Size 6.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9d674d08bf6a2b77be6badc239882bd4c60ccbd9a8dbbb5a70c42358bf20a6e2
BLAKE2b-256 checksum
How to use checksums
403ee9cc195055740118e3cc095da6fbcc28610359bf1e59a0f5b63e7cab7ddb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.13

Release history Release notifications | RSS feed

This release

0.4.1 This release

2 release files

0.4.0

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3

2 release files

0.2

2 release files

0.1

2 release files

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