Enable strict typing for pandora (#134536)

This commit is contained in:
Marc Mueller 2025-01-03 13:23:39 +01:00 committed by GitHub
parent 36582f9ac2
commit afa95293dc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 12 additions and 1 deletions

View File

@ -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.*

View File

@ -310,7 +310,7 @@ class PandoraMediaPlayer(MediaPlayerEntity):
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)

View File

@ -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