From 12f7e64c7ef096930bcff96ffd4504d244b262da Mon Sep 17 00:00:00 2001 From: Erik Montnemery Date: Wed, 4 Sep 2024 09:02:34 +0200 Subject: [PATCH] Fix errors found by pylint 3.2.7 (#946) * Fix errors found by pylint 3.2.7 * Move assignment of data out of else-block --- pychromecast/controllers/plex.py | 2 ++ pychromecast/socket_client.py | 3 +-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/pychromecast/controllers/plex.py b/pychromecast/controllers/plex.py index c3260df91..96089edf5 100644 --- a/pychromecast/controllers/plex.py +++ b/pychromecast/controllers/plex.py @@ -108,6 +108,8 @@ def media_to_chromecast_command( # pylint: disable=invalid-name, too-many-local dict: Returs a dict formatted correctly to start playback on a Chromecast. """ + machineIdentifier = None + token = None if media is not None: # Lets set some params for the user if they use plexapi. server: PlexServer = ( diff --git a/pychromecast/socket_client.py b/pychromecast/socket_client.py index 2b375b503..1d8eac10b 100644 --- a/pychromecast/socket_client.py +++ b/pychromecast/socket_client.py @@ -617,8 +617,6 @@ def _run_once(self) -> int: self.port, exc, ) - else: - data = _dict_from_message_payload(message) if self.wakeup_selector_key in can_read: # Clear the socket's buffer @@ -633,6 +631,7 @@ def _run_once(self) -> int: return 0 # See if any handlers will accept this message + data = _dict_from_message_payload(message) self._route_message(message, data) if REQUEST_ID in data and data[REQUEST_ID] in self._request_callbacks: