Format code with yapf
This commit fixes the style issues introduced in 3df41f0 according to the output
from yapf.
Details: https://deepsource.io/gh/kokarare1212/librespot-python/transform/8943cbb4-879c-4a5f-8f77-e14c8c5ac178/
This commit is contained in:
committed by
GitHub
parent
3df41f04fc
commit
45e69da1a8
@@ -18,7 +18,8 @@ class DeviceStateHandler:
|
||||
_deviceInfo: Connect.DeviceInfo = None
|
||||
_listeners: list[DeviceStateHandler.Listener] = list()
|
||||
_putState: Connect.PutStateRequest = None
|
||||
_putStateWorker: concurrent.futures.ThreadPoolExecutor = concurrent.futures.ThreadPoolExecutor()
|
||||
_putStateWorker: concurrent.futures.ThreadPoolExecutor = concurrent.futures.ThreadPoolExecutor(
|
||||
)
|
||||
_connectionId: str = None
|
||||
|
||||
def __init__(self, session: Session, player, conf: PlayerConfiguration):
|
||||
@@ -32,7 +33,8 @@ class DeviceStateHandler:
|
||||
if self._connectionId is None or \
|
||||
self._connectionId != newer:
|
||||
self._connectionId = newer
|
||||
self._LOGGER.debug("Updated Spotify-Connection-Id: {}".format(self._connectionId))
|
||||
self._LOGGER.debug("Updated Spotify-Connection-Id: {}".format(
|
||||
self._connectionId))
|
||||
self._notify_ready()
|
||||
|
||||
def add_listener(self, listener: DeviceStateHandler.Listener):
|
||||
@@ -42,7 +44,8 @@ class DeviceStateHandler:
|
||||
for listener in self._listeners:
|
||||
listener.ready()
|
||||
|
||||
def update_state(self, reason: Connect.PutStateReason, player_time: int, state: Player.PlayerState):
|
||||
def update_state(self, reason: Connect.PutStateReason, player_time: int,
|
||||
state: Player.PlayerState):
|
||||
if self._connectionId is None:
|
||||
raise TypeError()
|
||||
|
||||
@@ -61,8 +64,9 @@ class DeviceStateHandler:
|
||||
def _put_connect_state(self, req: Connect.PutStateRequest):
|
||||
self._session.api().put_connect_state(self._connectionId, req)
|
||||
self._LOGGER.info("Put state. ts: {}, connId: {}, reason: {}".format(
|
||||
req.client_side_timestamp, Utils.truncate_middle(self._connectionId, 10), req.put_state_reason
|
||||
))
|
||||
req.client_side_timestamp,
|
||||
Utils.truncate_middle(self._connectionId, 10),
|
||||
req.put_state_reason))
|
||||
|
||||
class Endpoint(enum.Enum):
|
||||
Play: str = "play"
|
||||
@@ -76,7 +80,8 @@ class DeviceStateHandler:
|
||||
def ready(self) -> None:
|
||||
pass
|
||||
|
||||
def command(self, endpoint: DeviceStateHandler.Endpoint, data: DeviceStateHandler.CommandBody) -> None:
|
||||
def command(self, endpoint: DeviceStateHandler.Endpoint,
|
||||
data: DeviceStateHandler.CommandBody) -> None:
|
||||
pass
|
||||
|
||||
def volume_changed(self) -> None:
|
||||
|
||||
Reference in New Issue
Block a user