pax_global_header 0000666 0000000 0000000 00000000064 15131252335 0014512 g ustar 00root root 0000000 0000000 52 comment=ade176427341b5b1e023e4042bf35ed2247d480d
XKNX-xknx-ade1764/ 0000775 0000000 0000000 00000000000 15131252335 0013705 5 ustar 00root root 0000000 0000000 XKNX-xknx-ade1764/.codecov.yml 0000664 0000000 0000000 00000000622 15131252335 0016130 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-xknx-ade1764/.coveragerc 0000664 0000000 0000000 00000000742 15131252335 0016031 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-xknx-ade1764/.github/ 0000775 0000000 0000000 00000000000 15131252335 0015245 5 ustar 00root root 0000000 0000000 XKNX-xknx-ade1764/.github/FUNDING.yml 0000664 0000000 0000000 00000000043 15131252335 0017057 0 ustar 00root root 0000000 0000000 github: XKNX
open_collective: xknx
XKNX-xknx-ade1764/.github/ISSUE_TEMPLATE/ 0000775 0000000 0000000 00000000000 15131252335 0017430 5 ustar 00root root 0000000 0000000 XKNX-xknx-ade1764/.github/ISSUE_TEMPLATE/bug_report.md 0000664 0000000 0000000 00000001472 15131252335 0022126 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-xknx-ade1764/.github/dependabot.yml 0000664 0000000 0000000 00000000325 15131252335 0020075 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-xknx-ade1764/.github/pull_request_template.md 0000664 0000000 0000000 00000002045 15131252335 0022207 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-xknx-ade1764/.github/workflows/ 0000775 0000000 0000000 00000000000 15131252335 0017302 5 ustar 00root root 0000000 0000000 XKNX-xknx-ade1764/.github/workflows/ci.yml 0000664 0000000 0000000 00000005243 15131252335 0020424 0 ustar 00root root 0000000 0000000 name: CI
on:
push:
branches:
- main
pull_request:
branches:
- "**" # run on all branches
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- python-version: "3.10"
os: ubuntu-latest
envlist: "py310"
- python-version: "3.11"
os: ubuntu-latest
envlist: "py311"
- python-version: "3.12"
os: ubuntu-latest
envlist: "py312"
- python-version: "3.13"
os: ubuntu-latest
envlist: "py313"
- python-version: "3.14"
os: ubuntu-latest
envlist: "py314,ruff,typing,lint,pylint"
- python-version: "3.13"
os: macos-14
envlist: "py313"
- python-version: "3.13"
os: windows-latest
envlist: "py313"
steps:
- uses: actions/checkout@v6
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
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 run -e "${{ matrix.envlist }}"
- name: Upload coverage artifact
uses: actions/upload-artifact@v6
with:
name: coverage-${{ matrix.os }}-${{ 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.14"]
steps:
- uses: actions/checkout@v6
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
cache-dependency-path: |
requirements/production.txt
requirements/testing.txt
.pre-commit-config.yaml
- name: Install coverage.py
run: pip install coverage
- name: Download all coverage artifacts
uses: actions/download-artifact@v7
- 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:
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}
XKNX-xknx-ade1764/.github/workflows/pre-commit-update.yml 0000664 0000000 0000000 00000002416 15131252335 0023364 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@v6
- name: Set up Python
uses: actions/setup-python@v6
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@v8
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-xknx-ade1764/.github/workflows/pythonpublish.yml 0000664 0000000 0000000 00000001520 15131252335 0022733 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@v6
- name: Set up Python
uses: actions/setup-python@v6
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-xknx-ade1764/.github/workflows/stale.yml 0000664 0000000 0000000 00000003412 15131252335 0021135 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@v10
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-xknx-ade1764/.gitignore 0000664 0000000 0000000 00000000336 15131252335 0015677 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-xknx-ade1764/.pre-commit-config.yaml 0000664 0000000 0000000 00000004427 15131252335 0020175 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.14.9'
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: v6.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.8.1
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-xknx-ade1764/LICENSE 0000664 0000000 0000000 00000001777 15131252335 0014726 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-xknx-ade1764/MANIFEST.in 0000664 0000000 0000000 00000000070 15131252335 0015440 0 ustar 00root root 0000000 0000000 include README.md
include LICENSE
include xknx/py.typed
XKNX-xknx-ade1764/README.md 0000664 0000000 0000000 00000005225 15131252335 0015170 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-xknx-ade1764/changelog.md 0000777 0000000 0000000 00000000000 15131252335 0021352 2docs/changelog.md ustar 00root root 0000000 0000000 XKNX-xknx-ade1764/docs/ 0000775 0000000 0000000 00000000000 15131252335 0014635 5 ustar 00root root 0000000 0000000 XKNX-xknx-ade1764/docs/.bundle/ 0000775 0000000 0000000 00000000000 15131252335 0016164 5 ustar 00root root 0000000 0000000 XKNX-xknx-ade1764/docs/.bundle/config 0000664 0000000 0000000 00000000041 15131252335 0017347 0 ustar 00root root 0000000 0000000 ---
BUNDLE_PATH: "vendor/bundle"
XKNX-xknx-ade1764/docs/.gitignore 0000664 0000000 0000000 00000000015 15131252335 0016621 0 ustar 00root root 0000000 0000000 .jekyll-cache XKNX-xknx-ade1764/docs/.ruby-version 0000664 0000000 0000000 00000000005 15131252335 0017275 0 ustar 00root root 0000000 0000000 2.7.0 XKNX-xknx-ade1764/docs/Gemfile 0000664 0000000 0000000 00000000132 15131252335 0016124 0 ustar 00root root 0000000 0000000 gem "jekyll"
gem "just-the-docs"
gem "kramdown-parser-gfm"
source 'https://rubygems.org'
XKNX-xknx-ade1764/docs/Gemfile.lock 0000664 0000000 0000000 00000003345 15131252335 0017064 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.4.2)
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-xknx-ade1764/docs/Makefile 0000664 0000000 0000000 00000000645 15131252335 0016302 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-xknx-ade1764/docs/README.md 0000664 0000000 0000000 00000000331 15131252335 0016111 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-xknx-ade1764/docs/_config.yml 0000664 0000000 0000000 00000002542 15131252335 0016767 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-xknx-ade1764/docs/_layouts/ 0000775 0000000 0000000 00000000000 15131252335 0016474 5 ustar 00root root 0000000 0000000 XKNX-xknx-ade1764/docs/_layouts/default.html 0000664 0000000 0000000 00000017507 15131252335 0021020 0 ustar 00root root 0000000 0000000 ---
layout: table_wrappers
---
{% include head.html %}
{% if site.search_enabled != false %}
{% endif %}
{% if site.aux_links %}
{% endif %}
{% unless page.url == "/" %}
{% if page.parent %}
{% endif %}
{% endunless %}
{% if site.heading_anchors != false %}
{% include vendor/anchor_headings.html html=content beforeHeading="true" anchorBody="
" anchorClass="anchor-heading" %}
{% else %}
{{ content }}
{% endif %}
{% if page.has_children == true and page.has_toc != false %}
Table of contents
{%- assign children_list = pages_list | where: "parent", page.title | where: "grand_parent", page.parent -%}
{% for child in children_list %}
-
{{ child.title }}{% if child.summary %} - {{ child.summary }}{% endif %}
{% endfor %}
{% endif %}
{% if site.footer_content != nil or site.last_edit_timestamp or site.gh_edit_link %}
{% endif %}
{% if site.search_enabled != false %}
{% if site.search.button %}
{% endif %}
{% endif %}