From 08957a0a1b56329801c7b033e8f8153209673068 Mon Sep 17 00:00:00 2001 From: Elad Bar Date: Fri, 29 Dec 2023 13:43:19 +0200 Subject: [PATCH] Adjust code to HA 2024.1.0 --- .pre-commit-config.yaml | 31 ++++++++++--------- CHANGELOG.md | 7 +++++ bandit.yaml | 1 - .../edgeos/core/models/vacuum_description.py | 2 +- custom_components/edgeos/manifest.json | 2 +- hacs.json | 2 +- 6 files changed, 26 insertions(+), 19 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 100fe88..9efca2f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,18 +1,18 @@ repos: - repo: https://github.com/asottile/pyupgrade - rev: v3.3.1 + rev: v3.15.0 hooks: - id: pyupgrade args: [--py39-plus] - repo: https://github.com/psf/black - rev: 23.1.0 + rev: 23.12.1 hooks: - id: black args: - --quiet files: ^((custom_components)/.+)?[^/]+\.py$ - repo: https://github.com/codespell-project/codespell - rev: v2.2.2 + rev: v2.2.6 hooks: - id: codespell args: @@ -21,27 +21,27 @@ repos: - --quiet-level=2 exclude_types: [csv, json] - repo: https://github.com/PyCQA/autoflake - rev: v2.0.1 + rev: v2.2.1 hooks: - id: autoflake args: - --in-place - --remove-all-unused-imports - repo: https://github.com/PyCQA/flake8 - rev: 6.0.0 + rev: 6.1.0 hooks: - id: flake8 additional_dependencies: - - pycodestyle==2.10.0 - - pyflakes==3.0.1 + - pycodestyle>=2.10.0 + - pyflakes>=3.0.1 # - flake8-docstrings==1.6.0 # - pydocstyle==6.2.3 - - flake8-comprehensions==3.10.1 - - flake8-noqa==1.3.0 - - mccabe==0.7.0 + - flake8-comprehensions>=3.10.1 + - flake8-noqa>=1.3.0 + - mccabe>=0.7.0 files: ^(custom_components)/.+\.py$ - repo: https://github.com/PyCQA/bandit - rev: 1.7.4 + rev: 1.7.6 hooks: - id: bandit args: @@ -50,11 +50,11 @@ repos: - --configfile=bandit.yaml files: ^(custom_components)/.+\.py$ - repo: https://github.com/PyCQA/isort - rev: 5.12.0 + rev: 5.13.2 hooks: - id: isort - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.4.0 + rev: v4.5.0 hooks: - id: check-json exclude: (.vscode|.devcontainer) @@ -63,10 +63,11 @@ repos: - id: trailing-whitespace - id: check-added-large-files - repo: https://github.com/adrienverge/yamllint.git - rev: v1.28.0 + rev: v1.33.0 hooks: - id: yamllint + exclude: (.yamllint) - repo: https://github.com/pre-commit/mirrors-prettier - rev: v3.0.0-alpha.4 + rev: v3.0.3 hooks: - id: prettier diff --git a/CHANGELOG.md b/CHANGELOG.md index 9613287..2531d2e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## 2.0.29 + +_Minimum HA Version: 2024.1.0_ + +- Adjust code to HA 2024.1.0 +- Update pre-commit packages + ## 2.0.28 - Fix 'TOTAL_INCREASING' for rate sensors by [@Dude4Linux](https://github.com/Dude4Linux) diff --git a/bandit.yaml b/bandit.yaml index 568f77d..46566cc 100644 --- a/bandit.yaml +++ b/bandit.yaml @@ -13,7 +13,6 @@ tests: - B318 - B319 - B320 - - B325 - B601 - B602 - B604 diff --git a/custom_components/edgeos/core/models/vacuum_description.py b/custom_components/edgeos/core/models/vacuum_description.py index 679eb47..fac7e2d 100644 --- a/custom_components/edgeos/core/models/vacuum_description.py +++ b/custom_components/edgeos/core/models/vacuum_description.py @@ -3,7 +3,7 @@ from homeassistant.components.vacuum import StateVacuumEntityDescription -@dataclass +@dataclass(frozen=True, kw_only=True) class VacuumDescription(StateVacuumEntityDescription): """A class that describes vacuum entities.""" diff --git a/custom_components/edgeos/manifest.json b/custom_components/edgeos/manifest.json index 3932e73..1b736d2 100644 --- a/custom_components/edgeos/manifest.json +++ b/custom_components/edgeos/manifest.json @@ -8,5 +8,5 @@ "iot_class": "local_polling", "issue_tracker": "https://github.com/elad-bar/ha-edgeos/issues", "requirements": ["aiohttp"], - "version": "2.0.28" + "version": "2.0.29" } diff --git a/hacs.json b/hacs.json index 597afe6..983f754 100644 --- a/hacs.json +++ b/hacs.json @@ -1,5 +1,5 @@ { "name": "EdgeOS (Ubiquiti)", "iot_class": "Local Polling", - "homeassistant": "2022.11.0" + "homeassistant": "2024.1.0" }