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.23.tar.gz
(21.8 kB
view details)
Built Distribution
File details
Details for the file k_lights_interface-0.1.23.tar.gz
.
File metadata
- Download URL: k_lights_interface-0.1.23.tar.gz
- Upload date:
- Size: 21.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.10.11
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f769d860c698df08d1cc7241635f7b2033873e41442e12a002edb9d12e672081 |
|
MD5 | 6154b8c341798d488177910e4b6d8638 |
|
BLAKE2b-256 | cb63fc8e963df01423049d9ff2e61d5eeddf0bb5ee09827b309915502e20f0b6 |
File details
Details for the file k_lights_interface-0.1.23-py3-none-any.whl
.
File metadata
- Download URL: k_lights_interface-0.1.23-py3-none-any.whl
- Upload date:
- Size: 25.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.10.11
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7df2781349851ee28d88a6c102558c088eca840b32227e93e0d9de0da5869940 |
|
MD5 | 867cf3355a504e4725a07b8ba0c653c6 |
|
BLAKE2b-256 | 6201af83fee14a2c76c2e81e92e660f7424daf41bfb5ae422b5c56f2e6b08150 |