Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
54eeece
Link to plugwise_usb v0.47.7
bouwew May 18, 2026
bfd59a9
Update CHANGELOG
bouwew May 18, 2026
a01661a
Try fix testcase
bouwew May 18, 2026
a29c00f
Debug
bouwew May 19, 2026
2904f9f
Try 2
bouwew May 19, 2026
6d1c5fc
Debug 2
bouwew May 19, 2026
1bec01e
Try 3
bouwew May 19, 2026
1c38cbe
Update port function
bouwew Sep 2, 2026
b5f8b70
Implement updates by Copilot
bouwew Sep 3, 2026
66e7bfb
Clean up
bouwew Sep 3, 2026
c05c8a7
Import MockFixture
bouwew Sep 3, 2026
d3a27fc
Define MockFixture type
bouwew Sep 3, 2026
0afbd15
Ruffed
bouwew Sep 3, 2026
fbc44e8
Remove test-logging
bouwew Sep 3, 2026
20cd9ad
Link to plugwise v0.47.8
bouwew Sep 3, 2026
124da0f
Update CHANGELOG
bouwew Sep 3, 2026
06408bf
Fix test-code by Copilot
bouwew Sep 3, 2026
703c983
Set to v0.59.3a0 test-version
bouwew Sep 3, 2026
0e11053
Fix via_device_id compatibility
bouwew Sep 3, 2026
8704d56
Clean up comments
bouwew Sep 3, 2026
00ff805
Bump to a1
bouwew Sep 3, 2026
2064a43
Bump versions
bouwew Sep 3, 2026
6d6289c
Update CACHE_VERSION
bouwew Sep 3, 2026
a9f6d4d
Pin one more action
bouwew Sep 3, 2026
22d5033
Update ci-core-testing script
bouwew Sep 3, 2026
905f448
Correct to prek-home
bouwew Sep 3, 2026
25c550b
Improve test.yaml
bouwew Sep 3, 2026
dc020db
Bump CACHE_VERSION
bouwew Sep 3, 2026
8806030
Fix script name
bouwew Sep 3, 2026
155e6fa
Fix codefactor error
bouwew Sep 3, 2026
ac6b9b8
Update test.yaml
bouwew Sep 4, 2026
8c2f0f7
Bump cache
CoMPaTech Sep 4, 2026
d0a34fd
Squash uv alert
CoMPaTech Sep 4, 2026
313a552
Squash uv alerts and wget issue
CoMPaTech Sep 4, 2026
aa2b858
Curl to wget
CoMPaTech Sep 4, 2026
d7db9fa
Merge branch 'main' into serialx
CoMPaTech Sep 4, 2026
1c9b44e
Bump action
CoMPaTech Sep 4, 2026
8e500ae
Attempt to fix shared action
CoMPaTech Sep 4, 2026
7f0b975
Revert --no-build
bouwew Sep 5, 2026
f0e8043
Correct to requirements_test.txt
bouwew Sep 5, 2026
5fcdf1a
Create plugwise_usb dir under tests, adapt test-script
bouwew Sep 5, 2026
fcefdfc
Revert patch changes
bouwew Sep 5, 2026
6bb31c5
Use tests.common
bouwew Sep 5, 2026
e8292f2
Adapt missed line
bouwew Sep 5, 2026
578f575
Clean up
bouwew Sep 5, 2026
2f09c8b
Fix path in ruff.toml
bouwew Sep 5, 2026
1af335c
Ruffed
bouwew Sep 5, 2026
cbe5a3d
Move config files to top-dir
bouwew Sep 5, 2026
8c0219f
Implement suggested improvements
bouwew Sep 5, 2026
399c9c6
Fix typo
bouwew Sep 5, 2026
d66fef5
Delete saved .js file
bouwew Sep 5, 2026
b0f5671
Remove validation of prettierrc changes
bouwew Sep 5, 2026
2a6ecbc
Update CHANGELOG
bouwew Sep 5, 2026
9a840ea
Set to v0.59.3 release-version
bouwew Sep 5, 2026
26ab8f4
Implement suggested improvements
bouwew Sep 5, 2026
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
4 changes: 2 additions & 2 deletions .github/workflows/hassfest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ jobs:
hassfest_custom:
runs-on: "ubuntu-latest"
steps:
- uses: "actions/checkout@v6.0.2"
- uses: home-assistant/actions/hassfest@master
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
- uses: home-assistant/actions/hassfest@f4ca6f671bd429efb108c0f2fa0ae8af0215986c
23 changes: 11 additions & 12 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
name: Test against HA-core

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

Expand Down Expand Up @@ -34,15 +34,15 @@ jobs:
python-version: ${{ steps.python.outputs.python-version }}
steps:
- name: Check out committed code
uses: actions/checkout@v6
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
Comment thread
github-advanced-security[bot] marked this conversation as resolved.
Fixed
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
id: python
uses: actions/setup-python@v6
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97
with:
python-version: ${{ env.DEFAULT_PYTHON }}
- name: Fetch HA pyproject
id: core-version
run: wget -O ha_pyproject.toml "https://raw.githubusercontent.com/home-assistant/core/refs/heads/dev/pyproject.toml"
run: curl --fail --location --proto '=https' -o ha_pyproject.toml "https://raw.githubusercontent.com/home-assistant/core/refs/heads/dev/pyproject.toml"
- name: Compute cache key
id: set-key
run: echo "cache-key=${{ runner.os }}--${{ env.CACHE_VERSION }}-${{ hashFiles('pyproject.toml', 'requirements_test.txt', '.pre-commit-config.yaml', 'ha_pyproject.toml') }}" >> "$GITHUB_OUTPUT"
Expand All @@ -55,15 +55,14 @@ jobs:
steps:
- name: Prepare code checkout and python/prek/pre-commit setup
id: cache-reuse
uses: plugwise/gh-actions/prepare-python-and-code@v2
uses: plugwise/gh-actions/prepare-python-and-code@6b33ca47b5b47b3324e081221da2baa499905914
with:
cache-key: ${{ needs.cache.outputs.cache-key }}
fail-on-miss: false # First time create cache (if not already exists)
python-version: ${{ needs.cache.outputs.python-version }}
venv-dir: ${{ env.VENV }}
clone-core: "true"

# Prepare default python version environment
ha-core-release:
runs-on: ubuntu-latest
name: Setup for HA-core (release/master)
Expand All @@ -72,15 +71,15 @@ jobs:
- prepare
steps:
- name: Check out committed code
uses: actions/checkout@v6
- name: Restore cached environment
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
- name: Prepare code checkout and python/prek/pre-commit setup
id: cache-reuse
uses: plugwise/gh-actions/restore-venv@v2
uses: plugwise/gh-actions/prepare-python-and-code@6b33ca47b5b47b3324e081221da2baa499905914
with:
cache-key: ${{ needs.cache.outputs.cache-key }}
fail-on-miss: false # First time create cache (if not already exists)
python-version: ${{ needs.cache.outputs.python-version }}
venv-dir: ${{ env.VENV }}
precommit-home: ${{ env.PRE_COMMIT_HOME }}
- name: Test through HA-core (master/release)
id: ha_core_release_tests
run: |
Expand All @@ -94,6 +93,6 @@ jobs:
name: Shellcheck
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6.0.2
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
- name: Run ShellCheck
uses: ludeeus/action-shellcheck@master
uses: ludeeus/action-shellcheck@00cae500b08a931fb5698e11e79bfbd38e612a38
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ default_language_version:
repos:
# Run manually in CI skipping the branch checks
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.15.14
rev: v0.16.6
hooks:
- id: ruff
name: "Ruff-ing code"
Expand All @@ -27,7 +27,7 @@ repos:
name: "Checking pyupgrade"
args: [--py39-plus]
- repo: https://github.com/codespell-project/codespell
rev: v2.4.2
rev: v2.4.3
hooks:
- id: codespell
name: "Verifying/updating code for spelling issues"
Expand All @@ -52,7 +52,7 @@ repos:
- id: yamllint
name: "Linting yaml"
- repo: https://github.com/biomejs/pre-commit
rev: v2.4.15
rev: v2.5.12
hooks:
- id: biome-lint
additional_dependencies: ["@biomejs/biome@2.0.4"]
Expand All @@ -79,7 +79,7 @@ repos:
language: script
pass_filenames: false
- repo: https://github.com/jackdewinter/pymarkdown
rev: v0.9.37
rev: v0.9.39
hooks:
- id: pymarkdown
name: "MarkDown Lint"
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# Changelog

## Ongoing
## v0.59.3

- General environment and code updates, improve (test)files structure
- Bump python to 3.14
- Link to plugwise_usb [v0.47.8](https://github.com/plugwise/python-plugwise-usb/releases/tag/v0.47.8), rework to using the HA USB platform

## v0.59.2

Expand Down
2 changes: 0 additions & 2 deletions custom_components/plugwise_usb/binary_sensor.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
"""Plugwise USB Binary Sensor component for Home Assistant."""

from __future__ import annotations

from dataclasses import dataclass
from datetime import timedelta
import logging
Expand Down
2 changes: 0 additions & 2 deletions custom_components/plugwise_usb/button.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
"""Plugwise USB Button component for HomeAssistant."""

from __future__ import annotations

from dataclasses import dataclass
from datetime import timedelta
import logging
Expand Down
19 changes: 9 additions & 10 deletions custom_components/plugwise_usb/config_flow.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
"""Config flow for Plugwise USB integration."""

from __future__ import annotations

from typing import Any

from plugwise_usb import Stick
Expand All @@ -13,7 +11,6 @@
from homeassistant.const import CONF_BASE
from homeassistant.core import callback
from homeassistant.data_entry_flow import FlowResult
import serial.tools.list_ports

from .const import CONF_MANUAL_PATH, CONF_USB_PATH, DOMAIN, MANUAL_PATH

Expand Down Expand Up @@ -72,11 +69,15 @@ async def async_step_user(
) -> FlowResult:
"""Step when user initializes a integration."""
errors: dict[str, str] = {}
ports = await self.hass.async_add_executor_job(serial.tools.list_ports.comports)
ports = [
port
for port in await usb.async_scan_serial_ports(self.hass)
if isinstance(port, usb.USBDevice)
]
list_of_ports = [
f"{p}, s/n: {p.serial_number or 'n/a'}"
+ (f" - {p.manufacturer}" if p.manufacturer else "")
for p in ports
f"{port.device}, s/n: {port.serial_number or 'n/a'}"
+ (f" - {port.manufacturer}" if port.manufacturer else "")
for port in ports
]
list_of_ports.append(CONF_MANUAL_PATH)

Expand All @@ -87,9 +88,7 @@ async def async_step_user(
return await self.async_step_manual_path()

port = ports[list_of_ports.index(user_selection)]
device_path = await self.hass.async_add_executor_job(
usb.get_serial_by_id, port.device
)
device_path = port.device
errors, mac_stick = await validate_usb_connection(self.hass, device_path)
if not errors:
await self.async_set_unique_id(
Expand Down
1 change: 1 addition & 0 deletions custom_components/plugwise_usb/coordinator.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ def __init__(
super().__init__(
hass,
_LOGGER,
config_entry=config_entry,
name=node.node_info.name,
update_interval=timedelta(seconds=15),
update_method=self.async_node_update,
Expand Down
16 changes: 11 additions & 5 deletions custom_components/plugwise_usb/entity.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
"""Plugwise USB stick base entity."""

from __future__ import annotations

from dataclasses import dataclass
import logging

from plugwise_usb.api import NodeFeature, NodeInfo

from homeassistant.helpers.device_registry import CONNECTION_ZIGBEE, DeviceInfo
from homeassistant.helpers.device_registry import (
CONNECTION_ZIGBEE,
DeviceInfo,
async_get_device_id_by_identifier,
)
from homeassistant.helpers.entity import EntityDescription
from homeassistant.helpers.update_coordinator import CoordinatorEntity

Expand Down Expand Up @@ -38,9 +40,9 @@ def __init__(
super().__init__(node_duc, context=entity_description.node_feature)
self.node_duc = node_duc
self.entity_description = entity_description
self.entry = node_duc.config_entry
Comment thread
coderabbitai[bot] marked this conversation as resolved.
self._node_info: NodeInfo = node_duc.node.node_info
self._attr_unique_id = f"{self._node_info.mac}-{entity_description.key}"
self._via_device = (DOMAIN, str(node_duc.api_stick.mac_stick))

@property
def available(self) -> bool:
Expand All @@ -61,7 +63,11 @@ def device_info(self) -> DeviceInfo:
model_id=self._node_info.model_type,
name=str(self._node_info.name),
sw_version=str(self._node_info.firmware),
via_device=self._via_device,
via_device_id=async_get_device_id_by_identifier(
self.node_duc.hass,
(DOMAIN, str(self.node_duc.api_stick.mac_stick)),
config_entry_id=self.entry.entry_id,
),
)

async def async_added_to_hass(self):
Expand Down
2 changes: 0 additions & 2 deletions custom_components/plugwise_usb/event.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
"""Plugwise USB Event component for HomeAssistant."""

from __future__ import annotations

from dataclasses import dataclass
from datetime import timedelta
import logging
Expand Down
4 changes: 2 additions & 2 deletions custom_components/plugwise_usb/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
"iot_class": "local_polling",
"issue_tracker": "https://github.com/plugwise/python-plugwise-usb/issues",
"loggers": ["plugwise_usb"],
"requirements": ["plugwise-usb==0.47.6"],
"version": "0.59.2"
"requirements": ["plugwise-usb==0.47.8"],
"version": "0.59.3"
}
2 changes: 0 additions & 2 deletions custom_components/plugwise_usb/number.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
"""Plugwise USB Number component for HomeAssistant."""

from __future__ import annotations

from dataclasses import dataclass
from datetime import timedelta
import logging
Expand Down
2 changes: 0 additions & 2 deletions custom_components/plugwise_usb/select.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
"""Plugwise USB Select component for HomeAssistant."""

from __future__ import annotations

from dataclasses import dataclass
from datetime import timedelta
from enum import Enum
Expand Down
2 changes: 0 additions & 2 deletions custom_components/plugwise_usb/sensor.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
"""Plugwise USB Sensor component for Home Assistant."""

from __future__ import annotations

from dataclasses import dataclass
from datetime import timedelta
import logging
Expand Down
2 changes: 0 additions & 2 deletions custom_components/plugwise_usb/switch.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
"""Plugwise USB Switch component for HomeAssistant."""

from __future__ import annotations

from dataclasses import dataclass
from datetime import timedelta
import logging
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "plugwise_usb-beta"
version = "0.59.2"
version = "0.59.3"
description = "Plugwise USB custom_component (BETA)"
readme = "README.md"
requires-python = ">=3.14"
Expand Down
Loading
Loading