From e3fca48b2338ee17c741585b580b9562fa2a7834 Mon Sep 17 00:00:00 2001 From: Marcel van der Veldt Date: Mon, 26 Aug 2024 15:30:15 +0200 Subject: [PATCH] lint --- aiosonos/group.py | 12 +++--------- pyproject.toml | 4 +++- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/aiosonos/group.py b/aiosonos/group.py index 7d6adf5..849965f 100644 --- a/aiosonos/group.py +++ b/aiosonos/group.py @@ -70,9 +70,7 @@ def __init__(self, client: SonosLocalApiClient, data: GroupData) -> None: positionMillis=0, previousPositionMillis=0, ) - self._playback_metadata_data: MetadataStatus = MetadataStatus( - objectType="metadataStatus" - ) + self._playback_metadata_data: MetadataStatus = MetadataStatus(objectType="metadataStatus") self._playback_status_last_updated: float = 0.0 self._unsubscribe_callbacks = [] @@ -87,9 +85,7 @@ async def async_init(self) -> None: # grab playback data and setup subscription try: self._volume_data = await self.client.api.group_volume.get_volume(self.id) - self._playback_status_data = ( - await self.client.api.playback.get_playback_status(self.id) - ) + self._playback_status_data = await self.client.api.playback.get_playback_status(self.id) self._playback_status_last_updated = time.time() self._playback_actions = PlaybackActions( self._playback_status_data["availablePlaybackActions"], @@ -214,9 +210,7 @@ def active_service(self) -> MusicService | None: """Return the active service of the active source of this group (if any).""" if not (container := self._playback_metadata_data.get("container")): return None - if (container_id := container.get("id")) and ( - service_id := container_id.get("serviceId") - ): + if (container_id := container.get("id")) and (service_id := container_id.get("serviceId")): if service_id in MusicService: return MusicService(service_id) # return the raw string value if it's not a known container type diff --git a/pyproject.toml b/pyproject.toml index 520fe2f..150e6e3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -135,8 +135,10 @@ ignore = [ "S101", # assert is often used to satisfy type checking "TD002", # Just annoying, not really useful "TD003", # Just annoying, not really useful - "TD004", # Just annoying, not really useful # Conflicts with the Ruff formatter + "TD004", # Just annoying, not really useful "TRY003", # Just annoying, not really useful + "COM812", # Conflicts with the Ruff formatter + "ISC001", # Conflicts with the Ruff formatter ] select = ["ALL"]