Replace pylint protected-access with Ruff SLF001 (#115735)

This commit is contained in:
Sid 2024-05-06 20:33:26 +02:00 committed by GitHub
parent 460c05dc43
commit b456d97e65
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
90 changed files with 168 additions and 223 deletions

View file

@ -162,7 +162,7 @@ class CastStatusListener(
self._valid = True
self._mz_mgr = mz_mgr
if cast_device._cast_info.is_audio_group:
if cast_device._cast_info.is_audio_group: # noqa: SLF001
self._mz_mgr.add_multizone(chromecast)
if mz_only:
return
@ -170,7 +170,7 @@ class CastStatusListener(
chromecast.register_status_listener(self)
chromecast.socket_client.media_controller.register_status_listener(self)
chromecast.register_connection_listener(self)
if not cast_device._cast_info.is_audio_group:
if not cast_device._cast_info.is_audio_group: # noqa: SLF001
self._mz_mgr.register_listener(chromecast.uuid, self)
def new_cast_status(self, status):
@ -214,8 +214,7 @@ class CastStatusListener(
All following callbacks won't be forwarded.
"""
# pylint: disable-next=protected-access
if self._cast_device._cast_info.is_audio_group:
if self._cast_device._cast_info.is_audio_group: # noqa: SLF001
self._mz_mgr.remove_multizone(self._uuid)
else:
self._mz_mgr.deregister_listener(self._uuid, self)