Skip to content

Commit 6eb4498

Browse files
authored
Merge pull request #216 from plugwise/feature/arnout/python_3_13
Feature/arnout/python 3 13
2 parents a202d7d + 9479f82 commit 6eb4498

File tree

16 files changed

+95
-38
lines changed

16 files changed

+95
-38
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ name: Test against HA-core using pytest-homeassistant-custom-component
55

66
env:
77
CACHE_VERSION: 9
8-
DEFAULT_PYTHON: "3.12"
8+
DEFAULT_PYTHON: "3.13"
99

1010
on:
1111
workflow_dispatch:

.pre-commit-config.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ ci:
77

88
default_language_version:
99
# force all unspecified python hooks to run python3
10-
python: python3.12
10+
python: python3.13
1111

1212
repos:
1313
# Run manually in CI skipping the branch checks
1414
- repo: https://github.com/astral-sh/ruff-pre-commit
15-
rev: v0.7.4
15+
rev: v0.9.5
1616
hooks:
1717
- id: ruff
1818
name: "Ruff-ing code"
@@ -28,13 +28,13 @@ repos:
2828
args:
2929
- --branch=main
3030
- repo: https://github.com/asottile/pyupgrade
31-
rev: v3.19.0
31+
rev: v3.19.1
3232
hooks:
3333
- id: pyupgrade
3434
name: "Checking pyupgrade"
3535
args: [--py39-plus]
3636
- repo: https://github.com/codespell-project/codespell
37-
rev: v2.3.0
37+
rev: v2.4.1
3838
hooks:
3939
- id: codespell
4040
name: "Verifying/updating code for spelling issues"
@@ -44,7 +44,7 @@ repos:
4444
- --quiet-level=2
4545
exclude_types: [csv, json]
4646
- repo: https://github.com/PyCQA/bandit
47-
rev: 1.7.10
47+
rev: 1.8.2
4848
hooks:
4949
- id: bandit
5050
name: "Linting with bandit"
@@ -86,7 +86,7 @@ repos:
8686
language: script
8787
pass_filenames: false
8888
- repo: https://github.com/igorshubovych/markdownlint-cli
89-
rev: v0.42.0
89+
rev: v0.44.0
9090
hooks:
9191
- id: markdownlint
9292
name: "Linting Markdown"

pyproject.toml

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name = "plugwise_usb-beta"
33
version = "0.40.8b1"
44
description = "Plugwise USB custom_component (BETA)"
55
readme = "README.md"
6-
requires-python = ">=3.12"
6+
requires-python = ">=3.13"
77
license = {file = "LICENSE"}
88
keywords = ["Plugwise", "Switch", "Circle", "Plus"]
99
authors = [
@@ -28,7 +28,7 @@ dependencies = ["homeassistant", "plugwise-usb"]
2828
"Bug Reports" = "https://github.com/plugwise/plugwise_usb-beta/issues"
2929

3030
[tool.black]
31-
target-version = ["py312"]
31+
target-version = ["py313"]
3232
exclude = 'generated'
3333

3434
[tool.pylint.MASTER]
@@ -135,7 +135,7 @@ overgeneral-exceptions = [
135135
]
136136

137137
[tool.ruff]
138-
target-version = "py312"
138+
target-version = "py313"
139139

140140
lint.select = [
141141
"B007", # Loop control variable {name} not used within loop body
@@ -216,13 +216,9 @@ combine-as-imports = true
216216
[tool.ruff.lint.mccabe]
217217
max-complexity = 25
218218

219-
[tool.pytest]
220-
addopts = [
221-
"--cov=custom_components"
222-
]
223-
asyncio_default_fixture_loop_scope = "session"
224-
225219
[tool.pytest.ini_options]
220+
addopts = "--cov=plugwise_usb"
221+
asyncio_default_fixture_loop_scope = "function"
226222
pythonpath = "src"
227223
testpaths = "tests"
228224
norecursedirs = ".git"

requirements_test.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@ pytest
22
pytest-cov
33
pytest-asyncio
44
pytest-homeassistant-custom-component
5+
aiousbwatcher
56
# From our manifest.json for our custom component
6-
plugwise_usb @ https://test-files.pythonhosted.org/packages/90/5f/9cdaa7c322da4987c3820b54eacebad2911b6e7a06550c56b7921944ee90/plugwise_usb-0.40.0a21.tar.gz#plugwise-usb==0.40.0a21
7+
plugwise_usb @ https://test-files.pythonhosted.org/packages/d0/05/f52b59d222cd857284b00aa77e237ffdd25acc8955b5ebc2ff411822448b/plugwise_usb-0.40.0a27.tar.gz#plugwise-usb==0.40.0a27

scripts/python-venv.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env bash
22
set -eu
33

4-
pyversions=(3.12)
4+
pyversions=(3.13)
55
my_path=$(git rev-parse --show-toplevel)
66
my_venv=${my_path}/.venv
77

src/custom_components/plugwise_usb/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
"""Support for Plugwise devices connected to a Plugwise USB-stick."""
22

3-
43
import logging
54
from typing import Any, TypedDict
65

src/custom_components/plugwise_usb/config_flow.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@
88
import voluptuous as vol
99

1010
from homeassistant.components import usb
11-
from homeassistant.config_entries import ConfigFlow
11+
from homeassistant.config_entries import SOURCE_USER, ConfigFlow
1212
from homeassistant.const import CONF_BASE
1313
from homeassistant.core import callback
1414
from homeassistant.data_entry_flow import FlowResult
1515
from plugwise_usb import Stick
1616
from plugwise_usb.exceptions import StickError
1717

18-
from .const import CONF_MANUAL_PATH, CONF_USB_PATH, DOMAIN
18+
from .const import CONF_MANUAL_PATH, CONF_USB_PATH, DOMAIN, MANUAL_PATH
1919

2020

2121
@callback
@@ -94,6 +94,7 @@ async def async_step_user(
9494
title="Stick", data={CONF_USB_PATH: device_path}
9595
)
9696
return self.async_show_form(
97+
step_id=SOURCE_USER,
9798
data_schema=vol.Schema(
9899
{vol.Required(CONF_USB_PATH): vol.In(list_of_ports)}
99100
),
@@ -116,6 +117,7 @@ async def async_step_manual_path(
116117
title="Stick", data={CONF_USB_PATH: device_path}
117118
)
118119
return self.async_show_form(
120+
step_id=MANUAL_PATH,
119121
data_schema=vol.Schema(
120122
{vol.Required(CONF_USB_PATH, default="/dev/ttyUSB0"): str}
121123
),

src/custom_components/plugwise_usb/const.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
UNSUB_NODE_LOADED: Final = "Unsubcribe_from_node_loaded_event"
1515
COORDINATOR: Final = "coordinator"
1616
CONF_MANUAL_PATH: Final = "Enter Manually"
17+
MANUAL_PATH: Final = "manual_path"
1718
STICK: Final = "stick"
1819
NODES: Final = "nodes"
1920
USB: Final = "usb"

src/custom_components/plugwise_usb/entity.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,7 @@ def __init__(
4646
"model_id": self._node_info.model_type,
4747
"sw_version": f"{self._node_info.firmware}",
4848
}
49-
self._attr_unique_id = f"{
50-
self._node_info.mac}-{entity_description.key}"
49+
self._attr_unique_id = f"{self._node_info.mac}-{entity_description.key}"
5150
self.entity_description = entity_description
5251
self._subscribe_to_feature_fn = node_duc.node.subscribe_to_feature_update
5352
self.unsubscribe_push_events: Callable[[], None] | None = None

src/custom_components/plugwise_usb/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"iot_class": "local_polling",
1010
"loggers": ["plugwise_usb"],
1111
"requirements": [
12-
"https://test-files.pythonhosted.org/packages/90/5f/9cdaa7c322da4987c3820b54eacebad2911b6e7a06550c56b7921944ee90/plugwise_usb-0.40.0a21.tar.gz#plugwise-usb==0.40.0a21"
12+
"https://test-files.pythonhosted.org/packages/d0/05/f52b59d222cd857284b00aa77e237ffdd25acc8955b5ebc2ff411822448b/plugwise_usb-0.40.0a27.tar.gz#plugwise-usb==0.40.0a27"
1313
],
1414
"version": "0.50.0a11"
1515
}

0 commit comments

Comments
 (0)