How to use the pybotvac.robot.Robot 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 stianaske / pybotvac / pybotvac / account.py View on Github external
"""

        try:
            resp = requests.get(urljoin(self._endpoint, 'dashboard'),
                                headers=self._headers)
            resp.raise_for_status()
        except (requests.exceptions.ConnectionError,
                requests.exceptions.HTTPError):
            raise NeatoRobotException("Unable to refresh robots")

        for robot in resp.json()['robots']:
            if robot['mac_address'] is None:
                continue    # Ignore robots without mac-address

            try:
                self._robots.add(Robot(name=robot['name'],
                                       vendor=self._vendor,
                                       serial=robot['serial'],
                                       secret=robot['secret_key'],
                                       traits=robot['traits'],
                                       endpoint=robot['nucleo_url']))
            except NeatoRobotException:
                print ("Your '{}' robot is offline.".format(robot['name']))
                continue

        self.refresh_persistent_maps()
        for robot in self._robots:
            robot.has_persistent_maps = robot.serial in self._persistent_maps

pybotvac

Python package for controlling Neato pybotvac Connected vacuum robot

MIT
Latest version published 7 months ago

Package Health Score

56 / 100
Full package analysis

Similar packages