diff --git a/homeassistant/components/youtube/api.py b/homeassistant/components/youtube/api.py index beb0a9a70dc0b6..96150ee3b839ec 100644 --- a/homeassistant/components/youtube/api.py +++ b/homeassistant/components/youtube/api.py @@ -1,5 +1,7 @@ """API for YouTube bound to Home Assistant OAuth.""" +from typing import cast + from youtubeaio.types import AuthScope from youtubeaio.youtube import YouTube @@ -26,7 +28,7 @@ def __init__( @property def access_token(self) -> str: """Return the access token.""" - return self.oauth_session.token[CONF_ACCESS_TOKEN] # type: ignore[no-any-return] + return cast(str, self.oauth_session.token[CONF_ACCESS_TOKEN]) async def check_and_refresh_token(self) -> str: """Check the token."""