Enable strict typing for youtube (#107440)

This commit is contained in:
Marc Mueller 2024-01-07 10:43:54 +01:00 committed by GitHub
parent d8c79964c8
commit e4ff51fa9a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 13 additions and 2 deletions

View File

@ -434,6 +434,7 @@ homeassistant.components.wled.*
homeassistant.components.worldclock.*
homeassistant.components.yale_smart_alarm.*
homeassistant.components.yalexs_ble.*
homeassistant.components.youtube.*
homeassistant.components.zeroconf.*
homeassistant.components.zodiac.*
homeassistant.components.zone.*

View File

@ -25,7 +25,7 @@ class AsyncConfigEntryAuth:
@property
def access_token(self) -> str:
"""Return the access token."""
return self.oauth_session.token[CONF_ACCESS_TOKEN]
return self.oauth_session.token[CONF_ACCESS_TOKEN] # type: ignore[no-any-return]
async def check_and_refresh_token(self) -> str:
"""Check the token."""

View File

@ -17,7 +17,7 @@ async def async_get_config_entry_diagnostics(
coordinator: YouTubeDataUpdateCoordinator = hass.data[DOMAIN][entry.entry_id][
COORDINATOR
]
sensor_data = {}
sensor_data: dict[str, Any] = {}
for channel_id, channel_data in coordinator.data.items():
channel_data.get(ATTR_LATEST_VIDEO, {}).pop(ATTR_DESCRIPTION)
sensor_data[channel_id] = channel_data

View File

@ -4103,6 +4103,16 @@ disallow_untyped_defs = true
warn_return_any = true
warn_unreachable = true
[mypy-homeassistant.components.youtube.*]
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.zeroconf.*]
check_untyped_defs = true
disallow_incomplete_defs = true