Skip to content
Closed

Ugh #25

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
0b527d8
set dev version
farmio Feb 1, 2022
2e5f335
Bump setuptools from 60.6.0 to 60.7.1 (#858)
dependabot[bot] Feb 3, 2022
f0c8789
Do a ConnectionStateRequest heartbeat on TCP tunnel connections too (…
farmio Feb 5, 2022
810cee0
Handle invalid payloads per RemoteValue, log a readable warning (#861)
farmio Feb 6, 2022
c327e6e
Release 0.19.2
farmio Feb 6, 2022
be1ba98
set dev version
farmio Feb 6, 2022
412d697
Bump setuptools from 60.7.1 to 60.8.1 (#863)
dependabot[bot] Feb 7, 2022
fb01235
Bump pytest from 6.2.5 to 7.0.0 (#862)
dependabot[bot] Feb 7, 2022
e555aa8
Drop support for python 3.8 (#860)
marvin-w Feb 7, 2022
5a728d6
Bump pytest-asyncio from 0.17.2 to 0.18.0 (#864)
dependabot[bot] Feb 8, 2022
09bd66c
Bump setuptools from 60.8.1 to 60.8.2 (#865)
dependabot[bot] Feb 10, 2022
25bb77f
Bump pytest-asyncio from 0.18.0 to 0.18.1 (#866)
dependabot[bot] Feb 11, 2022
61ff26c
Bump pytest from 7.0.0 to 7.0.1 (#869)
dependabot[bot] Feb 14, 2022
b269e70
Bump setuptools from 60.8.2 to 60.9.0 (#868)
dependabot[bot] Feb 14, 2022
3eb9ed2
support requesting Tunnel Interface informations (#856)
farmio Feb 14, 2022
913deac
Bump setuptools from 60.9.0 to 60.9.1 (#870)
dependabot[bot] Feb 16, 2022
3252ef2
Bump setuptools from 60.9.1 to 60.9.2 (#872)
dependabot[bot] Feb 17, 2022
89acd08
Bump setuptools from 60.9.2 to 60.9.3 (#874)
dependabot[bot] Feb 18, 2022
f674160
Return `bytes` from `to_knx()` in knxip package (#867)
farmio Feb 18, 2022
fc71b01
Upgrade test and lint environment (#876)
farmio Feb 22, 2022
e3939a1
Bump pytest-asyncio from 0.18.1 to 0.18.2 (#881)
dependabot[bot] Mar 4, 2022
046be44
add some badges
farmio Mar 7, 2022
b3b9687
update HA badge link
farmio Mar 7, 2022
5a8be1b
Update README.md
farmio Mar 8, 2022
d884059
Bump pytest from 7.0.1 to 7.1.0 (#885)
dependabot[bot] Mar 14, 2022
46e5633
Bump mypy from 0.931 to 0.940 (#884)
dependabot[bot] Mar 14, 2022
abd525d
Bump mypy from 0.940 to 0.941 (#886)
dependabot[bot] Mar 15, 2022
409cd78
Bump setuptools from 60.9.3 to 60.10.0 (#887)
dependabot[bot] Mar 17, 2022
557a1e9
Bump pytest from 7.1.0 to 7.1.1 (#888)
dependabot[bot] Mar 18, 2022
8dc3782
Bump pytest-asyncio from 0.18.2 to 0.18.3 (#894)
dependabot[bot] Mar 25, 2022
982e1c0
Bump mypy from 0.941 to 0.942 (#893)
dependabot[bot] Mar 25, 2022
41c3661
Bump setuptools from 60.10.0 to 61.0.0 (#895)
dependabot[bot] Mar 25, 2022
0733bb1
Bump pylint from 2.12.2 to 2.13.0 (#892)
dependabot[bot] Mar 25, 2022
2981e8c
Bump setuptools from 61.0.0 to 61.2.0 (#897)
dependabot[bot] Mar 28, 2022
7542d97
Bump pylint from 2.13.0 to 2.13.2 (#896)
dependabot[bot] Mar 28, 2022
c8dc469
Add IP-Secure tunnelling support (#879)
farmio Mar 28, 2022
d4fe323
Release 0.20.0
marvin-w Mar 28, 2022
6a2ce72
Bump pylint from 2.13.2 to 2.13.3 (#900)
dependabot[bot] Mar 29, 2022
3b211de
Stop SecureSession keepalive_task when session is stopped (#901)
farmio Mar 30, 2022
bfdecb9
Decrypt management password in keyring (#902)
marvin-w Mar 31, 2022
3b07a7a
Bump pylint from 2.13.3 to 2.13.4 (#903)
dependabot[bot] Mar 31, 2022
78b12f8
Bump setuptools from 61.2.0 to 61.3.0 (#904)
dependabot[bot] Apr 3, 2022
ef6811c
Bump pre-commit from 2.17.0 to 2.18.1 (#908)
dependabot[bot] Apr 4, 2022
7d25855
Bump setuptools from 61.3.0 to 61.3.1 (#907)
dependabot[bot] Apr 4, 2022
2a17285
Add support for search request extended (#905)
marvin-w Apr 4, 2022
cf242d2
Use XKNX `state_updater` argument to set default method for StateUpda…
farmio Apr 4, 2022
4bc15ab
Add support for DPT 16.001 (#910)
farmio Apr 5, 2022
7696ea9
0.20.1
marvin-w Apr 5, 2022
35826af
Bump setuptools from 61.3.1 to 62.0.0 (#909)
dependabot[bot] Apr 5, 2022
44c1c79
Bump pylint from 2.13.4 to 2.13.5 (#911)
dependabot[bot] Apr 7, 2022
0d75611
Properly shutdown ClimateMode if we shutdown Climate (#913)
marvin-w Apr 11, 2022
e83a570
Bump tox from 3.24.5 to 3.25.0 (#914)
dependabot[bot] Apr 11, 2022
86f71d3
Bump setuptools from 62.0.0 to 62.1.0 (#915)
dependabot[bot] Apr 11, 2022
1b4db22
Release 0.20.2
marvin-w Apr 11, 2022
dd1c0fe
Add `value_type` attribute to Notification for text encoding (#917)
farmio Apr 14, 2022
6f85b76
Fix call from wrong Thread in ConnectionManager (#916)
farmio Apr 14, 2022
d5b64e8
Remove unneeded ignores in dependabot config
marvin-w Apr 15, 2022
f58a620
Release 0.20.3
farmio Apr 15, 2022
23dbad2
Purify `xknx.knxip` modules (#919)
farmio Apr 17, 2022
6815521
Include base class in `DPTBase.parse_transcoder()` lookup (#918)
farmio Apr 17, 2022
98fd2c2
remove relative imports (#920)
farmio Apr 17, 2022
e7f535f
Purify `xknx.io` modules (#921)
farmio Apr 18, 2022
28429ee
Add DIB parsers for Secured Service Families and Tunneling Info (#922)
farmio Apr 20, 2022
b03d9ef
Fix exposure of date, time and datetime object when threaded=True (#925)
marvin-w Apr 20, 2022
8e6937b
Release 0.20.4
marvin-w Apr 20, 2022
20175bf
Use `__repr__` instead of `__str__` in xknx.knxip (#924)
farmio Apr 21, 2022
804b39d
Bump pylint from 2.13.5 to 2.13.7 (#926)
dependabot[bot] Apr 21, 2022
bb80a06
Bump pytest from 7.1.1 to 7.1.2 (#929)
dependabot[bot] Apr 25, 2022
ba72068
Bump cryptography from 35.0.0 to 36.0.2 (#899)
dependabot[bot] Apr 27, 2022
8c6d0e6
Don't handle KNX IP Secure devices when using automatic connection mo…
farmio Apr 27, 2022
8b14318
Unicast discovery endpoint (#934)
farmio Apr 28, 2022
46396dd
Bump mypy from 0.942 to 0.950 (#932)
dependabot[bot] Apr 30, 2022
c700585
Try multiple gateways in Automatic mode (#935)
farmio Apr 30, 2022
6c5a440
Release 0.21.0
farmio Apr 30, 2022
1104f13
Bump cryptography from 37.0.0 to 37.0.1 (#933)
dependabot[bot] Apr 30, 2022
19753a0
Fix task registry for restarting tasks (#936)
farmio May 1, 2022
1a4c7b8
Release 0.21.1
marvin-w May 1, 2022
43e958e
Rename Task `task` attribute to `async_func` (#939)
farmio May 1, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,3 @@ updates:
schedule:
interval: daily
open-pull-requests-limit: 10
ignore:
- dependency-name: pylint
versions:
- 2.8.1
- 2.8.2
- dependency-name: astroid
versions:
- 2.5.3
- 2.5.6
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.8, 3.9, '3.10']
python-version: [3.9, '3.10']
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
Expand Down Expand Up @@ -58,7 +58,7 @@ jobs:
needs: ["build"]
strategy:
matrix:
python-version: [3.9]
python-version: ["3.10"]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
Expand Down
22 changes: 12 additions & 10 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,32 +1,34 @@
---
repos:
- repo: https://github.com/asottile/pyupgrade
rev: v2.11.0
rev: v2.31.0
hooks:
- id: pyupgrade
args: [--py38-plus]
args: [--py39-plus]
- repo: https://github.com/psf/black
rev: 20.8b1
rev: 22.3.0
hooks:
- id: black
args:
- --safe
- --quiet
files: ^((xknx|test|examples|home-assistant-plugin|docs)/.+)?[^/]+\.py$
- repo: https://gitlab.com/pycqa/flake8
rev: 3.9.0
- repo: https://github.com/pycqa/flake8
rev: 4.0.1
hooks:
- id: flake8
additional_dependencies:
- flake8-docstrings==1.6.0
- pydocstyle==6.0.0
files: ^(xknx|examples|docs)/.+\.py$
- repo: https://github.com/timothycrosley/isort
rev: 5.8.0
- repo: https://github.com/PyCQA/isort
rev: 5.10.1
hooks:
- id: isort
args:
- --resolve-all-configs
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.4.0
rev: v4.1.0
hooks:
- id: check-executables-have-shebangs
stages: [manual]
Expand All @@ -36,15 +38,15 @@ repos:
- --branch=main
- id: trailing-whitespace
- repo: https://github.com/cdce8p/python-typing-update
rev: v0.3.2
rev: v0.3.5
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:
- --py38-plus
- --py39-plus
- --force
- --keep-updates
files: ^(xknx)/.+\.py$
Expand Down
63 changes: 0 additions & 63 deletions .pylintrc

This file was deleted.

4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ pypi:
@twine upload dist/*

pylint:
@pylint --jobs=0 --rcfile=.pylintrc xknx *.py examples/*.py
@pylint --jobs=0 --rcfile=.pylintrc --disable=no-self-use,protected-access,abstract-class-instantiated test/*
@pylint --jobs=0 xknx *.py examples/*.py
@pylint --jobs=0 --disable=no-self-use,protected-access,abstract-class-instantiated test/*

pydocstyle:
@pydocstyle xknx test/*.py test/*.py *.py examples/*.py
Expand Down
13 changes: 9 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,23 @@
# XKNX - An Asynchronous KNX Library Written in Python
# XKNX - An asynchronous KNX library written in Python

![PyPI - Python Version](https://img.shields.io/pypi/pyversions/xknx?logo=python)
[![codecov](https://codecov.io/gh/XKNX/xknx/branch/main/graph/badge.svg?token=irWbIygS84)](https://codecov.io/gh/XKNX/xknx)
[![Checked with mypy](http://www.mypy-lang.org/static/mypy_badge.svg)](http://mypy-lang.org/)
[![Pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)](https://github.com/pre-commit/pre-commit)
[![Pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=f8b424)](https://github.com/pre-commit/pre-commit)
[![HA integration usage](https://img.shields.io/badge/dynamic/json?color=41BDF5&logo=home-assistant&label=integration%20usage&suffix=%20installs&cacheSeconds=15600&url=https://analytics.home-assistant.io/data.json&query=current.integrations.knx)](https://www.home-assistant.io/integrations/knx/)
[![Discord](https://img.shields.io/discord/338619021215924227?color=7289da&label=Discord&logo=discord&logoColor=7289da)](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 join the [XKNX chat on Discord](https://discord.gg/EuAQDXU) or write an [email](mailto:xknx@xknx.io).
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.8 in order to use XKNX.
You will need at least Python 3.9 in order to use XKNX.

Setting up your local environment:

Expand All @@ -30,9 +33,11 @@ XKNX contains a [plugin](https://xknx.io/home_assistant) for the [Home Assistant
```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:
Expand Down
112 changes: 112 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,117 @@
# Changelog

## Unreleased changes

### Internals

- Rename TaskRegistry.register and Task `task` attribute to `async_func` to avoid confusion; return Task from `start()`

## 0.21.1 Fix Task Registry 2022-05-01

### Bugfixes

- Fix exposure of datetime, time and date objects to the Bus again

### Internals

- TaskRegistry takes functions returning coroutines instead of coroutines directly

## 0.21.0 Search and connect 2022-04-30

### Discovery

- Use unicast discovery endpoint to receive SearchRespones frames
- Send SearchRequest and SearchRequestExtended simultaneously when using GatewayScanner
- Skip SearchResponse results for Core-V2 devices - wait for SearchResponseExtended
- Identify interfaces having KNX IP Secure Tunneling required and skip if using Automatic connection mode
- Only send SearchRequests from one interface for each `scan()` call
- Connect to next found interface in case of unsuccessful initial connection when using "automatic" mode

### Internals

- Use `ifaddr` instead of `netifaces`
- make HPAI hashable and add `addr_tuple` convenice property

## 0.20.4 Fix exposure of time and date 2022-04-20

### Bugfixes

- Fix exposure of datetime, time and date objects to the Bus

### Protocol

- Add DIBSecuredServiceFamilies and DIBTunnelingInfo parser

### Internal

- Include base class in `DPTBase.parse_transcoder()` lookup
- Move `levels` instance attribute form `GroupAddress` to `address_format` class variable
- Remove xknx form every class in the knxip package: CEMIFrame, KNXIPFrame and KNXIPBody (and subclasses)
- Remove xknx form every class in the io.request_response package
- Remove xknx form io.transport package and io.secure_session and io.self_description modules

## 0.20.3 Threading fixes 2022-04-15

### Devices

- Notification: add `value_type` argument to set "string" or "latin_1" text encoding

### Bug fixes

- Fix call from wrong thread in ConnectionManager
- Fix thread leak when restarting XKNX

### Internal

- Change RemoteValueString to _RemoteValueGeneric subclass

## 0.20.2 Handle shutdown properly 2022-04-11

### Bug fixes

- Properly shutdown climate mode if climate.shutdown() is called and ClimateMode exists

## 0.20.1 Add support for DPT 16.001 and SearchRequestExtended 2022-04-05

### Features

- Add support for SearchRequestExtended to find interfaces that allow IP Secure
- Use XKNX `state_updater` argument to set default method for StateUpdater. StateUpdater is always started - Device / RemoteValue can always opt in to use it, even if default is `False`.
- Add support for DPT 16.001 (DPT_String_8859_1) as `DPTLatin1` with value_type "latin_1".

### Bug fixes

- Stop SecureSession keepalive_task when session is stopped (and don't restart it from sending STATUS_CLOSE)
- Fix encoding invalid characters for DPTString (value_type "string")

## 0.20.0 IP Secure 2022-03-29

### Features

- We now support IP Secure!
Thanks to MDT for providing us an interface for testing purposes!
- Add support for requesting tunnel interface information

### Protocol

- add SessionRequest, SessionResponse, SessionAuthenticate, SessionStatus, SecureWrapper Frame parser

### Internals

- Drop support for Python 3.8 to follow Home Assistant changes
- Return `bytes` from to_knx() in knxip package instead of `list[int]`
- Add a callback for `connection_lost` of TCP transports to Tunnel

## 0.19.2 TCP Heartbeat 2022-02-06

### Connection

- Do a ConnectionStateRequest heartbeat on TCP tunnel connections too

### Devices

- Handle invalid payloads per RemoteValue, log a readable warning

## 0.19.1 Bugfix for route_back 2022-01-31

### Connection
Expand Down
2 changes: 2 additions & 0 deletions docs/climate.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ await climate.set_setpoint_shift(1)
# Reading climate device
await climate.sync(wait_for_result=True)
print("Current temperature: ", climate.temperature)
# Shutdown the Climate and the underlying ClimateMode!
climate.shutdown()
```

## [](#header-2)Example
Expand Down
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ XKNX...

## [](#header-2)Installation

XKNX depends on Python >= 3.8
XKNX depends on Python >= 3.9

You can install XKNX as Python package via pip:

Expand Down
2 changes: 1 addition & 1 deletion docs/xknx.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ The constructor of the XKNX object takes several parameters:
- `multicast_group` is the multicast IP address - can be used to override the default multicast address (`224.0.23.12`)
- `multicast_port` is the multicast port - can be used to override the default multicast port (`3671`)
- `log_directory` is the path to the log directory - when set to a valid directory we log to a dedicated file in this directory called `xknx.log`. The log files are rotated each night and will exist for 7 days. After that the oldest one will be deleted.
- if `state_updater` is set, XKNX will start (once `start() is called) an asynchronous process for syncing the states of all connected devices every hour
- `state_updater` is used to set the default state-updating mechanism used by devices. `False` to disable state-updating by default, `True` to use default 60 minutes expire-interval, a number between 2 to 1440 to configure expire-time or a string "expire 50", "every 90" for strict periodically update or "init" for update when a connection is established. Default: `False`.
- if `daemon_mode` is set, start will only stop if Control-X is pressed. This function is useful for using XKNX as a daemon, e.g. for using the callback functions or using the internal action logic.
- `connection_config` replaces a ConnectionConfig() that was read from a yaml config file.

Expand Down
8 changes: 3 additions & 5 deletions examples/example_disconnect.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,25 +24,23 @@ async def main():
print("Gateway does not support tunneling")
return

udp_transport = UDPTransport(
xknx, (gateway.local_ip, 0), (gateway.ip_addr, gateway.port)
)
udp_transport = UDPTransport((gateway.local_ip, 0), (gateway.ip_addr, gateway.port))

await udp_transport.connect()
local_hpai = HPAI(*udp_transport.getsockname())

for i in range(0, 255):

conn_state = ConnectionState(
xknx, udp_transport, communication_channel_id=i, local_hpai=local_hpai
udp_transport, communication_channel_id=i, local_hpai=local_hpai
)

await conn_state.start()

if conn_state.success:
print("Disconnecting ", i)
disconnect = Disconnect(
xknx, udp_transport, communication_channel_id=i, local_hpai=local_hpai
udp_transport, communication_channel_id=i, local_hpai=local_hpai
)

await disconnect.start()
Expand Down
3 changes: 1 addition & 2 deletions examples/example_info.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
"""Example on how to read mask version and properties from a KNX actor."""
import asyncio
import sys
from typing import List

from xknx import XKNX
from xknx.core import PayloadReader
Expand All @@ -14,7 +13,7 @@
)


async def main(argv: List[str]):
async def main(argv: list[str]):
"""Connect and read information from a KNX device. Requires a System B device."""
if len(argv) == 2:
address = IndividualAddress(argv[1])
Expand Down
Loading