Skip to main content

An Asynchronous Library for the KNX protocol. Documentation: https://xknx.io/

Project description

XKNX - An asynchronous KNX library written in Python

PyPI - Python Version codecov Checked with mypy Pre-commit HA integration usage Discord

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.9 in order to use XKNX.

Setting up your local environment:

  1. Install requirements: pip install -r requirements/testing.txt
  2. Install pre-commit hook: pre-commit install

Home-Assistant Plugin

XKNX contains a plugin for the Home Assistant automation platform

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')
        await light.set_on()
        await asyncio.sleep(2)
        await light.set_off()

asyncio.run(main())

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

xknx-0.21.3.tar.gz (117.2 kB view details)

Uploaded Source

Built Distribution

xknx-0.21.3-py3-none-any.whl (186.3 kB view details)

Uploaded Python 3

File details

Details for the file xknx-0.21.3.tar.gz.

File metadata

  • Download URL: xknx-0.21.3.tar.gz
  • Upload date:
  • Size: 117.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.10.4

File hashes

Hashes for xknx-0.21.3.tar.gz
Algorithm Hash digest
SHA256 e6595a9756ffaa306f6e86d72c977f542737a50512a23df434b1f2860a4ac84c
MD5 21da0aa4b3808bb53414f687ac6b36fe
BLAKE2b-256 e642e7a54f961b205ef7da6e02c73633cdd5e978010f8160d5f34386225277ba

See more details on using hashes here.

File details

Details for the file xknx-0.21.3-py3-none-any.whl.

File metadata

  • Download URL: xknx-0.21.3-py3-none-any.whl
  • Upload date:
  • Size: 186.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.10.4

File hashes

Hashes for xknx-0.21.3-py3-none-any.whl
Algorithm Hash digest
SHA256 1037a2aaafb688b21a11f73c8ae79bcccbd5e9b4dc8aad37c36c4062a953af4b
MD5 0eff1d3cb20b716d1b426f4982af0df6
BLAKE2b-256 3020a6d12486d24f5ad1a761c0ec0a54e9d87f04b871804a7600ca96d600fadb

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page