Update to interface changes

master
Michael Zanetti 2021-04-11 22:41:44 +02:00
parent e69aa17a8a
commit 2b07c19315
2 changed files with 6 additions and 22 deletions

View File

@ -145,16 +145,7 @@
{
"id": "1f774998-5fa7-4e3b-8ab0-a8402dd561bb",
"name": "startCleaning",
"displayName": "Start cleaning",
"paramTypes": [
{
"id": "08a86cca-cdc9-4520-af1d-8413a0c274b5",
"name": "zone",
"displayName": "Zones to clean",
"type": "QString",
"defaultValue": ""
}
]
"displayName": "Start cleaning"
},
{
"id": "e731faa6-88c9-406d-b505-f89b5f0868b0",

View File

@ -181,18 +181,11 @@ def executeAction(info):
zone = info.paramValue(robotStartCleaningActionZoneParamTypeId)
logger.log("zone", zone)
if zone != "":
ids = zone[9:];
mapId = ids.split(";")[0]
boundaryId = ids.split(";")[1]
cleanWithRobot(info.thing, mapId, boundaryId)
refreshRobot(info.thing)
if info.thing.stateValue(robotRobotStateStateTypeId) == "paused":
thingsAndRobots[info.thing].resume_cleaning()
else:
refreshRobot(info.thing)
if info.thing.stateValue(robotRobotStateStateTypeId) == "paused":
thingsAndRobots[info.thing].resume_cleaning()
else:
cleanWithRobot(info.thing, None, None)
cleanWithRobot(info.thing, None, None)
refreshRobot(info.thing)
info.finish(nymea.ThingErrorNoError)
@ -241,7 +234,7 @@ def cleanWithRobot(robotThing, mapID, boundaryID):
else:
intNogo = 4
logger.log("Settings: Eco:", boolEco, "Care:", boolCare, "Enable nogo:", boolNogo, "mapID:", mapID, "boundaryID:", boundaryID)
thingsAndRobots[robotThing].start_cleaning(mode=intEco, navigation_mode=intCare, category=intNogo, boundary_id=boundaryID, map_id=mapID)
# thingsAndRobots[robotThing].start_cleaning(mode=intEco, navigation_mode=intCare, category=intNogo, boundary_id=boundaryID, map_id=mapID)
def browseThing(browseResult):