Fixes according to SonerLint

This commit is contained in:
kokarare1212
2021-07-31 20:42:13 +09:00
parent 3f81de1610
commit bee0ad3ec1
14 changed files with 57 additions and 59 deletions

View File

@@ -19,15 +19,15 @@ class Player(Closeable, PlayerSession.Listener, AudioSink.Listener):
VOLUME_MAX: int = 65536
_LOGGER: logging = logging.getLogger(__name__)
_scheduler: sched.scheduler = sched.scheduler(time.time)
_session: Session = None
_conf: PlayerConfiguration = None
_events: Player.EventsDispatcher = None
_sink: AudioSink = None
_session: Session
_conf: PlayerConfiguration
_events: Player.EventsDispatcher
_sink: AudioSink
_metrics: typing.Dict[str, PlaybackMetrics] = {}
_state: StateWrapper = None
_playerSession: PlayerSession = None
_state: StateWrapper
_playerSession: PlayerSession
_releaseLineFuture = None
_deviceStateListener: DeviceStateHandler.Listener = None
_deviceStateListener: DeviceStateHandler.Listener
def __init__(self, conf: PlayerConfiguration, session: Session):
self._conf = conf

View File

@@ -17,13 +17,13 @@ from librespot.proto import Player_pb2 as Player
class DeviceStateHandler:
_LOGGER: logging = logging.getLogger(__name__)
_session: Session = None
_deviceInfo: Connect.DeviceInfo = None
_session: Session
_deviceInfo: Connect.DeviceInfo
_listeners: typing.List[DeviceStateHandler.Listener] = []
_putState: Connect.PutStateRequest = None
_putState: Connect.PutStateRequest
_putStateWorker: concurrent.futures.ThreadPoolExecutor = (
concurrent.futures.ThreadPoolExecutor())
_connectionId: str = None
_connectionId: str
def __init__(self, session: Session, player, conf: PlayerConfiguration):
self._session = session
@@ -101,9 +101,9 @@ class DeviceStateHandler:
pass
class CommandBody:
_obj: typing.Any = None
_data: bytes = None
_value: str = None
_obj: typing.Any
_data: bytes
_value: str
def __init__(self, obj: typing.Any):
self._obj = obj