--- id: aiolifx version: "1.2.2" license: MIT license_treatment: permissive maintenance: active --- # aiolifx — API for local communication with LIFX devices over a LAN with asyncio. License: permissive · Maintenance: active · Downloads: 78.1K/mo ## What it is and what it does aiolifx wraps the LIFX LAN protocol in an asyncio-friendly Python library, letting you discover and control LIFX lightbulbs on your local network without relying on cloud services. It uses UDP broadcast to find bulbs and then communicates with each via unicast UDP sockets, keeping connections open for the lifetime of the bulb to avoid repeated connection overhead. The library is built around a discovery task that registers new bulbs as it finds them and an event-driven callback model where you supply methods to handle registration and unregistration. It includes a command-line utility for testing and basic control, and supports both IPv4 and IPv6 connections to bulbs. Dependencies are minimal: async_timeout, bitstring, ifaddr, click, and InquirerPy. Use it for: - Build a home automation dashboard that discovers and controls LIFX bulbs on startup without polling - Create a command-line tool to batch-control lights across your LAN using the included aiolifx CLI - Integrate LIFX bulbs into an asyncio-based smart home application with callback-driven state updates - Monitor bulb uptime and WiFi status by passing callback functions to bulb methods - Implement custom lighting scenes by chaining set_waveform calls with dictionary-based parameters ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. aiolifx is an asyncio-based Python library for discovering and controlling LIFX LED lightbulbs over a local network using UDP communication. Yes. The package is actively maintained, has no known vulnerabilities, uses a permissive MIT license, and offers low install friction. It solves a real problem—local LIFX control without cloud dependency—with a clean asyncio API. The main caveat is limited testing against bulb models beyond the Original 1000; verify compatibility with your hardware before relying on it in production. ## Install pip install aiolifx uv add aiolifx poetry add aiolifx ## Installing aiolifx Before you install: Low install friction with a pure-Python wheel distribution. The package is actively maintained with a recent release (80 days ago) and no known vulnerabilities. Dependencies are lightweight and stable. License in practice: MIT license permits commercial and private use with minimal restrictions, making it straightforward to integrate into most projects. Quickstart: pip install aiolifx import asyncio from aiolifx import LifxDiscovery class BulbRegistry: def __init__(self): self.bulbs = [] def register(self, bulb): self.bulbs.append(bulb) def unregister(self, bulb): self.bulbs = [b for b in self.bulbs if b.mac_addr != bulb.mac_addr] loop = asyncio.get_event_loop() registry = BulbRegistry() discovery = LifxDiscovery(loop, registry) discovery.start() loop.run_forever() Requires Python 3.4 or later. Bulbs must be on the same LAN and reachable via UDP broadcast and unicast. Verify before relying: - Whether IPv6 support with /48 prefixes is production-ready (documentation notes this is untested) - Compatibility with LIFX bulb models beyond the Original 1000 (author only tested with one model) - Current state of the callback-based response handling and whether it covers all bulb commands ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 78.1K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags lifx bulb control python, asyncio lifx lights, lan light automation, lifx device discovery, udp light control library, smart bulb python api, lifx home automation, home-automation, asyncio, lan-networking [View on SkillFed](https://skillfed.io/packages/aiolifx) · [View on PyPI](https://pypi.org/project/aiolifx/)