Skip to content

Commit

Permalink
Fix check connect decorator
Browse files Browse the repository at this point in the history
  • Loading branch information
Strixx76 committed Aug 22, 2024
1 parent 8b64bb8 commit e6b1358
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions custom_components/samsungwam/media_player.py
Original file line number Diff line number Diff line change
Expand Up @@ -352,27 +352,27 @@ async def async_set_volume_level(self, volume: float) -> None:
"""Set volume level, range 0..1."""
await self.speaker.set_volume(int(volume * 100))

@async_check_connection
@async_check_connection(False)
async def async_media_play(self) -> None:
"""Send play command."""
await self.speaker.cmd_play()

@async_check_connection
@async_check_connection(False)
async def async_media_pause(self) -> None:
"""Send pause command."""
await self.speaker.cmd_pause()

@async_check_connection
@async_check_connection(False)
async def async_media_stop(self) -> None:
"""Send stop command."""
await self.speaker.cmd_stop()

@async_check_connection
@async_check_connection(False)
async def async_media_previous_track(self) -> None:
"""Send previous track command."""
await self.speaker.cmd_previous()

@async_check_connection
@async_check_connection(False)
async def async_media_next_track(self) -> None:
"""Send next track command."""
await self.speaker.cmd_next()
Expand Down Expand Up @@ -481,7 +481,7 @@ async def _wam_async_process_play_media_url(self, url: str) -> UrlMediaItem | No
duration=item.duration,
)

@async_check_connection
@async_check_connection(False)
async def async_play_media(
self,
media_type: MediaType | str,
Expand Down Expand Up @@ -549,12 +549,12 @@ async def async_clear_playlist(self):
"""Clear players playlist."""
raise NotImplementedError()

@async_check_connection
@async_check_connection(False)
async def async_set_shuffle(self, shuffle) -> None:
"""Enable/disable shuffle mode."""
await self.speaker.set_shuffle(shuffle)

@async_check_connection
@async_check_connection(False)
async def async_set_repeat(self, repeat) -> None:
"""Set repeat mode."""
await self.speaker.set_repeat_mode(REPEAT_TO_WAM[repeat])
Expand Down

0 comments on commit e6b1358

Please sign in to comment.