diff --git a/.strict-typing b/.strict-typing index 95d03544661..f574aeb79d6 100644 --- a/.strict-typing +++ b/.strict-typing @@ -135,6 +135,7 @@ homeassistant.components.uptime.* homeassistant.components.uptimerobot.* homeassistant.components.vacuum.* homeassistant.components.vallox.* +homeassistant.components.vlc_telnet.* homeassistant.components.water_heater.* homeassistant.components.watttime.* homeassistant.components.weather.* diff --git a/homeassistant/components/vlc_telnet/media_player.py b/homeassistant/components/vlc_telnet/media_player.py index cb231f62861..d83b3f39f40 100644 --- a/homeassistant/components/vlc_telnet/media_player.py +++ b/homeassistant/components/vlc_telnet/media_player.py @@ -104,7 +104,7 @@ def catch_vlc_errors(func: Func) -> Func: """Catch VLC errors.""" @wraps(func) - async def wrapper(self, *args: Any, **kwargs: Any) -> Any: + async def wrapper(self: VlcDevice, *args: Any, **kwargs: Any) -> Any: """Catch VLC errors and modify availability.""" try: await func(self, *args, **kwargs) @@ -206,12 +206,12 @@ class VlcDevice(MediaPlayerEntity): self._media_title = data_info["filename"] @property - def name(self): + def name(self) -> str: """Return the name of the device.""" return self._name @property - def state(self): + def state(self) -> str | None: """Return the state of the device.""" return self._state @@ -226,42 +226,42 @@ class VlcDevice(MediaPlayerEntity): return self._volume @property - def is_volume_muted(self): + def is_volume_muted(self) -> bool | None: """Boolean if volume is currently muted.""" return self._muted @property - def supported_features(self): + def supported_features(self) -> int: """Flag media player features that are supported.""" return SUPPORT_VLC @property - def media_content_type(self): + def media_content_type(self) -> str: """Content type of current playing media.""" return MEDIA_TYPE_MUSIC @property - def media_duration(self): + def media_duration(self) -> int | None: """Duration of current playing media in seconds.""" return self._media_duration @property - def media_position(self): + def media_position(self) -> int | None: """Position of current playing media in seconds.""" return self._media_position @property - def media_position_updated_at(self): + def media_position_updated_at(self) -> datetime | None: """When was the position of the current playing media valid.""" return self._media_position_updated_at @property - def media_title(self): + def media_title(self) -> str | None: """Title of current playing media.""" return self._media_title @property - def media_artist(self): + def media_artist(self) -> str | None: """Artist of current playing media, music track only.""" return self._media_artist diff --git a/mypy.ini b/mypy.ini index 086db083892..425cfd1aa57 100644 --- a/mypy.ini +++ b/mypy.ini @@ -1496,6 +1496,17 @@ no_implicit_optional = true warn_return_any = true warn_unreachable = true +[mypy-homeassistant.components.vlc_telnet.*] +check_untyped_defs = true +disallow_incomplete_defs = true +disallow_subclassing_any = true +disallow_untyped_calls = true +disallow_untyped_decorators = true +disallow_untyped_defs = true +no_implicit_optional = true +warn_return_any = true +warn_unreachable = true + [mypy-homeassistant.components.water_heater.*] check_untyped_defs = true disallow_incomplete_defs = true