From f0452e9ba056a333132c3260124ec01711c648c6 Mon Sep 17 00:00:00 2001 From: Marc Mueller <30130371+cdce8p@users.noreply.github.com> Date: Fri, 21 Jun 2024 13:15:18 +0200 Subject: [PATCH] Update mypy dev 1.11.0a8 (#120032) --- homeassistant/components/aquacell/__init__.py | 2 +- homeassistant/components/diagnostics/util.py | 3 +-- homeassistant/components/mqtt/client.py | 2 +- homeassistant/components/recorder/const.py | 4 +++- homeassistant/helpers/redact.py | 2 +- homeassistant/helpers/template.py | 2 +- requirements_test.txt | 2 +- 7 files changed, 9 insertions(+), 8 deletions(-) diff --git a/homeassistant/components/aquacell/__init__.py b/homeassistant/components/aquacell/__init__.py index fc67a3f2c53..98cf5d7f0f0 100644 --- a/homeassistant/components/aquacell/__init__.py +++ b/homeassistant/components/aquacell/__init__.py @@ -13,7 +13,7 @@ from .coordinator import AquacellCoordinator PLATFORMS = [Platform.SENSOR] -AquacellConfigEntry = ConfigEntry[AquacellCoordinator] +type AquacellConfigEntry = ConfigEntry[AquacellCoordinator] async def async_setup_entry(hass: HomeAssistant, entry: AquacellConfigEntry) -> bool: diff --git a/homeassistant/components/diagnostics/util.py b/homeassistant/components/diagnostics/util.py index 989433e15b2..0ca85c9a584 100644 --- a/homeassistant/components/diagnostics/util.py +++ b/homeassistant/components/diagnostics/util.py @@ -11,8 +11,7 @@ from .const import REDACTED @overload -def async_redact_data(data: Mapping, to_redact: Iterable[Any]) -> dict: # type: ignore[overload-overlap] - ... +def async_redact_data(data: Mapping, to_redact: Iterable[Any]) -> dict: ... @overload diff --git a/homeassistant/components/mqtt/client.py b/homeassistant/components/mqtt/client.py index 63a90019c20..18ce89beb9b 100644 --- a/homeassistant/components/mqtt/client.py +++ b/homeassistant/components/mqtt/client.py @@ -899,7 +899,7 @@ class MQTT: """Return a string with the exception message.""" # if msg_callback is a partial we return the name of the first argument if isinstance(msg_callback, partial): - call_back_name = getattr(msg_callback.args[0], "__name__") # type: ignore[unreachable] + call_back_name = getattr(msg_callback.args[0], "__name__") else: call_back_name = getattr(msg_callback, "__name__") return ( diff --git a/homeassistant/components/recorder/const.py b/homeassistant/components/recorder/const.py index 97418ee364a..f2af5306ded 100644 --- a/homeassistant/components/recorder/const.py +++ b/homeassistant/components/recorder/const.py @@ -1,5 +1,7 @@ """Recorder constants.""" +from __future__ import annotations + from enum import StrEnum from typing import TYPE_CHECKING @@ -17,7 +19,7 @@ if TYPE_CHECKING: from .core import Recorder # noqa: F401 -DATA_INSTANCE: HassKey["Recorder"] = HassKey("recorder_instance") +DATA_INSTANCE: HassKey[Recorder] = HassKey("recorder_instance") SQLITE_URL_PREFIX = "sqlite://" diff --git a/homeassistant/helpers/redact.py b/homeassistant/helpers/redact.py index 6db0ab4bdd9..cc4f53ae70e 100644 --- a/homeassistant/helpers/redact.py +++ b/homeassistant/helpers/redact.py @@ -29,7 +29,7 @@ def partial_redact( @overload -def async_redact_data[_ValueT]( # type: ignore[overload-overlap] +def async_redact_data[_ValueT]( data: Mapping, to_redact: Iterable[Any] | Mapping[Any, Callable[[_ValueT], _ValueT]] ) -> dict: ... diff --git a/homeassistant/helpers/template.py b/homeassistant/helpers/template.py index f10913c2478..714a57336bd 100644 --- a/homeassistant/helpers/template.py +++ b/homeassistant/helpers/template.py @@ -3045,7 +3045,7 @@ class TemplateEnvironment(ImmutableSandboxedEnvironment): return super().is_safe_attribute(obj, attr, value) @overload - def compile( # type: ignore[overload-overlap] + def compile( self, source: str | jinja2.nodes.Template, name: str | None = None, diff --git a/requirements_test.txt b/requirements_test.txt index 47c3a834e01..9001213f630 100644 --- a/requirements_test.txt +++ b/requirements_test.txt @@ -11,7 +11,7 @@ astroid==3.2.2 coverage==7.5.3 freezegun==1.5.0 mock-open==1.4.0 -mypy-dev==1.11.0a6 +mypy-dev==1.11.0a8 pre-commit==3.7.1 pydantic==1.10.17 pylint==3.2.2