From 30c6fd12f6d072aad792a351f30d1f5d162002ff Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 12 Feb 2024 22:19:22 +0000 Subject: [PATCH 1/2] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/psf/black: 23.11.0 → 24.2.0](https://github.com/psf/black/compare/23.11.0...24.2.0) - [github.com/PyCQA/flake8: 6.1.0 → 7.0.0](https://github.com/PyCQA/flake8/compare/6.1.0...7.0.0) - [github.com/PyCQA/bandit: 1.7.5 → 1.7.7](https://github.com/PyCQA/bandit/compare/1.7.5...1.7.7) - [github.com/PyCQA/isort: 5.12.0 → 5.13.2](https://github.com/PyCQA/isort/compare/5.12.0...5.13.2) - [github.com/pre-commit/mirrors-prettier: v3.1.0 → v4.0.0-alpha.8](https://github.com/pre-commit/mirrors-prettier/compare/v3.1.0...v4.0.0-alpha.8) - [github.com/adrienverge/yamllint.git: v1.33.0 → v1.34.0](https://github.com/adrienverge/yamllint.git/compare/v1.33.0...v1.34.0) - [github.com/python-jsonschema/check-jsonschema: 0.27.2 → 0.28.0](https://github.com/python-jsonschema/check-jsonschema/compare/0.27.2...0.28.0) --- .pre-commit-config.yaml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 05b3cb5..840ec6b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -13,7 +13,7 @@ repos: - id: pyupgrade args: [--py311-plus] - repo: https://github.com/psf/black - rev: 23.11.0 + rev: 24.2.0 hooks: - id: black args: @@ -30,7 +30,7 @@ repos: - --quiet-level=2 exclude_types: [csv, json] - repo: https://github.com/PyCQA/flake8 - rev: 6.1.0 + rev: 7.0.0 hooks: - id: flake8 additional_dependencies: @@ -39,7 +39,7 @@ repos: <<: &python-files files: ^(custom_components/.+)?[^/]+\.py$ - repo: https://github.com/PyCQA/bandit - rev: 1.7.5 + rev: 1.7.7 hooks: - id: bandit args: @@ -48,7 +48,7 @@ repos: - --configfile=bandit.yaml <<: *python-files-with-tests - 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 @@ -73,7 +73,7 @@ repos: - --top-keys=domain,name files: manifest\.json$ - repo: https://github.com/pre-commit/mirrors-prettier - rev: v3.1.0 + rev: v4.0.0-alpha.8 hooks: - id: prettier additional_dependencies: @@ -83,7 +83,7 @@ repos: - python exclude: manifest\.json$ - repo: https://github.com/adrienverge/yamllint.git - rev: v1.33.0 + rev: v1.34.0 hooks: - id: yamllint - repo: local @@ -111,7 +111,7 @@ repos: - id: check-pre-commit-ci-config - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.27.2 + rev: 0.28.0 hooks: - id: check-github-workflows - id: check-dependabot From aa212889f6fd5b98c1bb2463a76d2e12aac8dfa0 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 12 Feb 2024 22:19:40 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- custom_components/deebot/__init__.py | 1 + custom_components/deebot/binary_sensor.py | 1 + custom_components/deebot/button.py | 1 + custom_components/deebot/config_flow.py | 1 + custom_components/deebot/const.py | 1 + custom_components/deebot/controller.py | 1 + custom_components/deebot/diagnostics.py | 1 + custom_components/deebot/entity.py | 1 + custom_components/deebot/image.py | 1 + custom_components/deebot/number.py | 1 + custom_components/deebot/select.py | 1 + custom_components/deebot/sensor.py | 7 ++++--- custom_components/deebot/switch.py | 1 + custom_components/deebot/util.py | 1 + custom_components/deebot/vacuum.py | 1 + tests/conftest.py | 6 ++++-- 16 files changed, 22 insertions(+), 5 deletions(-) diff --git a/custom_components/deebot/__init__.py b/custom_components/deebot/__init__.py index bb12946..7a114f9 100644 --- a/custom_components/deebot/__init__.py +++ b/custom_components/deebot/__init__.py @@ -1,4 +1,5 @@ """Support for Deebot Vacuums.""" + import asyncio import logging from typing import Any diff --git a/custom_components/deebot/binary_sensor.py b/custom_components/deebot/binary_sensor.py index 7979f97..b7d5200 100644 --- a/custom_components/deebot/binary_sensor.py +++ b/custom_components/deebot/binary_sensor.py @@ -1,4 +1,5 @@ """Binary sensor module.""" + from collections.abc import Callable from dataclasses import dataclass from typing import Generic diff --git a/custom_components/deebot/button.py b/custom_components/deebot/button.py index c47e70c..fe24b7e 100644 --- a/custom_components/deebot/button.py +++ b/custom_components/deebot/button.py @@ -1,4 +1,5 @@ """Binary sensor module.""" + from collections.abc import Sequence from dataclasses import dataclass diff --git a/custom_components/deebot/config_flow.py b/custom_components/deebot/config_flow.py index 12981d2..841d7cf 100644 --- a/custom_components/deebot/config_flow.py +++ b/custom_components/deebot/config_flow.py @@ -1,4 +1,5 @@ """Config flow for Deebot integration.""" + import logging import random import string diff --git a/custom_components/deebot/const.py b/custom_components/deebot/const.py index d5504cd..b574c11 100644 --- a/custom_components/deebot/const.py +++ b/custom_components/deebot/const.py @@ -1,4 +1,5 @@ """Const module.""" + from collections.abc import Mapping from deebot_client.events import ( diff --git a/custom_components/deebot/controller.py b/custom_components/deebot/controller.py index c067d1d..f869c99 100644 --- a/custom_components/deebot/controller.py +++ b/custom_components/deebot/controller.py @@ -1,4 +1,5 @@ """Controller module.""" + import logging import random import string diff --git a/custom_components/deebot/diagnostics.py b/custom_components/deebot/diagnostics.py index 53ab23b..b28b216 100644 --- a/custom_components/deebot/diagnostics.py +++ b/custom_components/deebot/diagnostics.py @@ -1,4 +1,5 @@ """Diagnostics support for deebot.""" + from __future__ import annotations from typing import Any diff --git a/custom_components/deebot/entity.py b/custom_components/deebot/entity.py index bbad973..3ebc7fa 100644 --- a/custom_components/deebot/entity.py +++ b/custom_components/deebot/entity.py @@ -1,4 +1,5 @@ """Deebot entity module.""" + from collections.abc import Callable, Coroutine from dataclasses import dataclass from typing import Any, Generic, TypeVar diff --git a/custom_components/deebot/image.py b/custom_components/deebot/image.py index 5ef504b..6066ecb 100644 --- a/custom_components/deebot/image.py +++ b/custom_components/deebot/image.py @@ -1,4 +1,5 @@ """Support for Deebot image entities.""" + from collections.abc import MutableMapping, Sequence from typing import Any diff --git a/custom_components/deebot/number.py b/custom_components/deebot/number.py index af6d91b..d839674 100644 --- a/custom_components/deebot/number.py +++ b/custom_components/deebot/number.py @@ -1,4 +1,5 @@ """Number module.""" + from collections.abc import Callable from dataclasses import dataclass from typing import Generic diff --git a/custom_components/deebot/select.py b/custom_components/deebot/select.py index f54f9d4..652262c 100644 --- a/custom_components/deebot/select.py +++ b/custom_components/deebot/select.py @@ -1,4 +1,5 @@ """Select module.""" + from collections.abc import Callable from dataclasses import dataclass from typing import Any, Generic diff --git a/custom_components/deebot/sensor.py b/custom_components/deebot/sensor.py index a09dd1d..3ebcd83 100644 --- a/custom_components/deebot/sensor.py +++ b/custom_components/deebot/sensor.py @@ -1,4 +1,5 @@ """Sensor module.""" + from collections.abc import Callable, MutableMapping, Sequence from dataclasses import dataclass from math import floor @@ -49,9 +50,9 @@ class DeebotSensorEntityDescription( ): """Deebot sensor entity description.""" - extra_state_attributes_fn: Callable[ - [EventT], MutableMapping[str, Any] - ] | None = None + extra_state_attributes_fn: Callable[[EventT], MutableMapping[str, Any]] | None = ( + None + ) value_fn: Callable[[EventT], StateType] diff --git a/custom_components/deebot/switch.py b/custom_components/deebot/switch.py index 73e4139..e5fdb0d 100644 --- a/custom_components/deebot/switch.py +++ b/custom_components/deebot/switch.py @@ -1,4 +1,5 @@ """Switch module.""" + from dataclasses import dataclass from typing import Any diff --git a/custom_components/deebot/util.py b/custom_components/deebot/util.py index db4533c..d54f2e9 100644 --- a/custom_components/deebot/util.py +++ b/custom_components/deebot/util.py @@ -1,4 +1,5 @@ """Util module.""" + import dataclasses from enum import Enum from typing import Any diff --git a/custom_components/deebot/vacuum.py b/custom_components/deebot/vacuum.py index bb5c7b5..03f54f5 100644 --- a/custom_components/deebot/vacuum.py +++ b/custom_components/deebot/vacuum.py @@ -1,4 +1,5 @@ """Support for Deebot Vacuums.""" + import logging from collections.abc import Mapping, Sequence from typing import Any diff --git a/tests/conftest.py b/tests/conftest.py index f7835f6..1810b98 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,4 +1,5 @@ """Global fixtures for integration_blueprint integration.""" + # Fixtures allow you to replace functions with a Mock object. You can perform # many options via the Mock to reflect a particular behavior from the original # function that you want to see without going through the function's actual logic. @@ -34,8 +35,9 @@ def auto_enable_custom_integrations(enable_custom_integrations): @pytest.fixture(name="skip_notifications", autouse=True) def skip_notifications_fixture(): """Skip notification calls.""" - with patch("homeassistant.components.persistent_notification.async_create"), patch( - "homeassistant.components.persistent_notification.async_dismiss" + with ( + patch("homeassistant.components.persistent_notification.async_create"), + patch("homeassistant.components.persistent_notification.async_dismiss"), ): yield