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

Coverage Status 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.7 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.17.4.tar.gz (98.6 kB view details)

Uploaded Source

Built Distribution

xknx-0.17.4-py3-none-any.whl (157.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: xknx-0.17.4.tar.gz
  • Upload date:
  • Size: 98.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2

File hashes

Hashes for xknx-0.17.4.tar.gz
Algorithm Hash digest
SHA256 360137e04473900a0ad10bb4cbf0d5cf3f7fe6f99191620916471fdcb181cd7f
MD5 f3dc7d7ff53ae70025033e82a03b8e74
BLAKE2b-256 f414e46fa729dc2a119998a40bffb14487835528ecaf1fac02d329819d0fe5f4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: xknx-0.17.4-py3-none-any.whl
  • Upload date:
  • Size: 157.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2

File hashes

Hashes for xknx-0.17.4-py3-none-any.whl
Algorithm Hash digest
SHA256 e4566580293ac40b01d517cba3a41896849c2e36d1265b6d4b4d6b2891b479fd
MD5 e8b033fe64d86a418212ec1770849569
BLAKE2b-256 4582a752d46ace51e5cd200b1cb9d0eca7f1a5ee648850fd1c4b45a5def12f99

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