From d8e2f7a1601e685d3f1f40f8f6b67ba22c032c10 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 4 Jul 2023 16:34:25 -0700 Subject: [PATCH] [pre-commit.ci] pre-commit autoupdate (#114) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [pre-commit.ci] pre-commit autoupdate updates: - https://github.com/charliermarsh/ruff-pre-commit → https://github.com/astral-sh/ruff-pre-commit - [github.com/astral-sh/ruff-pre-commit: v0.0.270 → v0.0.276](https://github.com/astral-sh/ruff-pre-commit/compare/v0.0.270...v0.0.276) - [github.com/pre-commit/mirrors-mypy: v1.3.0 → v1.4.1](https://github.com/pre-commit/mirrors-mypy/compare/v1.3.0...v1.4.1) * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * fix pre-commit problems --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Bas Nijholt --- .pre-commit-config.yaml | 6 +++--- home_assistant_streamdeck_yaml.py | 5 ++--- pyproject.toml | 1 + tests/test_app.py | 6 +++--- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 08ec348..c3ad0e6 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -11,13 +11,13 @@ repos: hooks: - id: black-jupyter language_version: python3 - - repo: https://github.com/charliermarsh/ruff-pre-commit - rev: "v0.0.270" + - repo: https://github.com/astral-sh/ruff-pre-commit + rev: "v0.0.276" hooks: - id: ruff args: ["--fix"] - repo: https://github.com/pre-commit/mirrors-mypy - rev: "v1.3.0" + rev: "v1.4.1" hooks: - id: mypy additional_dependencies: ["types-PyYAML", "types-requests", "types-setuptools"] diff --git a/home_assistant_streamdeck_yaml.py b/home_assistant_streamdeck_yaml.py index f6e8031..22c18ee 100755 --- a/home_assistant_streamdeck_yaml.py +++ b/home_assistant_streamdeck_yaml.py @@ -922,7 +922,7 @@ async def setup_ws( console.log(auth_response) console.log("Connected to Home Assistant") yield websocket - except ConnectionResetError: + except ConnectionResetError: # noqa: PERF203 # Connection was reset, retrying in 3 seconds console.print_exception(show_locals=True) console.log("Connection was reset, retrying in 3 seconds") @@ -1697,8 +1697,7 @@ def _download_image( image = image.convert("RGB") if filename is not None: image.save(filename) - image = image.resize(size) - return image + return image.resize(size) def update_all_key_images( diff --git a/pyproject.toml b/pyproject.toml index c145ee7..4549e66 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -77,6 +77,7 @@ ignore = [ "PLR0913", # Too many arguments to function call (N > 5) "TD002", # Missing author in TODO; try: `# TODO(): ...` "TD003", # Missing issue link on the line following this TODO + "FIX002", # Line contains TODO ] [tool.ruff.per-file-ignores] diff --git a/tests/test_app.py b/tests/test_app.py index 11de148..b335c50 100644 --- a/tests/test_app.py +++ b/tests/test_app.py @@ -253,9 +253,9 @@ def test_buttons(buttons: list[Button], state: dict[str, dict[str, Any]]) -> Non page = Page(name="Home", buttons=buttons) config = Config(pages=[page]) first_page = config.to_page(0) - rendered_buttons = [] - for button in first_page.buttons: - rendered_buttons.append(button.rendered_template_button(state)) + rendered_buttons = [ + button.rendered_template_button(state) for button in first_page.buttons + ] b = rendered_buttons[0] # LIGHT assert b.domain == "light"