Skip to content

Commit

Permalink
set startCleaning param modifer to 1, per docs, add optional args for…
Browse files Browse the repository at this point in the history
… mode & navigationMode to startCleaning
  • Loading branch information
kvermilion committed Aug 5, 2017
1 parent 75bbb28 commit dedf9c7
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions pybotvac/robot.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,32 +49,35 @@ def _message(self, json):
response.raise_for_status()
return response

def start_cleaning(self):
def start_cleaning(self, mode=2, navigationMode=2):
# mode & naivigationMode used if applicable to service version
# mode: 1 eco, 2 turbo
# navigationMode: 1 normal, 2 extra care
serviceVersion = self.availableServices['houseCleaning']

if serviceVersion == 'basic-1':
json = {'reqId': "1",
'cmd': "startCleaning",
'params': {
'category': 2,
'mode': 2,
'modifier': 2}
'mode': mode,
'modifier': 1}
}
elif serviceVersion == 'minimal-2':
json = {'reqId': "1",
'cmd': "startCleaning",
'params': {
'category': 2,
"navigationMode": 2}
"navigationMode": navigationMode}
}
elif serviceVersion == 'basic-2':
json = {'reqId': "1",
'cmd': "startCleaning",
'params': {
'category': 2,
'mode': 2,
'modifier': 2,
"navigationMode": 2}
'mode': mode,
'modifier': 1,
"navigationMode": navigationMode}
}
else:
raise Exception("Version " + serviceVersion + " of service houseCleaning is not known")
Expand Down

0 comments on commit dedf9c7

Please sign in to comment.