diff --git a/.strict-typing b/.strict-typing index 30d20a6fc545..ee97deb9af47 100644 --- a/.strict-typing +++ b/.strict-typing @@ -188,6 +188,7 @@ homeassistant.components.input_select.* homeassistant.components.integration.* homeassistant.components.ipp.* homeassistant.components.iqvia.* +homeassistant.components.islamic_prayer_times.* homeassistant.components.isy994.* homeassistant.components.jellyfin.* homeassistant.components.jewish_calendar.* diff --git a/homeassistant/components/islamic_prayer_times/coordinator.py b/homeassistant/components/islamic_prayer_times/coordinator.py index 1a8b0bf70364..30362c763daa 100644 --- a/homeassistant/components/islamic_prayer_times/coordinator.py +++ b/homeassistant/components/islamic_prayer_times/coordinator.py @@ -3,6 +3,7 @@ from __future__ import annotations from datetime import datetime, timedelta import logging +from typing import Any, cast from prayer_times_calculator import PrayerTimesCalculator, exceptions from requests.exceptions import ConnectionError as ConnError @@ -37,7 +38,7 @@ class IslamicPrayerDataUpdateCoordinator(DataUpdateCoordinator[dict[str, datetim """Return the calculation method.""" return self.config_entry.options.get(CONF_CALC_METHOD, DEFAULT_CALC_METHOD) - def get_new_prayer_times(self) -> dict[str, str]: + def get_new_prayer_times(self) -> dict[str, Any]: """Fetch prayer times for today.""" calc = PrayerTimesCalculator( latitude=self.hass.config.latitude, @@ -45,7 +46,7 @@ class IslamicPrayerDataUpdateCoordinator(DataUpdateCoordinator[dict[str, datetim calculation_method=self.calc_method, date=str(dt_util.now().date()), ) - return calc.fetch_prayer_times() + return cast(dict[str, Any], calc.fetch_prayer_times()) @callback def async_schedule_future_update(self, midnight_dt: datetime) -> None: @@ -98,7 +99,7 @@ class IslamicPrayerDataUpdateCoordinator(DataUpdateCoordinator[dict[str, datetim self.hass, self.async_request_update, next_update_at ) - async def async_request_update(self, *_) -> None: + async def async_request_update(self, _: datetime) -> None: """Request update from coordinator.""" await self.async_request_refresh() diff --git a/mypy.ini b/mypy.ini index 1c3fc1a52ed9..eda6f35cdfa6 100644 --- a/mypy.ini +++ b/mypy.ini @@ -1642,6 +1642,16 @@ disallow_untyped_defs = true warn_return_any = true warn_unreachable = true +[mypy-homeassistant.components.islamic_prayer_times.*] +check_untyped_defs = true +disallow_incomplete_defs = true +disallow_subclassing_any = true +disallow_untyped_calls = true +disallow_untyped_decorators = true +disallow_untyped_defs = true +warn_return_any = true +warn_unreachable = true + [mypy-homeassistant.components.isy994.*] check_untyped_defs = true disallow_incomplete_defs = true