Skip to main content

lifx-emulator-core

Core Python library for emulating LIFX devices using the LAN protocol.

This package provides the embeddable library for creating virtual LIFX devices in your own projects. It implements the binary UDP protocol from the LIFX LAN Protocol specification.

Installation

pip install lifx-emulator-core

Quick Start

import asyncio
from lifx_emulator import EmulatedLifxServer, DeviceManager
from lifx_emulator.factories import create_color_light
from lifx_emulator.repositories import DeviceRepository

async def main():
    # Create devices
    devices = [
        create_color_light(serial="d073d5000001"),
        create_color_light(serial="d073d5000002"),
    ]

    # Create repository and manager
    repository = DeviceRepository()
    manager = DeviceManager(repository)

    # Start the emulator server
    server = EmulatedLifxServer(
        devices=devices,
        device_manager=manager,
        bind_address="127.0.0.1",
        port=56700,
    )

    await server.start()
    print("LIFX Emulator running on 127.0.0.1:56700")

    # Keep running until interrupted
    try:
        await asyncio.Event().wait()
    finally:
        await server.stop()

asyncio.run(main())

Features

  • Emulate color lights, multizone strips, tiles, infrared, HEV, and switch devices
  • Full LIFX LAN protocol implementation
  • Persistent device state storage
  • Testing scenarios for simulating edge cases
  • Product registry with 137+ official LIFX products

Documentation

Full documentation is available at: https://djelibeybi.github.io/lifx-emulator

Related Packages

  • lifx-emulator: Standalone CLI tool and HTTP management API built on this library

License

UPL-1.0

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lifx_emulator_core-3.9.0.tar.gz (184.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

lifx_emulator_core-3.9.0-py3-none-any.whl (121.8 kB view details)

Uploaded Python 3

File details

Details for the file lifx_emulator_core-3.9.0.tar.gz.

File metadata

  • Download URL: lifx_emulator_core-3.9.0.tar.gz
  • Upload date:
  • Size: 184.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for lifx_emulator_core-3.9.0.tar.gz
Algorithm Hash digest
SHA256 27633e6dcd84d6b907ea2fbef6363d8ff05b67448066ab551001dfae9878f67a
MD5 4907ec78190c9571e6c66ce822dfdaee
BLAKE2b-256 e5643758b6f7e7ec1e5b609f01ffc885777970b0f7a32b73900a09a555f0705d

See more details on using hashes here.

Provenance

The following attestation bundles were made for lifx_emulator_core-3.9.0.tar.gz:

Publisher: ci.yml on Djelibeybi/lifx-emulator

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file lifx_emulator_core-3.9.0-py3-none-any.whl.

File metadata

File hashes

Hashes for lifx_emulator_core-3.9.0-py3-none-any.whl
Algorithm Hash digest
SHA256 87d5046c398ea29bac08414f36865ad075a35073ca20ab706dde928bd9beac03
MD5 2c545ad03822ed3816cdff279c191389
BLAKE2b-256 e60f7140d13f4e8ff9264606eb63371fd5ad968b5f41ca1bc806b52625aef2cc

See more details on using hashes here.

Provenance

The following attestation bundles were made for lifx_emulator_core-3.9.0-py3-none-any.whl:

Publisher: ci.yml on Djelibeybi/lifx-emulator

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

3.9.0 This release

2 files

3.8.0

2 files

3.7.1

2 files

3.7.0

2 files

3.6.3

2 files

3.6.2

2 files

3.6.1

2 files

3.6.0

2 files

3.5.0

2 files

3.4.0

2 files

3.3.0

2 files

3.2.0

2 files

3.1.1

2 files

3.1.0

2 files

3.0.3

2 files

3.0.2

2 files

3.0.1

2 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