mirror of
https://github.com/home-assistant/core.git
synced 2025-06-25 01:21:51 +02:00
Enforce strict typing for Russound RIO (#132982)
This commit is contained in:
@ -402,6 +402,7 @@ homeassistant.components.romy.*
|
||||
homeassistant.components.rpi_power.*
|
||||
homeassistant.components.rss_feed_template.*
|
||||
homeassistant.components.rtsp_to_webrtc.*
|
||||
homeassistant.components.russound_rio.*
|
||||
homeassistant.components.ruuvi_gateway.*
|
||||
homeassistant.components.ruuvitag_ble.*
|
||||
homeassistant.components.samsungtv.*
|
||||
|
@ -148,37 +148,37 @@ class RussoundZoneDevice(RussoundBaseEntity, MediaPlayerEntity):
|
||||
return MediaPlayerState.ON
|
||||
|
||||
@property
|
||||
def source(self):
|
||||
def source(self) -> str:
|
||||
"""Get the currently selected source."""
|
||||
return self._source.name
|
||||
|
||||
@property
|
||||
def source_list(self):
|
||||
def source_list(self) -> list[str]:
|
||||
"""Return a list of available input sources."""
|
||||
return [x.name for x in self._sources.values()]
|
||||
|
||||
@property
|
||||
def media_title(self):
|
||||
def media_title(self) -> str | None:
|
||||
"""Title of current playing media."""
|
||||
return self._source.song_name
|
||||
|
||||
@property
|
||||
def media_artist(self):
|
||||
def media_artist(self) -> str | None:
|
||||
"""Artist of current playing media, music track only."""
|
||||
return self._source.artist_name
|
||||
|
||||
@property
|
||||
def media_album_name(self):
|
||||
def media_album_name(self) -> str | None:
|
||||
"""Album name of current playing media, music track only."""
|
||||
return self._source.album_name
|
||||
|
||||
@property
|
||||
def media_image_url(self):
|
||||
def media_image_url(self) -> str | None:
|
||||
"""Image url of current playing media."""
|
||||
return self._source.cover_art_url
|
||||
|
||||
@property
|
||||
def volume_level(self):
|
||||
def volume_level(self) -> float:
|
||||
"""Volume level of the media player (0..1).
|
||||
|
||||
Value is returned based on a range (0..50).
|
||||
|
@ -83,4 +83,4 @@ rules:
|
||||
status: exempt
|
||||
comment: |
|
||||
This integration uses telnet exclusively and does not make http calls.
|
||||
strict-typing: todo
|
||||
strict-typing: done
|
||||
|
10
mypy.ini
10
mypy.ini
@ -3775,6 +3775,16 @@ disallow_untyped_defs = true
|
||||
warn_return_any = true
|
||||
warn_unreachable = true
|
||||
|
||||
[mypy-homeassistant.components.russound_rio.*]
|
||||
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.ruuvi_gateway.*]
|
||||
check_untyped_defs = true
|
||||
disallow_incomplete_defs = true
|
||||
|
Reference in New Issue
Block a user