How to use the pymyq.errors.MyQError function in pymyq

To help you get started, we’ve selected a few pymyq 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 arraylabs / pymyq / pymyq / errors.py View on Github external
"""Define exceptions."""


class MyQError(Exception):
    """Define a base exception."""

    pass


class RequestError(MyQError):
    """Define an exception related to bad HTTP requests."""

    pass


class UnsupportedBrandError(MyQError):
    """Define an exception related to unsupported brands."""

    pass
github arraylabs / pymyq / example.py View on Github external
print('Closing the device...')
                        await device.close()
                        print('    0 Current State: {0}'.format(device.state))
                        for waited in range(1, 30):
                            if device.state == STATE_CLOSED:
                                break
                            await asyncio.sleep(1)
                            await device.update()
                            print('    {} Current State: {}'.format(
                                waited, device.state))

                        await asyncio.sleep(10)
                        await device.update()
                        print()
                        print('Current State: {0}'.format(device.state))
        except MyQError as err:
            print(err)
github home-assistant / home-assistant / homeassistant / components / myq / cover.py View on Github external
async def async_setup_platform(hass, config, async_add_entities, discovery_info=None):
    """Set up the platform."""
    websession = aiohttp_client.async_get_clientsession(hass)

    username = config[CONF_USERNAME]
    password = config[CONF_PASSWORD]

    try:
        myq = await login(username, password, websession)
    except MyQError as err:
        _LOGGER.error("There was an error while logging in: %s", err)
        return

    async_add_entities([MyQDevice(device) for device in myq.covers.values()], True)
github arraylabs / pymyq / pymyq / errors.py View on Github external
"""Define exceptions."""


class MyQError(Exception):
    """Define a base exception."""

    pass


class RequestError(MyQError):
    """Define an exception related to bad HTTP requests."""

    pass


class UnsupportedBrandError(MyQError):
    """Define an exception related to unsupported brands."""

    pass