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

codecov Checked with mypy Pre-commit

Documentation

See documentation at: https://xknx.io/

Help

We need your help for testing and improving XKNX. For questions, feature requests, bug reports either join the XKNX chat on Discord or write an email.

Development

You will need at least Python 3.8 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.19.2.tar.gz (96.6 kB view details)

Uploaded Source

Built Distribution

xknx-0.19.2-py3-none-any.whl (159.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: xknx-0.19.2.tar.gz
  • Upload date:
  • Size: 96.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.10.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2

File hashes

Hashes for xknx-0.19.2.tar.gz
Algorithm Hash digest
SHA256 7b9724fb5a4f86707be46d09ef3883feaff044a18da6702a0a43a37f24892fde
MD5 4c5ae2e8b70058b65e599c22d1d66e8d
BLAKE2b-256 9ebc86bd90fd7e2a1b7c593cadc0ed6dd1d055036b80a9606a86446d91aa6dcd

See more details on using hashes here.

File details

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

File metadata

  • Download URL: xknx-0.19.2-py3-none-any.whl
  • Upload date:
  • Size: 159.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.10.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2

File hashes

Hashes for xknx-0.19.2-py3-none-any.whl
Algorithm Hash digest
SHA256 75858955fa2e8b1a8c62428a1be07e8cb2d0685b125de3d202b841065b903c8b
MD5 8c81a81617ab07558568c04aff69229f
BLAKE2b-256 061085f7fed03d092992b8cafe8c95dfb14cdcc68fb26cd2a833bf72c5a20640

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