Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-PyChromecast for openSUSE:Factory checked in at 2023-06-01 17:20:57 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-PyChromecast (Old) and /work/SRC/openSUSE:Factory/.python-PyChromecast.new.2531 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-PyChromecast" Thu Jun 1 17:20:57 2023 rev:23 rq:1090244 version:13.0.7 Changes: -------- --- /work/SRC/openSUSE:Factory/python-PyChromecast/python-PyChromecast.changes 2023-01-03 15:05:53.826696076 +0100 +++ /work/SRC/openSUSE:Factory/.python-PyChromecast.new.2531/python-PyChromecast.changes 2023-06-01 17:20:59.338682713 +0200 @@ -1,0 +2,16 @@ +Thu Jun 1 10:07:16 UTC 2023 - Dirk Müller <dmuel...@suse.com> + +- update to 13.0.7: + * Wait longer when attempting to play media (#720) @emontnemery + * Fix socket leak + * Don't call launch callback on error + * Wait for response when stopping app + * Simplify request callback handling + * Make sure handler is unregistered after quickplay + * Fix lint issues + * Add SVS Pro SoundBase + * Add JBL Link 10, 20, 300, 500 + * Fix poll/select for Windows + * Add Smart Soundbar 10 + +------------------------------------------------------------------- Old: ---- PyChromecast-13.0.4.tar.gz New: ---- PyChromecast-13.0.7.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-PyChromecast.spec ++++++ --- /var/tmp/diff_new_pack.GNu18K/_old 2023-06-01 17:20:59.842685700 +0200 +++ /var/tmp/diff_new_pack.GNu18K/_new 2023-06-01 17:20:59.850685748 +0200 @@ -19,7 +19,7 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} %define skip_python2 1 Name: python-PyChromecast -Version: 13.0.4 +Version: 13.0.7 Release: 0 Summary: Python module to talk to Google Chromecast License: MIT ++++++ PyChromecast-13.0.4.tar.gz -> PyChromecast-13.0.7.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/PyChromecast-13.0.4/PKG-INFO new/PyChromecast-13.0.7/PKG-INFO --- old/PyChromecast-13.0.4/PKG-INFO 2022-12-13 08:18:42.790731700 +0100 +++ new/PyChromecast-13.0.7/PKG-INFO 2023-04-03 17:52:34.413555400 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: PyChromecast -Version: 13.0.4 +Version: 13.0.7 Summary: Python module to talk to Google Chromecast. Home-page: https://github.com/balloob/pychromecast Author: Paulus Schoutsen diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/PyChromecast-13.0.4/PyChromecast.egg-info/PKG-INFO new/PyChromecast-13.0.7/PyChromecast.egg-info/PKG-INFO --- old/PyChromecast-13.0.4/PyChromecast.egg-info/PKG-INFO 2022-12-13 08:18:42.000000000 +0100 +++ new/PyChromecast-13.0.7/PyChromecast.egg-info/PKG-INFO 2023-04-03 17:52:34.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: PyChromecast -Version: 13.0.4 +Version: 13.0.7 Summary: Python module to talk to Google Chromecast. Home-page: https://github.com/balloob/pychromecast Author: Paulus Schoutsen diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/PyChromecast-13.0.4/pychromecast/__init__.py new/PyChromecast-13.0.7/pychromecast/__init__.py --- old/PyChromecast-13.0.4/pychromecast/__init__.py 2022-12-13 08:18:33.000000000 +0100 +++ new/PyChromecast-13.0.7/pychromecast/__init__.py 2023-04-03 17:52:22.000000000 +0200 @@ -385,9 +385,19 @@ def quit_app(self): """Tells the Chromecast to quit current app_id.""" - self.logger.info("Quiting current app") + self.logger.info("Quitting current app") - self.socket_client.receiver_controller.stop_app() + def stop_app_callback(_response): + """Set event when stop app request has been handled.""" + stop_app_done.set() + + stop_app_done = threading.Event() + self.socket_client.receiver_controller.stop_app( + callback_function_param=stop_app_callback + ) + stop_app_done.wait(10) + if not stop_app_done.is_set(): + self.logger.warning("Failed to stop app") def volume_up(self, delta=0.1): """Increment volume by 0.1 (or delta) unless it is already maxed. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/PyChromecast-13.0.4/pychromecast/const.py new/PyChromecast-13.0.7/pychromecast/const.py --- old/PyChromecast-13.0.4/pychromecast/const.py 2022-12-13 08:18:33.000000000 +0100 +++ new/PyChromecast-13.0.7/pychromecast/const.py 2023-04-03 17:52:22.000000000 +0200 @@ -8,7 +8,9 @@ # Cast Audio group device, supports only audio CAST_TYPE_GROUP = "group" +MF_CANTON = "Canton Elektronik GmbH + Co. KG" MF_GOOGLE = "Google Inc." +MF_JBL = "JBL" MF_LENOVO = "LENOVO" MF_LG = "LG" MF_MARSHALL = "Marshall" @@ -16,6 +18,7 @@ MF_PHILIPS = "Philips" MF_PIONEER = "Pioneer" MF_SONY = "Sony" +MF_SVS = "SVS" MF_VIZIO = "Vizio" MF_WNC = "wnc" MF_XIAOMI = "Xiaomi" @@ -36,6 +39,10 @@ "nest wifi point": (CAST_TYPE_AUDIO, MF_GOOGLE), "bravia 4k vh2": (CAST_TYPE_CHROMECAST, MF_SONY), "C4A": (CAST_TYPE_AUDIO, MF_SONY), + "JBL Link 10": (CAST_TYPE_AUDIO, MF_JBL), + "JBL Link 20": (CAST_TYPE_AUDIO, MF_JBL), + "JBL Link 300": (CAST_TYPE_AUDIO, MF_JBL), + "JBL Link 500": (CAST_TYPE_AUDIO, MF_JBL), "lenovocd-24502f": (CAST_TYPE_AUDIO, MF_LENOVO), "Lenovo Smart Display 7": (CAST_TYPE_CHROMECAST, MF_LENOVO), "LG WK7 ThinQ Speaker": (CAST_TYPE_AUDIO, MF_LG), @@ -45,7 +52,9 @@ "Pioneer VSX-1131": (CAST_TYPE_AUDIO, MF_PIONEER), "Pioneer VSX-LX305": (CAST_TYPE_AUDIO, MF_PIONEER), "shield android tv": (CAST_TYPE_CHROMECAST, MF_NVIDIA), + "Smart Soundbar 10": (CAST_TYPE_AUDIO, MF_CANTON), "Stream TV": (CAST_TYPE_CHROMECAST, MF_WNC), + "SVS Pro SoundBase": (CAST_TYPE_AUDIO, MF_SVS), "TPM191E": (CAST_TYPE_CHROMECAST, MF_PHILIPS), "V705-H3": (CAST_TYPE_CHROMECAST, MF_VIZIO), } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/PyChromecast-13.0.4/pychromecast/controllers/homeassistant.py new/PyChromecast-13.0.7/pychromecast/controllers/homeassistant.py --- old/PyChromecast-13.0.4/pychromecast/controllers/homeassistant.py 2022-12-13 08:18:33.000000000 +0100 +++ new/PyChromecast-13.0.7/pychromecast/controllers/homeassistant.py 2023-04-03 17:52:22.000000000 +0200 @@ -104,7 +104,7 @@ try: if not self._hass_connecting_event.is_set(): self.logger.warning("_connect_hass failed for %s", self.hass_url) - raise PyChromecastError() + raise PyChromecastError() # pylint: disable=broad-exception-raised finally: self._hass_connecting_event.set() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/PyChromecast-13.0.4/pychromecast/controllers/media.py new/PyChromecast-13.0.7/pychromecast/controllers/media.py --- old/PyChromecast-13.0.4/pychromecast/controllers/media.py 2022-12-13 08:18:33.000000000 +0100 +++ new/PyChromecast-13.0.7/pychromecast/controllers/media.py 2023-04-03 17:52:22.000000000 +0200 @@ -539,12 +539,12 @@ **kwargs, callback_function=start_play_media_sent_callback, ) - start_play_media_sent.wait(10) + start_play_media_sent.wait(30) if not start_play_media_sent.is_set(): self.logger.warning( "Quick Play failed for %s:%s(%s)", media_id, media_type, kwargs ) - raise PyChromecastError() + raise PyChromecastError() # pylint: disable=broad-exception-raised class MediaController(BaseMediaPlayer): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/PyChromecast-13.0.4/pychromecast/controllers/receiver.py new/PyChromecast-13.0.7/pychromecast/controllers/receiver.py --- old/PyChromecast-13.0.4/pychromecast/controllers/receiver.py 2022-12-13 08:18:33.000000000 +0100 +++ new/PyChromecast-13.0.7/pychromecast/controllers/receiver.py 2023-04-03 17:52:22.000000000 +0200 @@ -79,9 +79,7 @@ self.status = None self.launch_failure = None - self.app_to_launch = None self.cast_type = cast_type - self.app_launch_event_function = None self._status_listeners = [] self._launch_error_listeners = [] @@ -152,11 +150,19 @@ if force_launch or self.app_id != app_id: self.logger.info("Receiver:Launching app %s", app_id) - self.app_to_launch = app_id - self.app_launch_event_function = callback_function self.launch_failure = None - self.send_message({MESSAGE_TYPE: TYPE_LAUNCH, APP_ID: app_id}) + def handle_launch_response(response) -> None: + if not callback_function: + return + + if response and response[MESSAGE_TYPE] == TYPE_RECEIVER_STATUS: + callback_function() + + self.send_message( + {MESSAGE_TYPE: TYPE_LAUNCH, APP_ID: app_id}, + callback_function=handle_launch_response, + ) else: self.logger.info("Not launching app %s - already running", app_id) if callback_function: @@ -224,19 +230,11 @@ def _process_get_status(self, data): """Processes a received STATUS message and notifies listeners.""" status = self._parse_status(data, self.cast_type) - is_new_app = self.app_id != status.app_id and self.app_to_launch self.status = status self.logger.debug("Received status: %s", self.status) self._report_status() - if is_new_app and self.app_to_launch == self.app_id: - self.app_to_launch = None - if self.app_launch_event_function: - self.logger.debug("Start app_launch_event_function...") - self.app_launch_event_function() - self.app_launch_event_function = None - def _report_status(self): """Reports the current status to all listeners.""" for listener in self._status_listeners: @@ -266,9 +264,6 @@ launch_failure = self._parse_launch_error(data) self.launch_failure = launch_failure - if self.app_to_launch: - self.app_to_launch = None - self.logger.debug("Launch status: %s", launch_failure) for listener in self._launch_error_listeners: @@ -285,6 +280,5 @@ self.status = None self.launch_failure = None - self.app_to_launch = None self._status_listeners = [] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/PyChromecast-13.0.4/pychromecast/controllers/supla.py new/PyChromecast-13.0.7/pychromecast/controllers/supla.py --- old/PyChromecast-13.0.4/pychromecast/controllers/supla.py 2022-12-13 08:18:33.000000000 +0100 +++ new/PyChromecast-13.0.7/pychromecast/controllers/supla.py 2023-04-03 17:52:22.000000000 +0200 @@ -60,4 +60,4 @@ ) play_media_done_event.wait(10) if not play_media_done_event.is_set(): - raise PyChromecastError() + raise PyChromecastError() # pylint: disable=broad-exception-raised diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/PyChromecast-13.0.4/pychromecast/controllers/yleareena.py new/PyChromecast-13.0.7/pychromecast/controllers/yleareena.py --- old/PyChromecast-13.0.4/pychromecast/controllers/yleareena.py 2022-12-13 08:18:33.000000000 +0100 +++ new/PyChromecast-13.0.7/pychromecast/controllers/yleareena.py 2023-04-03 17:52:22.000000000 +0200 @@ -72,4 +72,4 @@ play_media_done_event.wait(10) if not play_media_done_event.is_set(): - raise PyChromecastError() + raise PyChromecastError() # pylint: disable=broad-exception-raised diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/PyChromecast-13.0.4/pychromecast/quick_play.py new/PyChromecast-13.0.7/pychromecast/quick_play.py --- old/PyChromecast-13.0.4/pychromecast/quick_play.py 2022-12-13 08:18:33.000000000 +0100 +++ new/PyChromecast-13.0.7/pychromecast/quick_play.py 2023-04-03 17:52:22.000000000 +0200 @@ -74,6 +74,7 @@ cast.register_handler(controller) - controller.quick_play(**data) - - cast.unregister_handler(controller) + try: + controller.quick_play(**data) + finally: + cast.unregister_handler(controller) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/PyChromecast-13.0.4/pychromecast/socket_client.py new/PyChromecast-13.0.7/pychromecast/socket_client.py --- old/PyChromecast-13.0.4/pychromecast/socket_client.py 2022-12-13 08:18:33.000000000 +0100 +++ new/PyChromecast-13.0.7/pychromecast/socket_client.py 2023-04-03 17:52:22.000000000 +0200 @@ -56,6 +56,8 @@ CONNECTION_STATUS_FAILED_RESOLVE = "FAILED_RESOLVE" # The socket connection was lost and needs to be retried CONNECTION_STATUS_LOST = "LOST" +# Check for select poll method +SELECT_HAS_POLL = hasattr(select, "poll") HB_PING_TIME = 10 HB_PONG_TIME = 10 @@ -206,7 +208,7 @@ self.destination_id = None self.session_id = None self._request_id = 0 - # dict mapping requestId on threading.Event objects + # dict mapping requestId to callback functions self._request_callbacks = {} self._open_channels = [] @@ -239,10 +241,6 @@ self.socket.close() self.socket = None - # Make sure nobody is blocking. - for callback in self._request_callbacks.values(): - callback["event"].set() - self.app_namespaces = [] self.destination_id = None self.session_id = None @@ -281,6 +279,10 @@ if now < retry["next_retry"]: continue try: + if self.socket is not None: + self.socket.close() + self.socket = None + self.socket = new_socket() self.socket.settimeout(self.timeout) self._report_connection_status( @@ -555,7 +557,7 @@ Use run_once() in your own main loop after you receive something on the socket (get_socket()). """ - # pylint: disable=too-many-branches, too-many-return-statements + # pylint: disable=too-many-branches, too-many-statements, too-many-return-statements try: if not self._check_connection(): @@ -565,15 +567,19 @@ # poll the socket, as well as the socketpair to allow us to be interrupted rlist = [self.socket, self.socketpair[0]] - # Map file descriptors to socket objects because select.select does not support fd > 1024 - # https://stackoverflow.com/questions/14250751/how-to-increase-filedescriptors-range-in-python-select - fd_to_socket = {rlist_item.fileno(): rlist_item for rlist_item in rlist} try: - poll_obj = select.poll() - for poll_fd in rlist: - poll_obj.register(poll_fd, select.POLLIN) - poll_result = poll_obj.poll(timeout * 1000) # timeout in milliseconds - can_read = [fd_to_socket[fd] for fd, _status in poll_result] + if SELECT_HAS_POLL is True: + # Map file descriptors to socket objects because select.select does not support fd > 1024 + # https://stackoverflow.com/questions/14250751/how-to-increase-filedescriptors-range-in-python-select + fd_to_socket = {rlist_item.fileno(): rlist_item for rlist_item in rlist} + + poll_obj = select.poll() + for poll_fd in rlist: + poll_obj.register(poll_fd, select.POLLIN) + poll_result = poll_obj.poll(timeout * 1000) # timeout in milliseconds + can_read = [fd_to_socket[fd] for fd, _status in poll_result] + else: + can_read, _, _ = select.select(rlist, [], [], timeout) except (ValueError, OSError) as exc: self.logger.error( "[%s(%s):%s] Error in select call: %s", @@ -638,15 +644,8 @@ # See if any handlers will accept this message self._route_message(message, data) - if REQUEST_ID in data: - callback = self._request_callbacks.pop(data[REQUEST_ID], None) - if callback is not None: - event = callback["event"] - callback["response"] = data - function = callback["function"] - event.set() - if function: - function(data) + if REQUEST_ID in data and data[REQUEST_ID] in self._request_callbacks: + self._request_callbacks.pop(data[REQUEST_ID], None)(data) return 0 @@ -704,7 +703,6 @@ """Route message to any handlers on the message namespace""" # route message to handlers if message.namespace in self._handlers: - # debug messages if message.namespace != NS_HEARTBEAT: self.logger.debug( @@ -913,11 +911,7 @@ try: if callback_function: if not no_add_request_id: - self._request_callbacks[request_id] = { - "event": threading.Event(), - "response": None, - "function": callback_function, - } + self._request_callbacks[request_id] = callback_function else: callback_function(None) self.socket.sendall(be_size + msg.SerializeToString()) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/PyChromecast-13.0.4/setup.py new/PyChromecast-13.0.7/setup.py --- old/PyChromecast-13.0.4/setup.py 2022-12-13 08:18:33.000000000 +0100 +++ new/PyChromecast-13.0.7/setup.py 2023-04-03 17:52:22.000000000 +0200 @@ -5,7 +5,7 @@ setup( name="PyChromecast", - version="13.0.4", + version="13.0.7", license="MIT", url="https://github.com/balloob/pychromecast", author="Paulus Schoutsen",