Coder Social home page Coder Social logo

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

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

asyncio.run(main())

Attributions

Many thanks to Weinzierl Engineering GmbH and MDT technologies GmbH for providing us each an IP Secure Router to support testing and development of xknx.

XKNX's Projects

xknx icon xknx

XKNX - A KNX library written in Python

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.