platypush/plugins/music/spotify/__init__.py
def play(self, resource: Optional[str] = None, device: Optional[str] = None):
        """
        Change the playback state of a device to ``PLAY`` or start playing a specific resource.

        :param resource: Resource to play, in Spotify URI format (e.g. ``spotify:track:xxxxxxxxxxxxxxxxxxxxxx``).
            If none is specified then the method will change the playback state to ``PLAY``.
        :param device: Device ID or name. If none is specified then the action will target the currently active device.
        """
        if device:
            device = self._get_device(device)['id']

        self.spotify_user_call(
            '/v1/me/player/play',
            method='put',
            json={'uris': [resource]} if resource else {},
            params={
                **({'device_id': device} if device else {}),
            },
        )

        Change the playback state of a device to ``PLAY`` or start playing a specific resource.

        :param resource: Resource to play, in Spotify URI format (e.g. ``spotify:track:xxxxxxxxxxxxxxxxxxxxxx``).
            If none is specified then the method will change the playback state to ``PLAY``.
        :param device: Device ID or name. If none is specified then the action will target the currently active device.
        
Change the playback state of a device to ``PLAY`` or start playing a specific resource.
Change the playback state of a device to ` ` PLAY ` ` or start playing a specific resource .
def play(self, resource: Optional[str] = None, device: Optional[str] = None):
        if device:
            device = self._get_device(device)['id']
        self.spotify_user_call(
            '/v1/me/player/play',
            method='put',
            json={'uris': [resource]} if resource else {},
            params={
                **({'device_id': device} if device else {}),
            },
        )
def play ( self , resource : Optional [ str ] = None , device : Optional [ str ] = None ) : if device : device = self . _get_device ( device ) [ 'id' ] self . spotify_user_call ( '/v1/me/player/play' , method = 'put' , json = { 'uris' : [ resource ] } if resource else { } , params = { ** ( { 'device_id' : device } if device else { } ) , } , )
Change the playback state of a device to ``PLAY`` or start playing a specific resource.
Change the playback state of a device to ` ` PLAY ` ` or start playing a specific resource .
"""
        Change the playback state of a device to ``PLAY`` or start playing a specific resource.

        :param resource: Resource to play, in Spotify URI format (e.g. ``spotify:track:xxxxxxxxxxxxxxxxxxxxxx``).
            If none is specified then the method will change the playback state to ``PLAY``.
        :param device: Device ID or name. If none is specified then the action will target the currently active device.
        """
self
resource
Optional[str]
Resource to play, in Spotify URI format .
If none is specified then the method will change the playback state to ``PLAY``.
Resource to play in Spotify URI format . If none is specified then the method will change the playback state to ` ` PLAY ` ` .
device
Optional[str]
Device ID or name. If none is specified then the action will target the currently active device.
Device ID or name . If none is specified then the action will target the currently active device .