Skip to content

Commit

Permalink
Merge pull request #1 from stianaske/master
Browse files Browse the repository at this point in the history
merging latest changes
  • Loading branch information
dshokouhi authored Jul 9, 2018
2 parents d3906d0 + d212a50 commit d0d188f
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 9 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ The code is based on https://github.com/kangguru/botvac and credit for reverse e
This API is experimental. Use at your own risk. Feel free to contribute if things are not working.

## Installation
Install by running setup.py
Install using pip

pip install pybotvac

Alternatively, clone the repository and run

python setup.py install

Expand Down
2 changes: 2 additions & 0 deletions pybotvac/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
from .account import Account
from .robot import Robot

__version__ = '0.0.7'
20 changes: 17 additions & 3 deletions pybotvac/robot.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# Disable warning due to SubjectAltNameWarning in certificate
requests.packages.urllib3.disable_warnings()

SUPPORTED_SERVICES = ['basic-1', 'minimal-2', 'basic-2']
SUPPORTED_SERVICES = ['basic-1', 'minimal-2', 'basic-2', 'basic-3']


class UnsupportedDevice(Exception):
Expand Down Expand Up @@ -56,10 +56,15 @@ def _message(self, json):
response.raise_for_status()
return response

def start_cleaning(self, mode=2, navigation_mode=2):
def start_cleaning(self, mode=2, navigation_mode=1, category=None):
# mode & naivigation_mode used if applicable to service version
# mode: 1 eco, 2 turbo
# navigation_mode: 1 normal, 2 extra care
# navigation_mode: 1 normal, 2 extra care, 3 deep
# category: 2 non-persistent map, 4 persistent map

#Default to using the persistent map if we support basic-3.
if category is None:
category = 4 if self.service_version == 'basic-3' else 2

if self.service_version == 'basic-1':
json = {'reqId': "1",
Expand All @@ -69,6 +74,15 @@ def start_cleaning(self, mode=2, navigation_mode=2):
'mode': mode,
'modifier': 1}
}
elif self.service_version == 'basic-3':
json = {'reqId': "1",
'cmd': "startCleaning",
'params': {
'category': 2,
'mode': mode,
'modifier': 1,
"navigationMode": navigation_mode}
}
elif self.service_version == 'minimal-2':
json = {'reqId': "1",
'cmd': "startCleaning",
Expand Down
12 changes: 7 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
from setuptools import setup
from pybotvac import __version__


with open('LICENSE') as f:
license = f.read()
with open('README.md', 'r') as f:
long_description = f.read()

setup(
name='pybotvac',
version='0.0.6',
version=__version__,
description='Python package for controlling Neato pybotvac Connected vacuum robot',
long_description=long_description,
long_description_content_type='text/markdown',
author='Stian Askeland',
author_email='stianaske@gmail.com',
url='https://github.com/stianaske/pybotvac',
license=license,
license='Licensed under the MIT license. See LICENSE file for details',
packages=['pybotvac'],
package_dir={'pybotvac': 'pybotvac'},
package_data={'pybotvac': ['cert/*.crt']}
Expand Down

0 comments on commit d0d188f

Please sign in to comment.