How to use the pybotvac.Account function in pybotvac

To help you get started, we’ve selected a few pybotvac 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 dshokouhi / hass-neato-custom-component / neato / config_flow.py View on Github external
def try_login(username, password, vendor):
        """Try logging in to device and return any errors."""
        this_vendor = None
        if vendor == "vorwerk":
            this_vendor = Vorwerk()
        else:  # Neato
            this_vendor = Neato()

        try:
            Account(username, password, this_vendor)
        except NeatoLoginException:
            return "invalid_credentials"
        except NeatoRobotException:
            return "unexpected_error"

        return None
github dshokouhi / hass-neato-custom-component / neato / __init__.py View on Github external
async def async_setup_entry(hass, entry):
    """Set up config entry."""
    hub = NeatoHub(hass, entry.data, Account)

    await hass.async_add_executor_job(hub.login)
    if not hub.logged_in:
        _LOGGER.debug("Failed to login to Neato API")
        return False

    try:
        await hass.async_add_executor_job(hub.update_robots)
    except NeatoRobotException:
        _LOGGER.debug("Failed to connect to Neato API")
        raise ConfigEntryNotReady

    hass.data[NEATO_LOGIN] = hub

    for component in ("camera", "vacuum", "switch", "sensor"):
        hass.async_add_job(
github home-assistant / home-assistant / homeassistant / components / neato / config_flow.py View on Github external
def try_login(username, password, vendor):
        """Try logging in to device and return any errors."""
        this_vendor = None
        if vendor == "vorwerk":
            this_vendor = Vorwerk()
        else:  # Neato
            this_vendor = Neato()

        try:
            Account(username, password, this_vendor)
        except NeatoLoginException:
            return "invalid_credentials"
        except NeatoRobotException:
            return "unexpected_error"

        return None
github home-assistant / home-assistant / homeassistant / components / neato / __init__.py View on Github external
async def async_setup_entry(hass, entry):
    """Set up config entry."""
    hass.data[NEATO_LOGIN] = NeatoHub(hass, entry.data, Account)

    hub = hass.data[NEATO_LOGIN]
    await hass.async_add_executor_job(hub.login)
    if not hub.logged_in:
        _LOGGER.debug("Failed to login to Neato API")
        return False

    try:
        await hass.async_add_executor_job(hub.update_robots)
    except NeatoRobotException:
        _LOGGER.debug("Failed to connect to Neato API")
        return False

    for component in ("camera", "vacuum", "switch", "sensor"):
        hass.async_create_task(
            hass.config_entries.async_forward_entry_setup(entry, component)
github stianaske / pybotvac / sample / sample.py View on Github external
import sys

from pybotvac import Account, Vorwerk

if sys.version_info[0] < 3:
    input = raw_input

email = input('Enter email\n')
password = input('Enter password\n')

vendor = Vorwerk()


account = Account(email, password, vendor)

print("Robots:")
for robot in account.robots:
    print(robot)
    print()

    print("State:\n", robot.state)
    print()

    print("Schedule enabled:", robot.schedule_enabled)

    print("Disabling schedule")
    robot.schedule_enabled = False

    print("Schedule enabled:", robot.schedule_enabled)
github home-assistant / home-assistant / homeassistant / components / neato.py View on Github external
def setup(hass, config):
    """Set up the Neato component."""
    from pybotvac import Account

    hass.data[NEATO_LOGIN] = NeatoHub(hass, config[DOMAIN], Account)
    hub = hass.data[NEATO_LOGIN]
    if not hub.login():
        _LOGGER.debug("Failed to login to Neato API")
        return False
    hub.update_robots()
    for component in ('camera', 'vacuum', 'switch'):
        discovery.load_platform(hass, component, DOMAIN, {}, config)

    return True
github CCOSTAN / Home-AssistantConfig / config / custom_components / neato.py View on Github external
def setup(hass, config):
    """Set up the Neato component."""
    from pybotvac import Account

    hass.data[NEATO_LOGIN] = NeatoHub(hass, config[DOMAIN], Account)
    hub = hass.data[NEATO_LOGIN]
    if not hub.login():
        _LOGGER.debug("Failed to login to Neato API")
        return False
    hub.update_robots()
    for component in ('camera', 'vacuum', 'switch'):
        discovery.load_platform(hass, component, DOMAIN, {}, config)

    return True

pybotvac

Python package for controlling Neato pybotvac Connected vacuum robot

MIT
Latest version published 6 months ago

Package Health Score

56 / 100
Full package analysis

Similar packages