Skip to content

Commit

Permalink
Enable strict typing for pandora (#134536)
Browse files Browse the repository at this point in the history
  • Loading branch information
cdce8p authored Jan 3, 2025
1 parent 36582f9 commit afa9529
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
1 change: 1 addition & 0 deletions .strict-typing
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,7 @@ homeassistant.components.otbr.*
homeassistant.components.overkiz.*
homeassistant.components.overseerr.*
homeassistant.components.p1_monitor.*
homeassistant.components.pandora.*
homeassistant.components.panel_custom.*
homeassistant.components.peblar.*
homeassistant.components.peco.*
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/pandora/media_player.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ def _update_stations(self) -> None:
station_lines = self._pianobar.before or ""
_LOGGER.debug("Getting stations: %s", station_lines)
self._attr_source_list = []
for line in station_lines.split("\r\n"):
for line in station_lines.splitlines():
if match := re.search(r"\d+\).....(.+)", line):
station = match.group(1).strip()
_LOGGER.debug("Found station %s", station)
Expand Down
10 changes: 10 additions & 0 deletions mypy.ini
Original file line number Diff line number Diff line change
Expand Up @@ -3406,6 +3406,16 @@ disallow_untyped_defs = true
warn_return_any = true
warn_unreachable = true

[mypy-homeassistant.components.pandora.*]
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.panel_custom.*]
check_untyped_defs = true
disallow_incomplete_defs = true
Expand Down

0 comments on commit afa9529

Please sign in to comment.