A package to control Kelvin lights using usb or bluetooth. Set cct, hsi, rgb, rgbacl, read out various data and more.
Project description
Kelvin lights interface
This is a python package to interface with Kelvin lights using usb (serial) or bluetooth (experimental). This package is available on PyPI and can be installed with pip. To use it in your project, simply run:
pip install k-lights-interface
Features
- Control Kelvin devices. Set brightness, CCT and Duv, RGB, HSI, read out temperatures, voltages, and more.
- Supports Usb (serial) communication using the pyserial package
- Experimental support of BLE communication using the bleak package. Check bleak for hardware requirements.
Interface overview
Light | Usb | Bluetooth |
---|---|---|
Play and Play Pro | Yes | Yes |
Epos 300 | No | Yes |
Epos 600 | Yes | Yes |
Usage
Logging
Set your desired log level using the set_log_level function
from k_lights_interface.k_logging import set_log_level, logging
set_log_level(logging.INFO)
Serial usage:
from k_lights_interface.k_serial_manager import KSerialManager
from k_lights_interface.k_logging import set_log_level, logging
set_log_level(logging.INFO)
dev_manager = KSerialManager()
devices = dev_manager.connect_to_all()
[print(dev) for dev in devices]
BLE usage:
import asyncio
from k_lights_interface.k_ble_manager import KBleManager
from k_lights_interface.k_logging import set_log_level, logging
async def main():
set_log_level(logging.INFO)
ble_manager = KBleManager()
devices = await ble_manager.connect_to_all()
if len(devices) == 0:
print("No devices found")
return
print(devices)
ret, device_stats = devices[0].get_device_stats()
print(device_stats)
if __name__ == "__main__":
asyncio.run(main())
print("finished")
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
k_lights_interface-0.1.8.tar.gz
(30.4 kB
view hashes)
Built Distribution
Close
Hashes for k_lights_interface-0.1.8-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6d2c03a456c7c9a473738ef169825c3e3da0975eb590e3401fe2a394fed2a7dc |
|
MD5 | a839e72825cbc43446383d8c544abdb4 |
|
BLAKE2b-256 | 619abdc9f51dc20bd07b5fd95921108b19781463779e52574ff7075314d46580 |