XKNX - An asynchronous KNX library written in Python
Documentation
See documentation at: https://xknx.io/
Help
We need your help for testing and improving XKNX. For questions, feature requests, bug reports either open an issue, join the XKNX chat on Discord or write an email.
Development
You will need at least Python 3.10 in order to use XKNX.
Setting up your local environment:
- Install requirements:
pip install -r requirements/testing.txt - Install pre-commit hook:
pre-commit install
Testing
To run all tests, linters, formatters and type checker call tox
Running only unit tests is possible with pytest
Running specific unit tests can be invoked by: pytest -vv test/management_tests/procedures_test.py -k test_nm_individual_address_serial_number_write_fail
Home-Assistant
XKNX is the underlying library for the KNX integration in Home Assistant.
Example
"""Example for switching a light on and off."""
import asyncio
from xknx import XKNX
from xknx.devices import Light
async def main():
"""Connect to KNX/IP bus, switch on light, wait 2 seconds and switch it off again."""
async with XKNX() as xknx:
light = Light(
xknx,
name="TestLight",
group_address_switch="1/0/9",
)
xknx.devices.async_add(light)
await light.set_on()
await asyncio.sleep(2)
await light.set_off()
asyncio.run(main())
Attributions
Many thanks to Enertex Bayern GmbH, Weinzierl Engineering GmbH and MDT technologies GmbH for providing us a device to support testing and development of xknx.
Metadata
Release files for xknx 3.20.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| xknx-3.20.0.tar.gz | 200.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| xknx-3.20.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 495.3 kB
Release files / xknx-3.20.0.tar.gz
| Download URL | xknx-3.20.0.tar.gz |
|---|---|
| Size | 200.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8be97bcca6c7768f02d3bc18f6236c786e8707327fde55c015272753880cc0df
|
|
BLAKE2b-256 checksum How to use checksums |
afc1de7cbc042cd6f3d570ae5425af76a0f38534a76fa09ce6597fb2bdded611
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.7
|
Release files / xknx-3.20.0-py3-none-any.whl
| Download URL | xknx-3.20.0-py3-none-any.whl |
|---|---|
| Size | 294.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
064353a2d295d793a4198994d732fb4e5bba922d5e5a47d0f7e14ac3ac16dacc
|
|
BLAKE2b-256 checksum How to use checksums |
b6d9891f86d8d53876cf1e8e3275c6ea71a22db67607a388bb112c84b4f7fdc0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.7
|