Treat strings starting with https but not htt as soundtouch media URLs (#101183)

This commit is contained in:
Ville Skyttä 2023-10-01 17:16:19 +03:00 committed by GitHub
parent a4a99ce957
commit 31ea00f5c7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3,7 +3,6 @@ from __future__ import annotations
from functools import partial from functools import partial
import logging import logging
import re
from typing import Any from typing import Any
from libsoundtouch.device import SoundTouchDevice from libsoundtouch.device import SoundTouchDevice
@ -250,7 +249,7 @@ class SoundTouchMediaPlayer(MediaPlayerEntity):
) -> None: ) -> None:
"""Play a piece of media.""" """Play a piece of media."""
_LOGGER.debug("Starting media with media_id: %s", media_id) _LOGGER.debug("Starting media with media_id: %s", media_id)
if re.match(r"http?://", str(media_id)): if str(media_id).lower().startswith("http://"): # no https support
# URL # URL
_LOGGER.debug("Playing URL %s", str(media_id)) _LOGGER.debug("Playing URL %s", str(media_id))
self._device.play_url(str(media_id)) self._device.play_url(str(media_id))