Registry / communication / yeelight

yeelight

JSON →
library0.7.16pypypi✓ verified 73d ago

A Python library for controlling YeeLight RGB bulbs over local network using the Yeelight WiFi LED light protocol. Version 0.7.16 supports Python >=3.4, with active maintenance. Release cadence is irregular.

pip install yeelight
INSTALL
IMPORT
SIG · YEELIGHT
Y
yeelight
communicationpythonv0.7.16
Install
1.6s avg
Import
136ms
Disk
16MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.7.16 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.146s · 18.3MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 1.6s · import 0.126s · 19MB
16MB installed
● package 16MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Bulb
from yeelight import Bulb
Standard import path.
BulbException
from yeelight import BulbException
from yeelight import YeeLightException
Exception was renamed in early versions.

Connect to a bulb by IP and set color to red at 50% brightness.

import yeelight import os bulb_ip = os.environ.get('BULB_IP', '192.168.1.100') bulb = yeelight.Bulb(bulb_ip) bulb.turn_on() bulb.set_rgb(255, 0, 0) bulb.set_brightness(50)
Debug
Known issues
gotchaBulb must be on network and not in 'lan control' disabled mode. Yeelight app has a setting 'LAN Control' that must be enabled for the library to work.
fix
Enable 'LAN Control' in Yeelight app under Settings -> LAN Control.
affects: all
deprecatedThe 'music_mode' parameter and related methods are deprecated and may be removed in future versions.
fix
Avoid using music_mode; use standard commands.
affects: >=0.5.0
Errors
Common errors & fixes
yeelight.Bulb('192.168.1.100').turn_on()
Bulb is not discoverable or IP incorrect.
fix
Validate bulb IP and ensure LAN control enabled. Use `yeelight.discover_bulbs()` to find bulbs.
yeelight.main.BulbException: Bulb did not respond
Bulb unreachable, possibly due to firewall or bulb not supporting command.
fix
Check network connectivity, disable firewall for local network, and ensure bulb firmware supports the command.
Upgrade
Version history
0.7.16latest on PyPI · released Jan 28, 2025
Audit
Dependencies

No dependency data recorded yet.

Agent activity
60 hits · last 30 days
node
56
Meta
1
Resources
yeelight — pip install yeelight · libregistry