From 49fafcc68a11879469b47173eb067a95775a330f Mon Sep 17 00:00:00 2001 From: Joost Lekkerkerker <joostlek@outlook.com> Date: Sun, 20 Oct 2024 15:51:06 +0200 Subject: [PATCH] Add Spotify to strict typing (#128846) --- .strict-typing | 1 + homeassistant/components/spotify/system_health.py | 4 +++- mypy.ini | 14 +++++++++++--- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/.strict-typing b/.strict-typing index e1935dadd8a..e30413a0421 100644 --- a/.strict-typing +++ b/.strict-typing @@ -424,6 +424,7 @@ homeassistant.components.snooz.* homeassistant.components.solarlog.* homeassistant.components.sonarr.* homeassistant.components.speedtestdotnet.* +homeassistant.components.spotify.* homeassistant.components.sql.* homeassistant.components.squeezebox.* homeassistant.components.ssdp.* diff --git a/homeassistant/components/spotify/system_health.py b/homeassistant/components/spotify/system_health.py index 963c3bfb0ef..5ed6defe090 100644 --- a/homeassistant/components/spotify/system_health.py +++ b/homeassistant/components/spotify/system_health.py @@ -1,5 +1,7 @@ """Provide info to system health.""" +from typing import Any + from homeassistant.components import system_health from homeassistant.core import HomeAssistant, callback @@ -12,7 +14,7 @@ def async_register( register.async_register_info(system_health_info) -async def system_health_info(hass): +async def system_health_info(hass: HomeAssistant) -> dict[str, Any]: """Get info for the info page.""" return { "api_endpoint_reachable": system_health.async_check_can_reach_url( diff --git a/mypy.ini b/mypy.ini index 4cc2b87a6cf..3216947b448 100644 --- a/mypy.ini +++ b/mypy.ini @@ -3995,6 +3995,17 @@ disallow_untyped_defs = true warn_return_any = true warn_unreachable = true +[mypy-homeassistant.components.spotify.*] +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 +no_implicit_reexport = true + [mypy-homeassistant.components.sql.*] check_untyped_defs = true disallow_incomplete_defs = true @@ -4930,9 +4941,6 @@ warn_unreachable = true [mypy-homeassistant.components.application_credentials.*] no_implicit_reexport = true -[mypy-homeassistant.components.spotify.*] -no_implicit_reexport = true - [mypy-tests.*] check_untyped_defs = false disallow_incomplete_defs = false -- GitLab