Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .github/workflows/merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
name: Latest release

env:
CACHE_VERSION: 1
CACHE_VERSION: 2
DEFAULT_PYTHON: "3.14"

# Only run on merges
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
name: Latest commit

env:
CACHE_VERSION: 2
CACHE_VERSION: 3
DEFAULT_PYTHON: "3.14"
VENV: venv

Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## v0.47.7 - 2026-05-18

PR [443](https://github.com/plugwise/python-plugwise-usb/pull/443): Migrate to serialx

## v0.47.6 - 2026-03-11

PR [425](https://github.com/plugwise/python-plugwise-usb/pull/425): More 0138-related improvements
Expand Down
13 changes: 2 additions & 11 deletions plugwise_usb/connection/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
import logging
from typing import Any

from serial import EIGHTBITS, PARITY_NONE, STOPBITS_ONE, SerialException
from serial_asyncio_fast import SerialTransport, create_serial_connection
from serialx import SerialTransport, create_serial_connection

from ..api import StickEvent
from ..exceptions import StickError
Expand Down Expand Up @@ -132,18 +131,10 @@ async def setup_connection_to_stick(self, serial_path: str) -> None:
lambda: self._receiver,
url=serial_path,
baudrate=115200,
bytesize=EIGHTBITS,
stopbits=STOPBITS_ONE,
parity=PARITY_NONE,
xonxoff=False,
),
timeout=5,
)
except SerialException as err:
raise StickError(
f"Failed to open serial connection to {serial_path}"
) from err
except TimeoutError as err:
except (OSError, TypeError, ValueError) as err:
raise StickError(
f"Failed to open serial connection to {serial_path}"
) from err
Expand Down
2 changes: 1 addition & 1 deletion plugwise_usb/connection/receiver.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
import logging
from typing import Any, Final

from serial_asyncio_fast import SerialTransport
from serialx import SerialTransport

from ..api import StickEvent
from ..constants import MESSAGE_FOOTER, MESSAGE_HEADER
Expand Down
7 changes: 3 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,14 @@ build-backend = "setuptools.build_meta"

[project]
name = "plugwise_usb"
version = "0.47.6"
version = "0.47.7"
license = "MIT"
keywords = ["home", "automation", "plugwise", "module", "usb"]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3.14",
"Programming Language :: Python :: 3.13",
"Topic :: Home Automation",
]
authors = [
Expand All @@ -25,12 +24,12 @@ maintainers = [
{ name = "CoMPaTech" },
{ name = "dirixmjm" }
]
requires-python = ">=3.13.0"
requires-python = ">=3.14.0"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | 🏗️ Heavy lift

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Check serialx Python version requirements
pip index versions serialx 2>/dev/null || echo "Package not found on PyPI"
# If available, check the package metadata
python -m pip download --no-deps serialx 2>&1 | head -20

Repository: plugwise/python-plugwise-usb

Length of output: 541


🌐 Web query:

What is the minimum Python version required by the serialx library?

💡 Result:

The minimum Python version required by the serialx library is Python 3.10 [1]. This requirement is explicitly stated in the project's metadata on PyPI [1].

Citations:


🏁 Script executed:

#!/bin/bash
# Get the METADATA from the downloaded serialx wheel to see exact requires-python
cd /tmp && unzip -q serialx-1.8.0-py3-none-any.whl 'serialx*' 2>/dev/null || true
find . -name 'METADATA' -o -name 'WHEEL' 2>/dev/null | head -5

# Alternative: inspect wheel directly with zipinfo
cd /tmp && python3 << 'EOF'
import zipfile
import re

try:
    with zipfile.ZipFile('serialx-1.8.0-py3-none-any.whl', 'r') as z:
        for file in z.namelist():
            if 'METADATA' in file or 'WHEEL' in file:
                print(f"\n=== {file} ===")
                content = z.read(file).decode('utf-8')
                # Print only the first 100 lines or until we find requires-python
                lines = content.split('\n')
                for i, line in enumerate(lines[:100]):
                    if 'Requires-Python' in line or 'requires' in line.lower() or i < 20:
                        print(line)
except Exception as e:
    print(f"Error: {e}")
EOF

Repository: plugwise/python-plugwise-usb

Length of output: 149


🏁 Script executed:

#!/bin/bash
# Check plugwise pyproject.toml for all dependencies
cat pyproject.toml | grep -A 50 "dependencies\|requires-python"

Repository: plugwise/python-plugwise-usb

Length of output: 1433


🏁 Script executed:

#!/bin/bash
# Check the Python version requirements for the dependencies listed
# aiofiles, crcmod, semver, serialx

for package in aiofiles crcmod semver serialx; do
  echo "=== $package ==="
  pip index versions "$package" 2>/dev/null | head -1
done

# Also check if there are any Python 3.14 specific features used in the codebase
echo -e "\n=== Checking for Python 3.14 specific features ==="
rg "from __future__ import" pyproject.toml src/ 2>/dev/null || echo "No future imports found"
rg "3\.14|3\.13|3\.12|3\.11|3\.10" . --type py --max-count 10 2>/dev/null | head -20

Repository: plugwise/python-plugwise-usb

Length of output: 273


🌐 Web query:

Python version requirements for aiofiles crcmod semver packages - what is the minimum Python version supported

💡 Result:

The minimum Python version requirements for the requested packages are as follows: aiofiles: The current version (25.1.0) requires Python 3.9 or higher [1][2]. Support for older versions was dropped in previous releases (e.g., Python 3.8 support was dropped in version 25.0.0/24.1.0, and Python 3.7 support was dropped in version 24.0.0/23.2.1) [3]. crcmod: The package (version 1.7) supports both Python 2.x and 3.x series [4][5]. Specifically, it has been tested on Python 2.4–2.7 and Python 3.1 [4][6]. While it may work on other versions, these are the explicitly documented versions [5]. semver: The current major version (3.0.0 and later) requires Python 3.7 or higher [7]. The 2.x series supported Python 2.7 through 3.5, but this branch is frozen and no longer receives updates [7].

Citations:


Remove the unnecessary Python 3.14 minimum requirement.

The requires-python = ">=3.14.0" constraint is overly restrictive and not justified by the package's dependencies. The minimum Python versions for the stated dependencies are:

  • serialx 1.8.0: Python 3.10+
  • aiofiles 25.1.0: Python 3.9+
  • semver 3.0.4: Python 3.7+
  • crcmod 1.7: Python 2.7+ (no constraint)

The codebase contains no Python 3.14-specific features. Lowering the requirement to >=3.10.0 (matching serialx) would maintain compatibility with Python 3.10, 3.11, 3.12, and 3.13 users while preserving all functionality.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pyproject.toml` at line 27, Update the Python requirement in pyproject.toml
by replacing the overly strict requires-python = ">=3.14.0" with a lower,
justified minimum such as requires-python = ">=3.10.0" to match the highest
minimum dependency (serialx) and restore compatibility with 3.10–3.13; ensure
the change is made to the requires-python entry so packaging tools pick up the
new constraint.

dependencies = [
"pyserial-asyncio-fast",
"aiofiles",
"crcmod",
"semver",
"serialx",
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Check if serialx is available and get version info
pip index versions serialx 2>/dev/null | head -20

# Check the package metadata if available
curl -s https://pypi.org/pypi/serialx/json | jq -r '.info | {name, version, author, home_page, requires_python, summary}'

Repository: plugwise/python-plugwise-usb

Length of output: 546


🌐 Web query:

What is the latest stable version of the serialx Python library and what are its Python version requirements?

💡 Result:

As of May 18, 2026, the latest stable version of the serialx Python library is v1.7.3 [1]. This library requires Python 3.10 or newer [1].

Citations:


Add a version constraint to the serialx dependency.

The dependency on serialx lacks a version specifier. Since serialx 1.8.0 is the latest stable release, consider pinning to at least >=1.8.0 or >=1.7.0,<2.0.0 to prevent unexpected breaking changes from future releases.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pyproject.toml` at line 32, The pyproject.toml dependency entry for "serialx"
is missing a version constraint; update the dependency string "serialx" in
pyproject.toml to include a conservative version specifier (for example
"serialx>=1.8.0" or "serialx>=1.7.0,<2.0.0") to prevent pulling breaking changes
from future releases.

]

[project.urls]
Expand Down
2 changes: 1 addition & 1 deletion requirements_test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
pytest-asyncio
radon==6.0.1
types-python-dateutil
pyserial-asyncio-fast
aiofiles
freezegun
pytest-cov
serialx