pax_global_header 0000666 0000000 0000000 00000000064 14755307626 0014531 g ustar 00root root 0000000 0000000 52 comment=2af570ea5336aef8fa5dbb5f4a0a965f684e3c4b
xknx-3.6.0/ 0000775 0000000 0000000 00000000000 14755307626 0012527 5 ustar 00root root 0000000 0000000 xknx-3.6.0/.codecov.yml 0000664 0000000 0000000 00000000622 14755307626 0014752 0 ustar 00root root 0000000 0000000 comment: # this is a top-level key
layout: "reach, diff, flags, files"
behavior: default
require_changes: false # if true: only post the comment if coverage changes
require_base: no # [yes :: must have a base report to post]
require_head: yes # [yes :: must have a head report to post]
branches: # branch names that can post comment
- "main" xknx-3.6.0/.coveragerc 0000664 0000000 0000000 00000000742 14755307626 0014653 0 ustar 00root root 0000000 0000000 [run]
source = xknx
relative_files = True
omit =
[report]
precision = 2
# Regexes for lines to exclude from consideration
exclude_lines =
# Don't complain about type checking imports:
if TYPE_CHECKING:
# Don't complain if tests don't hit defensive assertion code:
raise NotImplementedError
# Don't complain about logs
logger.debug
logger.info
logger.warning
logger.error
# Don't complain about missing debug-only code:
def __repr__
xknx-3.6.0/.github/ 0000775 0000000 0000000 00000000000 14755307626 0014067 5 ustar 00root root 0000000 0000000 xknx-3.6.0/.github/FUNDING.yml 0000664 0000000 0000000 00000000043 14755307626 0015701 0 ustar 00root root 0000000 0000000 github: XKNX
open_collective: xknx
xknx-3.6.0/.github/ISSUE_TEMPLATE/ 0000775 0000000 0000000 00000000000 14755307626 0016252 5 ustar 00root root 0000000 0000000 xknx-3.6.0/.github/ISSUE_TEMPLATE/bug_report.md 0000664 0000000 0000000 00000001472 14755307626 0020750 0 ustar 00root root 0000000 0000000 ---
name: XKNX Library bug report
about: Report a bug in our library
title: ''
labels: ''
assignees: ''
---
**Description of problem:**
- [ ] using xknx standalone
- [ ] using Home-Assistant knx integration
**Version information:**
- xknx / Home-Assistant release with the issue:
- last working xknx / Home-Assistant release (if known):
**KNX installation:**
**Problem-relevant `configuration.yaml` entries (fill out even if it seems unimportant):**
**Diagnostic data of the config entry (only when Home Assistant is used)**
**Traceback (if applicable):**
xknx-3.6.0/.github/dependabot.yml 0000664 0000000 0000000 00000000325 14755307626 0016717 0 ustar 00root root 0000000 0000000 version: 2
updates:
- package-ecosystem: pip
directory: "/"
schedule:
interval: monthly
open-pull-requests-limit: 10
- package-ecosystem: github-actions
directory: "/"
schedule:
interval: monthly xknx-3.6.0/.github/pull_request_template.md 0000664 0000000 0000000 00000002045 14755307626 0021031 0 ustar 00root root 0000000 0000000
## Description
Fixes # (issue)
## Type of change
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] Code quality improvements to existing code or addition of tests
## Checklist
- [ ] The documentation has been adjusted accordingly
- [ ] Tests have been added that prove the fix is effective or that the feature works
- [ ] The changes are documented in the changelog (docs/changelog.md) xknx-3.6.0/.github/workflows/ 0000775 0000000 0000000 00000000000 14755307626 0016124 5 ustar 00root root 0000000 0000000 xknx-3.6.0/.github/workflows/ci.yml 0000664 0000000 0000000 00000003730 14755307626 0017245 0 ustar 00root root 0000000 0000000 name: CI
on:
push:
branches:
- main
pull_request:
branches:
- "**" # run on all branches
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
cache-dependency-path: |
requirements/production.txt
requirements/testing.txt
.pre-commit-config.yaml
- name: Install dependencies
run: |
pip install -r requirements/testing.txt
- name: CI
run: |
tox
- name: Upload coverage artifact
uses: actions/upload-artifact@v4
with:
name: coverage-${{ matrix.python-version }}
path: .coverage
include-hidden-files: true
coverage:
name: Process test coverage
runs-on: ubuntu-latest
needs: ["build"]
strategy:
matrix:
python-version: ["3.13"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
cache-dependency-path: |
requirements/production.txt
requirements/testing.txt
.pre-commit-config.yaml
- name: Install dependencies
run: |
pip install -r requirements/testing.txt
- name: Download all coverage artifacts
uses: actions/download-artifact@v4
- name: Create coverage report
run: |
coverage combine coverage-*/.coverage
coverage report --fail-under=94
coverage xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
xknx-3.6.0/.github/workflows/pre-commit-update.yml 0000664 0000000 0000000 00000002416 14755307626 0022206 0 ustar 00root root 0000000 0000000 name: Pre-commit auto-update
on:
schedule:
- cron: "0 8 15 * *"
# on demand
workflow_dispatch:
jobs:
auto-update:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.x"
cache: "pip"
cache-dependency-path: |
requirements/production.txt
requirements/testing.txt
.pre-commit-config.yaml
- name: Install dependencies
# needed for the mypy hook
run: |
pip install -r requirements/testing.txt
- name: Pre-commit auto-update
env:
# new branch is created in create-pull-request step
SKIP: no-commit-to-branch
run: |
pre-commit autoupdate
- uses: peter-evans/create-pull-request@v7
with:
token: ${{ secrets.GITHUB_TOKEN }}
branch: update/pre-commit-hooks
title: Update pre-commit hooks
commit-message: "update pre-commit hooks"
labels: |
dependencies
body: |
Update versions of pre-commit hooks to latest version.
Run tests locally to check for conflicts since PRs from GitHub Actions don't trigger workflows.
xknx-3.6.0/.github/workflows/pythonpublish.yml 0000664 0000000 0000000 00000001520 14755307626 0021555 0 ustar 00root root 0000000 0000000 # This workflows will upload a Python Package using Twine when a release is created
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
name: Upload Python Package
on:
release:
types: [published]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install build twine
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python -m build
twine upload dist/*
xknx-3.6.0/.github/workflows/stale.yml 0000664 0000000 0000000 00000003411 14755307626 0017756 0 ustar 00root root 0000000 0000000 name: Stale
# yamllint disable-line rule:truthy
on:
schedule:
- cron: "0 9 * * 5"
workflow_dispatch:
jobs:
stale:
runs-on: ubuntu-latest
steps:
# The 90 day stale policy
# Used for:
# - Issues & PRs
# - No PRs marked as no-stale
# - No issues marked as no-stale or help-wanted
- name: 90 days stale issues & PRs policy
uses: actions/stale@v9
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
days-before-stale: 90
days-before-close: 7
operations-per-run: 150
remove-stale-when-updated: true
stale-issue-label: "stale"
exempt-issue-labels: "no-stale,💡 feature request,🙋♂️ help wanted,🏗 in progress,👩💻 needs testing,🐜 bug"
stale-issue-message: >
This issue has been automatically marked as stale because it has not had
recent activity. It will be closed if no further activity occurs.
Please make sure to update to the latest version of xknx (or Home Assistant) and
check if that solves the issue. Let us know if that works for you by
adding a comment 👍
This issue has now been marked as stale and will be closed if no
further activity occurs. Thank you for your contributions.
stale-pr-label: "stale"
exempt-pr-labels: "no-stale,🙋♂️ help wanted,🏗 in progress,👩💻 needs testing,🐜 bug"
stale-pr-message: >
There hasn't been any activity on this pull request recently. This
pull request has been automatically marked as stale because of that
and will be closed if no further activity occurs within 7 days.
Thank you for your contributions.
xknx-3.6.0/.gitignore 0000664 0000000 0000000 00000000336 14755307626 0014521 0 ustar 00root root 0000000 0000000 *.pyc
docs/_site/
docs/vendor/
htmlcov
build/
dist/
xknx.egg-info/
.cache
.ruff_cache
.tox
.DS_Store
.coverage
coverage.xml
venv
.idea/
.vscode/
.sass-cache/
.pytest_cache/
.mypy_cache/
.python-version
*.iml
*.log
main.py
xknx-3.6.0/.pre-commit-config.yaml 0000664 0000000 0000000 00000004426 14755307626 0017016 0 ustar 00root root 0000000 0000000 ---
repos:
- repo: https://github.com/codespell-project/codespell
rev: v2.4.1
hooks:
- id: codespell
additional_dependencies:
- tomli
exclude_types: [csv, json]
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: 'v0.9.6'
hooks:
- id: ruff
# in CI it is directly run by tox to allow dependency upgrade checks
stages: [pre-commit]
args: [ --fix, --exit-non-zero-on-fix ]
- id: ruff-format
files: ^((xknx|test|examples|docs)/.+)?[^/]+\.py$
# in CI it is directly run by tox to allow dependency upgrade checks
stages: [pre-commit]
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: check-executables-have-shebangs
stages: [manual]
- id: check-json
- id: no-commit-to-branch
args:
- --branch=main
- id: trailing-whitespace
- repo: https://github.com/cdce8p/python-typing-update
rev: v0.7.0
hooks:
# Run `pre-commit run --hook-stage manual python-typing-update --all-files` manually
# from time to time to update python typing syntax.
# Will require manual work, before submitting changes!
- id: python-typing-update
stages: [manual]
args:
- --py310-plus
- --force
- --keep-updates
files: ^(xknx)/.+\.py$
- repo: local
hooks:
# Run mypy through our wrapper script in order to get the possible
# pyenv and/or virtualenv activated; it may not have been e.g. if
# committing from a GUI tool that was not launched from an activated
# shell.
- id: mypy
name: mypy
entry: script/run-in-env.sh mypy
language: script
types: [python]
require_serial: true
files: ^xknx/.+\.py$
- repo: local
hooks:
- id: pylint-xknx
name: pylint-xknx
entry: pylint xknx examples
language: python
types: [python]
pass_filenames: true
require_serial: true
files: ^(xknx/|examples/)
- id: pylint-test
name: pylint-test
entry: pylint --disable=protected-access,abstract-class-instantiated
language: python
types: [python]
pass_filenames: true
require_serial: true
files: ^test/
xknx-3.6.0/LICENSE 0000664 0000000 0000000 00000001777 14755307626 0013550 0 ustar 00root root 0000000 0000000 Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
xknx-3.6.0/MANIFEST.in 0000664 0000000 0000000 00000000070 14755307626 0014262 0 ustar 00root root 0000000 0000000 include README.md
include LICENSE
include xknx/py.typed
xknx-3.6.0/README.md 0000664 0000000 0000000 00000005225 14755307626 0014012 0 ustar 00root root 0000000 0000000 # XKNX - An asynchronous KNX library written in Python

[](https://codecov.io/gh/XKNX/xknx)
[](http://mypy-lang.org/)
[](https://github.com/pre-commit/pre-commit)
[](https://www.home-assistant.io/integrations/knx/)
[](https://discord.gg/bkZe9m4zvw)
## Documentation
See documentation at: [https://xknx.io/](https://xknx.io/)
## Help
We need your help for testing and improving XKNX. For questions, feature requests, bug reports either open an [issue](https://github.com/XKNX/xknx/issues), join the [XKNX chat on Discord](https://discord.gg/EuAQDXU) or write an [email](mailto:xknx@xknx.io).
## Development
You will need at least Python 3.10 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](https://home-assistant.io/).
## Example
```python
"""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 [Weinzierl Engineering GmbH](https://weinzierl.de) and [MDT technologies GmbH](https://www.mdt.de) for providing us each an IP Secure Router to support testing and development of xknx.
xknx-3.6.0/changelog.md 0000777 0000000 0000000 00000000000 14755307626 0020174 2docs/changelog.md ustar 00root root 0000000 0000000 xknx-3.6.0/docs/ 0000775 0000000 0000000 00000000000 14755307626 0013457 5 ustar 00root root 0000000 0000000 xknx-3.6.0/docs/.bundle/ 0000775 0000000 0000000 00000000000 14755307626 0015006 5 ustar 00root root 0000000 0000000 xknx-3.6.0/docs/.bundle/config 0000664 0000000 0000000 00000000041 14755307626 0016171 0 ustar 00root root 0000000 0000000 ---
BUNDLE_PATH: "vendor/bundle"
xknx-3.6.0/docs/.gitignore 0000664 0000000 0000000 00000000015 14755307626 0015443 0 ustar 00root root 0000000 0000000 .jekyll-cache xknx-3.6.0/docs/.ruby-version 0000664 0000000 0000000 00000000005 14755307626 0016117 0 ustar 00root root 0000000 0000000 2.7.0 xknx-3.6.0/docs/Gemfile 0000664 0000000 0000000 00000000132 14755307626 0014746 0 ustar 00root root 0000000 0000000 gem "jekyll"
gem "just-the-docs"
gem "kramdown-parser-gfm"
source 'https://rubygems.org'
xknx-3.6.0/docs/Gemfile.lock 0000664 0000000 0000000 00000003345 14755307626 0015706 0 ustar 00root root 0000000 0000000 GEM
remote: https://rubygems.org/
specs:
addressable (2.8.0)
public_suffix (>= 2.0.2, < 5.0)
colorator (1.1.0)
concurrent-ruby (1.1.7)
em-websocket (0.5.1)
eventmachine (>= 0.12.9)
http_parser.rb (~> 0.6.0)
eventmachine (1.2.7)
ffi (1.13.1)
forwardable-extended (2.6.0)
http_parser.rb (0.6.0)
i18n (1.8.5)
concurrent-ruby (~> 1.0)
jekyll (4.1.1)
addressable (~> 2.4)
colorator (~> 1.0)
em-websocket (~> 0.5)
i18n (~> 1.0)
jekyll-sass-converter (~> 2.0)
jekyll-watch (~> 2.0)
kramdown (~> 2.1)
kramdown-parser-gfm (~> 1.0)
liquid (~> 4.0)
mercenary (~> 0.4.0)
pathutil (~> 0.9)
rouge (~> 3.0)
safe_yaml (~> 1.0)
terminal-table (~> 1.8)
jekyll-sass-converter (2.1.0)
sassc (> 2.0.1, < 3.0)
jekyll-seo-tag (2.6.1)
jekyll (>= 3.3, < 5.0)
jekyll-watch (2.2.1)
listen (~> 3.0)
just-the-docs (0.3.1)
jekyll (>= 3.8.5)
jekyll-seo-tag (~> 2.0)
rake (>= 12.3.1, < 13.1.0)
kramdown (2.3.1)
rexml
kramdown-parser-gfm (1.1.0)
kramdown (~> 2.0)
liquid (4.0.3)
listen (3.2.1)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
mercenary (0.4.0)
pathutil (0.16.2)
forwardable-extended (~> 2.6)
public_suffix (4.0.6)
rake (13.0.1)
rb-fsevent (0.10.4)
rb-inotify (0.10.1)
ffi (~> 1.0)
rexml (3.3.9)
rouge (3.22.0)
safe_yaml (1.0.5)
sassc (2.4.0)
ffi (~> 1.9)
terminal-table (1.8.0)
unicode-display_width (~> 1.1, >= 1.1.1)
unicode-display_width (1.7.0)
PLATFORMS
ruby
DEPENDENCIES
jekyll
just-the-docs
kramdown-parser-gfm
BUNDLED WITH
2.1.4
xknx-3.6.0/docs/Makefile 0000664 0000000 0000000 00000000645 14755307626 0015124 0 ustar 00root root 0000000 0000000 all:
@echo "Jekyll website for xknx.io"
@echo ""
@echo "Preparations:"
@echo ""
@echo "bundle install"
@echo ""
@echo "Available targets"
@echo ""
@echo "build - build website"
@echo ""
@echo "serve - start webservice on localhost: http://localhost:4000/"
@echo ""
@echo "clean"
install:
bundle install
build:
bundle exec jekyll build
serve:
bundle exec jekyll serve
clean:
bundle exec jekyll clean
xknx-3.6.0/docs/README.md 0000664 0000000 0000000 00000000331 14755307626 0014733 0 ustar 00root root 0000000 0000000 # XKNX website
This is the source for the [XKNX website](http://xknx.io).
# Site preview
Run
```bash
bundle exec jekyll build
bundle exec jekyll serve
```
and open [http://127.0.0.1:4000](http://127.0.0.1:4000)
xknx-3.6.0/docs/_config.yml 0000664 0000000 0000000 00000002542 14755307626 0015611 0 ustar 00root root 0000000 0000000 title: XKNX
description: A KNX library written in Python
meta:
title: XKNX - A Python KNX library
keywords: KNX,KNX/IP,EIB,Home Automation,Home Assistant
description: >
XKNX is a KNX library written in Python. It lets you to control KNX devices
like Lights, Shutters, Covers, Switches, Outlets, Thermostats
via python scripts. Driver for the Home Assistant KNX integration.
robots: index,follow,noarchive,noodp
google-site-verification: Z_FsKIe3iX8aXRXZG8NUgqOr3d41c5k9cBGccgKOvwM
theme: "just-the-docs"
show_downloads: true
xknx:
zip_url: "https://github.com/XKNX/xknx/archive/main.zip"
tar_url: "https://github.com/XKNX/xknx/archive/main.tar.gz"
repository_url: "http://github.com/XKNX/xknx"
logo: "/assets/img/xknx_logo_inverted.png"
# Enable or disable the site search
# Supports true (default) or false
search_enabled: true
aux_links:
"XKNX on GitHub":
- "//github.com/xknx/xknx"
color_scheme: dark
# Footer "Edit this page on GitHub" link text
gh_edit_link: true # show or hide edit this page link
gh_edit_link_text: "Edit this page on GitHub."
gh_edit_repository: "https://github.com/XKNX/xknx" # the github URL for your repo
gh_edit_branch: "main" # the branch that your docs is served from
gh_edit_view_mode: "edit" # "tree" or "edit" if you want the user to jump into the editor immediately
xknx-3.6.0/docs/_layouts/ 0000775 0000000 0000000 00000000000 14755307626 0015316 5 ustar 00root root 0000000 0000000 xknx-3.6.0/docs/_layouts/default.html 0000664 0000000 0000000 00000017507 14755307626 0017642 0 ustar 00root root 0000000 0000000 ---
layout: table_wrappers
---
{% include head.html %}