diff --git a/commhandler/CHANGELOG.md b/commhandler/CHANGELOG.md index d8de98f..d5c2feb 100644 --- a/commhandler/CHANGELOG.md +++ b/commhandler/CHANGELOG.md @@ -5,6 +5,18 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.5.1] - 2025-12-17 + +## Changed + +- updated minimal dependency versions, maintain Python 3.9 compatibility + +### Fixed + +- include `pyserial` in required dependencies, fixes error when serial device is created +- configure Modbus byte/word order according to SGr specification + + ## [0.5.0] - 2025-10-27 ### Added diff --git a/commhandler/pyproject.toml b/commhandler/pyproject.toml index adfe53e..982c52c 100644 --- a/commhandler/pyproject.toml +++ b/commhandler/pyproject.toml @@ -17,17 +17,17 @@ maintainers = [ { name = "Matthias Krebs" } ] dependencies = [ - "Jinja2>=3.1.0,<4.0.0", - "jmespath>=1.0.0,<2.0.0", + "Jinja2>=3.1.6,<4.0.0", + "jmespath>=1.0.1,<2.0.0", "jsonata-python>=0.6.0,<1.0.0", "parsel>=1.10.0,<1.11.0", - "pymodbus>=3.7.0,<3.8.0", + "pymodbus[serial]>=3.7.4,<3.8.0", "gmqtt>=0.7.0,<1.0.0", - "xsdata>=25.0.0,<26.0.0", - "xmlschema>=4.1.0,<5.0.0", - "aiohttp>=3.12.0,<4.0.0", - "certifi", - "cachetools>=6.2.0,<7.0.0", + "xsdata>=25.7.0,<26.0.0", + "xmlschema>=4.2.0,<5.0.0", + "aiohttp>=3.13.2,<4.0.0", + "certifi>=25.11.12", + "cachetools>=6.2.4,<7.0.0", "sgr-specification>=2.2.0,<3.0.0" ] diff --git a/commhandler/requirements-dev.txt b/commhandler/requirements-dev.txt index 74785c0..7cc448e 100644 --- a/commhandler/requirements-dev.txt +++ b/commhandler/requirements-dev.txt @@ -1,2 +1,2 @@ -pytest>=8.4.0,<9.0.0 -pytest-asyncio>=1.0.0,<2.0.0 +pytest>=8.4.2,<9.0.0 +pytest-asyncio>=1.1.1,<1.2.0 diff --git a/commhandler/requirements-doc.txt b/commhandler/requirements-doc.txt index b925000..81cd4c3 100644 --- a/commhandler/requirements-doc.txt +++ b/commhandler/requirements-doc.txt @@ -1,3 +1,3 @@ -sphinx>=7.4.0,<8.0.0 -sphinx-autoapi>=3.6.0,<4.0.0 -sphinx-rtd-theme>=3.0.0,<4.0.0 +sphinx>=7.4.7,<8.0.0 +sphinx-autoapi>=3.6.1,<4.0.0 +sphinx-rtd-theme>=3.0.2,<4.0.0 diff --git a/commhandler/requirements.txt b/commhandler/requirements.txt index f26bc79..9d84aa5 100644 --- a/commhandler/requirements.txt +++ b/commhandler/requirements.txt @@ -1,12 +1,12 @@ -Jinja2>=3.1.0,<4.0.0 -jmespath>=1.0.0,<2.0.0 +Jinja2>=3.1.6,<4.0.0 +jmespath>=1.0.1,<2.0.0 jsonata-python>=0.6.0,<1.0.0 parsel>=1.10.0,<1.11.0 -pymodbus>=3.7.0,<3.8.0 +pymodbus[serial]>=3.7.4,<3.8.0 gmqtt>=0.7.0,<1.0.0 -xsdata>=25.0.0,<26.0.0 -xmlschema>=4.1.0,<5.0.0 -aiohttp>=3.12.0,<4.0.0 -certifi -cachetools>=6.2.0,<7.0.0 +xsdata>=25.7.0,<26.0.0 +xmlschema>=4.2.0,<5.0.0 +aiohttp>=3.13.2,<4.0.0 +certifi>=25.11.12 +cachetools>=6.2.4,<7.0.0 sgr-specification>=2.2.0,<3.0.0 diff --git a/commhandler/src/sgr_commhandler/driver/modbus/modbus_client_async.py b/commhandler/src/sgr_commhandler/driver/modbus/modbus_client_async.py index 622c5af..5cb6412 100644 --- a/commhandler/src/sgr_commhandler/driver/modbus/modbus_client_async.py +++ b/commhandler/src/sgr_commhandler/driver/modbus/modbus_client_async.py @@ -30,9 +30,10 @@ def __init__(self, endianness: BitOrder, addr_offset: int, client: ModbusBaseCli self._lock = threading.Lock() self._client: ModbusBaseClient = client self._byte_order: Endian = ( - Endian.BIG - if endianness is None or endianness == BitOrder.BIG_ENDIAN - else Endian.LITTLE + Endian.LITTLE + if endianness + in {BitOrder.CHANGE_BYTE_ORDER, BitOrder.CHANGE_BIT_ORDER} + else Endian.BIG ) self._word_order: Endian = ( Endian.LITTLE @@ -261,10 +262,10 @@ def __init__(self, ip: str, port: int, endianness: BitOrder = BitOrder.BIG_ENDIA AsyncModbusTcpClient( host=ip, port=port, - timeout=1, + timeout=1.0, retries=0, - reconnect_delay=5000, - reconnect_delay_max=30000 + reconnect_delay=1.0, + reconnect_delay_max=30.0 ) ) """ diff --git a/specification/requirements-dev.txt b/specification/requirements-dev.txt index 2e3e6c0..e5c5bdd 100644 --- a/specification/requirements-dev.txt +++ b/specification/requirements-dev.txt @@ -1 +1 @@ -xsdata[cli]>=25.0.0,<26.0.0 +xsdata[cli]>=25.7.0,<26.0.0