From c4d8cda92be330311fd83809588c7e0131d1c49b Mon Sep 17 00:00:00 2001 From: Marc Mueller <30130371+cdce8p@users.noreply.github.com> Date: Wed, 15 Jan 2025 00:54:54 +0100 Subject: [PATCH] Update mypy-dev to 1.15.0a2 (#135633) --- homeassistant/components/recorder/migration.py | 8 ++++---- homeassistant/components/recorder/models/state.py | 4 ++-- homeassistant/components/schedule/__init__.py | 2 +- homeassistant/components/twentemilieu/calendar.py | 3 +-- homeassistant/components/zha/device_tracker.py | 2 +- requirements_test.txt | 2 +- 6 files changed, 10 insertions(+), 11 deletions(-) diff --git a/homeassistant/components/recorder/migration.py b/homeassistant/components/recorder/migration.py index 2efcef1c768..c6cdd6d317f 100644 --- a/homeassistant/components/recorder/migration.py +++ b/homeassistant/components/recorder/migration.py @@ -2147,7 +2147,7 @@ def _migrate_columns_to_timestamp( ) ) result = None - while result is None or result.rowcount > 0: # type: ignore[unreachable] + while result is None or result.rowcount > 0: with session_scope(session=session_maker()) as session: result = session.connection().execute( text( @@ -2178,7 +2178,7 @@ def _migrate_columns_to_timestamp( ) ) result = None - while result is None or result.rowcount > 0: # type: ignore[unreachable] + while result is None or result.rowcount > 0: with session_scope(session=session_maker()) as session: result = session.connection().execute( text( @@ -2277,7 +2277,7 @@ def _migrate_statistics_columns_to_timestamp( # updated all rows in the table until the rowcount is 0 for table in STATISTICS_TABLES: result = None - while result is None or result.rowcount > 0: # type: ignore[unreachable] + while result is None or result.rowcount > 0: with session_scope(session=session_maker()) as session: result = session.connection().execute( text( @@ -2299,7 +2299,7 @@ def _migrate_statistics_columns_to_timestamp( # updated all rows in the table until the rowcount is 0 for table in STATISTICS_TABLES: result = None - while result is None or result.rowcount > 0: # type: ignore[unreachable] + while result is None or result.rowcount > 0: with session_scope(session=session_maker()) as session: result = session.connection().execute( text( diff --git a/homeassistant/components/recorder/models/state.py b/homeassistant/components/recorder/models/state.py index fbf73e75025..d73c204079d 100644 --- a/homeassistant/components/recorder/models/state.py +++ b/homeassistant/components/recorder/models/state.py @@ -58,8 +58,8 @@ class LazyState(State): self.attr_cache = attr_cache self.context = EMPTY_CONTEXT - @cached_property # type: ignore[override] - def attributes(self) -> dict[str, Any]: + @cached_property + def attributes(self) -> dict[str, Any]: # type: ignore[override] """State attributes.""" return decode_attributes_from_source( getattr(self._row, "attributes", None), self.attr_cache diff --git a/homeassistant/components/schedule/__init__.py b/homeassistant/components/schedule/__init__.py index 24ce4f3b3fa..30ca44fe3ee 100644 --- a/homeassistant/components/schedule/__init__.py +++ b/homeassistant/components/schedule/__init__.py @@ -73,7 +73,7 @@ def valid_schedule(schedule: list[dict[str, str]]) -> list[dict[str, str]]: ) # Check if the from time of the event is after the to time of the previous event - if previous_to is not None and previous_to > time_range[CONF_FROM]: # type: ignore[unreachable] + if previous_to is not None and previous_to > time_range[CONF_FROM]: raise vol.Invalid("Overlapping times found in schedule") previous_to = time_range[CONF_TO] diff --git a/homeassistant/components/twentemilieu/calendar.py b/homeassistant/components/twentemilieu/calendar.py index d163ae4e564..69c509b9edf 100644 --- a/homeassistant/components/twentemilieu/calendar.py +++ b/homeassistant/components/twentemilieu/calendar.py @@ -70,8 +70,7 @@ class TwenteMilieuCalendar(TwenteMilieuEntity, CalendarEntity): waste_dates and ( next_waste_pickup_date is None - or waste_dates[0] # type: ignore[unreachable] - < next_waste_pickup_date + or waste_dates[0] < next_waste_pickup_date ) and waste_dates[0] >= dt_util.now().date() ): diff --git a/homeassistant/components/zha/device_tracker.py b/homeassistant/components/zha/device_tracker.py index fc374f6c44d..7bdfc54c986 100644 --- a/homeassistant/components/zha/device_tracker.py +++ b/homeassistant/components/zha/device_tracker.py @@ -61,7 +61,7 @@ class ZHADeviceScannerEntity(ScannerEntity, ZHAEntity): """ return self.entity_data.entity.battery_level - @property # type: ignore[explicit-override, misc] + @property # type: ignore[misc] def device_info(self) -> DeviceInfo: """Return device info.""" # We opt ZHA device tracker back into overriding this method because diff --git a/requirements_test.txt b/requirements_test.txt index b3a50bd96a6..b6d061577e5 100644 --- a/requirements_test.txt +++ b/requirements_test.txt @@ -12,7 +12,7 @@ coverage==7.6.8 freezegun==1.5.1 license-expression==30.4.0 mock-open==1.4.0 -mypy-dev==1.15.0a1 +mypy-dev==1.15.0a2 pre-commit==4.0.0 pydantic==2.10.4 pylint==3.3.2