How to use the pychromecast.error.PyChromecastError function in PyChromecast

To help you get started, we’ve selected a few PyChromecast examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github tizonia / tizonia-openmax-il / clients / chromecast / chromecastproxy / tizchromecastproxy.py View on Github external
def media_vol(self, volume):
        vol = volume / 100
        try:
            self.cast.set_volume(vol)
        except PyChromecastError:
            pass
github balloob / pychromecast / pychromecast / error.py View on Github external
"""
Errors to be used by PyChromecast.
"""


class PyChromecastError(Exception):
    """ Base error for PyChromecast. """


class NoChromecastFoundError(PyChromecastError):
    """
    When a command has to auto-discover a Chromecast and cannot find one.
    """


class MultipleChromecastsFoundError(PyChromecastError):
    """
    When getting a singular chromecast results in getting multiple chromecasts.
    """


class ChromecastConnectionError(PyChromecastError):
    """ When a connection error occurs within PyChromecast. """


class LaunchError(PyChromecastError):
    """ When an app fails to launch. """


class PyChromecastStopped(PyChromecastError):
    """ Raised when a command is invoked while the Chromecast's socket_client
    is stopped.
github balloob / pychromecast / pychromecast / error.py View on Github external
"""
    When a command has to auto-discover a Chromecast and cannot find one.
    """


class MultipleChromecastsFoundError(PyChromecastError):
    """
    When getting a singular chromecast results in getting multiple chromecasts.
    """


class ChromecastConnectionError(PyChromecastError):
    """ When a connection error occurs within PyChromecast. """


class LaunchError(PyChromecastError):
    """ When an app fails to launch. """


class PyChromecastStopped(PyChromecastError):
    """ Raised when a command is invoked while the Chromecast's socket_client
    is stopped.

    """


class NotConnected(PyChromecastError):
    """
    Raised when a command is invoked while not connected to a Chromecast.
    """
github balloob / pychromecast / pychromecast / error.py View on Github external
"""
Errors to be used by PyChromecast.
"""


class PyChromecastError(Exception):
    """ Base error for PyChromecast. """


class NoChromecastFoundError(PyChromecastError):
    """
    When a command has to auto-discover a Chromecast and cannot find one.
    """


class MultipleChromecastsFoundError(PyChromecastError):
    """
    When getting a singular chromecast results in getting multiple chromecasts.
    """


class ChromecastConnectionError(PyChromecastError):
    """ When a connection error occurs within PyChromecast. """


class LaunchError(PyChromecastError):
github erik / lastcast / lastcast / __init__.py View on Github external
def poll(self):
        ''' Helper for `_poll` to handle errors and reconnects. '''
        try:
            if not self.cast:
                click.echo('Reconnecting to cast device `%s`...' % self.cast_name)
                self._connect_chromecast()
            else:
                self._poll()

        # This could happen due to network hiccups, Chromecast
        # restarting, race conditions, etc...
        except (PyChromecastError, pylast.NetworkError):
            logger.info('poll(%s) failed', self.cast_name, exc_info=True)
            self.cast = None
github balloob / pychromecast / pychromecast / error.py View on Github external
class ChromecastConnectionError(PyChromecastError):
    """ When a connection error occurs within PyChromecast. """


class LaunchError(PyChromecastError):
    """ When an app fails to launch. """


class PyChromecastStopped(PyChromecastError):
    """ Raised when a command is invoked while the Chromecast's socket_client
    is stopped.

    """


class NotConnected(PyChromecastError):
    """
    Raised when a command is invoked while not connected to a Chromecast.
    """


class UnsupportedNamespace(PyChromecastError):
    """
    Raised when trying to send a message with a namespace that is not
    supported by the current running app.
    """


class ControllerNotRegistered(PyChromecastError):
    """
    Raised when trying to interact with a controller while it is
github balloob / pychromecast / pychromecast / error.py View on Github external
""" Base error for PyChromecast. """


class NoChromecastFoundError(PyChromecastError):
    """
    When a command has to auto-discover a Chromecast and cannot find one.
    """


class MultipleChromecastsFoundError(PyChromecastError):
    """
    When getting a singular chromecast results in getting multiple chromecasts.
    """


class ChromecastConnectionError(PyChromecastError):
    """ When a connection error occurs within PyChromecast. """


class LaunchError(PyChromecastError):
    """ When an app fails to launch. """


class PyChromecastStopped(PyChromecastError):
    """ Raised when a command is invoked while the Chromecast's socket_client
    is stopped.

    """


class NotConnected(PyChromecastError):
    """
github balloob / pychromecast / pychromecast / error.py View on Github external
class MultipleChromecastsFoundError(PyChromecastError):
    """
    When getting a singular chromecast results in getting multiple chromecasts.
    """


class ChromecastConnectionError(PyChromecastError):
    """ When a connection error occurs within PyChromecast. """


class LaunchError(PyChromecastError):
    """ When an app fails to launch. """


class PyChromecastStopped(PyChromecastError):
    """ Raised when a command is invoked while the Chromecast's socket_client
    is stopped.

    """


class NotConnected(PyChromecastError):
    """
    Raised when a command is invoked while not connected to a Chromecast.
    """


class UnsupportedNamespace(PyChromecastError):
    """
    Raised when trying to send a message with a namespace that is not
    supported by the current running app.
github balloob / pychromecast / pychromecast / error.py View on Github external
class NotConnected(PyChromecastError):
    """
    Raised when a command is invoked while not connected to a Chromecast.
    """


class UnsupportedNamespace(PyChromecastError):
    """
    Raised when trying to send a message with a namespace that is not
    supported by the current running app.
    """


class ControllerNotRegistered(PyChromecastError):
    """
    Raised when trying to interact with a controller while it is
github balloob / pychromecast / pychromecast / error.py View on Github external
class PyChromecastStopped(PyChromecastError):
    """ Raised when a command is invoked while the Chromecast's socket_client
    is stopped.

    """


class NotConnected(PyChromecastError):
    """
    Raised when a command is invoked while not connected to a Chromecast.
    """


class UnsupportedNamespace(PyChromecastError):
    """
    Raised when trying to send a message with a namespace that is not
    supported by the current running app.
    """


class ControllerNotRegistered(PyChromecastError):
    """
    Raised when trying to interact with a controller while it is