Releases: mhthies/knxdclient
1.1.0
New features and improvements
- New constructor parameter
timeout
forKNXDConnection
: Allows to specify a timeout for receiving new packets from KNXd. If no packet is received for at leasttimeout
seconds, therun()
coroutine raises a Timeout exception. (Note, that sufficient KNX bus activity is required to avoid timeouts under normal conditions) (thanks to @NanoSpicer) - Raise
ConnectionAbortedError
exception fromopen_group_socket()
anditerate_group_telegrams()
whenrun()
loop exits (for any reason (thanks to @NanoSpicer for the discussion and implementation)
Development improvements
- Update used external GitHub Actions and add testing on Python 3.12 to GitHub Actions CI
1.0.0
This releases includes the following changes in comparison to version 0.4.0:
Breaking changes
-
Deprecated method
KNXDConnection.register_telegram_handler()
finally removed. Use theset_group_apdu_handler()
method, introduced in version 0.4.0, instead.This method takes a single callback function that is called synchronously for each incoming KNX group telegram, instead of multiple coroutines that are each run in an asyncio Task for each incoming telegram. If you still need to run an asynchronous coroutine for each incoming telegram or even multiple coroutines in separate tasks, you can do this in your custom group APDU handler function:
def group_apdu_handler(apdu: knxdclient.ReceivedGroupAPDU) -> None: for coro in my_async_group_handlers: asyncio.create_task(coro(apdu)) knxd_connection.set_group_apdu_handler(group_apdu_handler)
You can also stick with release 0.4.1, which includes the critical fixes from this release, but still supports the
register_telegram_handler()
. However, the 0.4.x branch does not receive the code quality fixes and testing (see below) and will probably be no longer maintained.
Fixes
- Fixed encoding and decoding of year in date and datetime telegrams (KNX DPT 11.xxx and 19.xxx)
- Fixed encoding of weekday in datetime telegrams (KNX DPT 19.xxx)
- Fixed decoding of single character telegrams (KNX DPT 4.xxx)
Code Quality Improvements
- Added comprehensive unittests, including communication testing against actual KNXD daemon. Currently around 90% code coverage and full coverage of all major features.
- Fixed codestyle according to PEP8
- Added Continuous Integration with GitHub Actions for unit tests, type checking (MyPy) and code style checking
- Split up library into multiple Python modules
- Changed packaging metadata to declarative
setup.cfg
and includedpyproject.toml
for direct installing with pip and packaging withpython -m build
- Improved examples to use
asyncio.run()
instead of deprecated functions (thanks to @simongregorebner)
0.4.1
This is a small maintenance release with backported critical encoding/decoding fixes from the upcoming 1.0.0 release:
- Fixed encoding and decoding of year in date and datetime telegrams (KNX DPT 11.xxx and 19.xxx)
- Fixed encoding of weekday in datetime telegrams (KNX DPT 19.xxx)
- Fixed decoding of single character telegrams (KNX DPT 4.xxx)
0.4.0
- New method
set_group_apdu_handler()
for setting a non-asynchronous callback function for handling incoming group telegrams - New method
iterate_group_telegrams()
for asynchronously iterating incoming group telegrams as they arrive - DEPRECATING
register_telegram_handler()
in favor of the two new methods