Update SpotArea

Update SpotArea and CLI command to more closely reflect the app
Library:
SpotArea namedarea -> area
SpotArea customarea -> map_position

CLI Commands:
spotclean -> area
Ex: sucks area 0,1
  - will clean areas 0 and 1 / A and B

area options:
--map-postion|-p
  - will clean a specified map coordinate
Ex: sucks area -p "-602,1812,800,723"
  - will clean the specified custom map coordinates
This commit is contained in:
Brian Martin
2019-02-20 10:45:24 -05:00
parent bfca7e9e82
commit b7341b0735
3 changed files with 26 additions and 21 deletions
+6 -6
View File
@@ -1020,14 +1020,14 @@ class Stop(Clean):
super().__init__('stop', 'normal')
class SpotArea(Clean):
def __init__(self, action='start', namedarea='', customarea='', cleanings='1'):
if namedarea != '': #For cleaning specified map area
super().__init__('spot_area', 'normal', act=CLEAN_ACTION_TO_ECOVACS[action], mid=namedarea)
elif customarea != '': #For cleaning custom map area, and specify deep amount 1x/2x
super().__init__('spot_area' ,'normal',act=CLEAN_ACTION_TO_ECOVACS[action], p=customarea, deep=cleanings)
def __init__(self, action='start', area='', map_position='', cleanings='1'):
if area != '': #For cleaning specified area
super().__init__('spot_area', 'normal', act=CLEAN_ACTION_TO_ECOVACS[action], mid=area)
elif map_position != '': #For cleaning custom map area, and specify deep amount 1x/2x
super().__init__('spot_area' ,'normal',act=CLEAN_ACTION_TO_ECOVACS[action], p=map_position, deep=cleanings)
else:
#no valid entries
raise ValueError("must provide namedarea or customarea for spotarea clean")
raise ValueError("must provide area or map_position for spotarea clean")
class Charge(VacBotCommand):
def __init__(self):