Core LIFX Emulator library for testing LIFX LAN protocol libraries
Project description
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file lifx_emulator_core-3.0.3.tar.gz.
File metadata
- Download URL: lifx_emulator_core-3.0.3.tar.gz
- Upload date:
- Size: 133.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bf029963544a5ef58c8d88e3836b795d24f0dfdd62b0503091718b71f3a4624f
|
|
| MD5 |
12456a75be1c54d15fe101461e03484d
|
|
| BLAKE2b-256 |
295ff1426c076da3bba3cb140e70098e42952093174aa544edeb53d8a915be0f
|
Provenance
The following attestation bundles were made for lifx_emulator_core-3.0.3.tar.gz:
Publisher:
ci.yml on Djelibeybi/lifx-emulator
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
lifx_emulator_core-3.0.3.tar.gz -
Subject digest:
bf029963544a5ef58c8d88e3836b795d24f0dfdd62b0503091718b71f3a4624f - Sigstore transparency entry: 728819123
- Sigstore integration time:
-
Permalink:
Djelibeybi/lifx-emulator@db68eefa764d8c98054ada19eabd6e06440f886b -
Branch / Tag:
refs/heads/main - Owner: https://github.com/Djelibeybi
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@db68eefa764d8c98054ada19eabd6e06440f886b -
Trigger Event:
push
-
Statement type:
File details
Details for the file lifx_emulator_core-3.0.3-py3-none-any.whl.
File metadata
- Download URL: lifx_emulator_core-3.0.3-py3-none-any.whl
- Upload date:
- Size: 102.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f5169c3932dfc0fc44692d6238e5d5070e5929e8fc7b91d6b83abe65cb926c33
|
|
| MD5 |
5f42d6aa1d5aecf8f4813fe2186e374a
|
|
| BLAKE2b-256 |
c94372acec4863f050c6e3445c911c7f16f42375c6a1f08cfdabfccade4d265a
|
Provenance
The following attestation bundles were made for lifx_emulator_core-3.0.3-py3-none-any.whl:
Publisher:
ci.yml on Djelibeybi/lifx-emulator
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
lifx_emulator_core-3.0.3-py3-none-any.whl -
Subject digest:
f5169c3932dfc0fc44692d6238e5d5070e5929e8fc7b91d6b83abe65cb926c33 - Sigstore transparency entry: 728819124
- Sigstore integration time:
-
Permalink:
Djelibeybi/lifx-emulator@db68eefa764d8c98054ada19eabd6e06440f886b -
Branch / Tag:
refs/heads/main - Owner: https://github.com/Djelibeybi
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@db68eefa764d8c98054ada19eabd6e06440f886b -
Trigger Event:
push
-
Statement type: