align actions with cleaning robot interface & use settings when cleaning
parent
93574d9693
commit
7187d54b3b
|
|
@ -176,7 +176,7 @@ def pollService():
|
||||||
pollTimer.start()
|
pollTimer.start()
|
||||||
|
|
||||||
|
|
||||||
def executeAction(info):
|
def executeAction(info):
|
||||||
if info.actionTypeId == robotStartCleaningActionTypeId:
|
if info.actionTypeId == robotStartCleaningActionTypeId:
|
||||||
refreshRobot(info.thing)
|
refreshRobot(info.thing)
|
||||||
if info.thing.stateValue(robotRobotStateStateTypeId) == "paused":
|
if info.thing.stateValue(robotRobotStateStateTypeId) == "paused":
|
||||||
|
|
@ -210,6 +210,28 @@ def executeAction(info):
|
||||||
info.finish(nymea.ThingErrorNoError)
|
info.finish(nymea.ThingErrorNoError)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
def cleanWithRobot(robotThing, mapID, boundaryID):
|
||||||
|
# To do: add a parameter to the start action which takes a zone id --> this should now be represented by mapID & boundaryID
|
||||||
|
robot = thingsAndRobots[robotThing]
|
||||||
|
logger.log("Cleaning with robot:", robot, robotThing)
|
||||||
|
boolEco = robotThing.setting(robotSettingsEcoParamTypeId)
|
||||||
|
boolCare = robotThing.setting(robotSettingsCareParamTypeId)
|
||||||
|
boolNogo = robotThing.setting(robotSettingsNoGoLinesParamTypeId)
|
||||||
|
if boolEco == False:
|
||||||
|
intEco = 2
|
||||||
|
else:
|
||||||
|
intEco = 1
|
||||||
|
if boolCare == False:
|
||||||
|
intCare = 1
|
||||||
|
else:
|
||||||
|
intCare = 2
|
||||||
|
if boolNogo == False:
|
||||||
|
intNogo = 2
|
||||||
|
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)
|
||||||
|
refreshRobot(robotThing)
|
||||||
|
|
||||||
def cleanWithRobot(robotThing, mapID, boundaryID):
|
def cleanWithRobot(robotThing, mapID, boundaryID):
|
||||||
# To do: add a parameter to the start action which takes a zone id --> this should now be represented by mapID & boundaryID
|
# To do: add a parameter to the start action which takes a zone id --> this should now be represented by mapID & boundaryID
|
||||||
|
|
@ -299,7 +321,6 @@ def executeBrowserItem(info):
|
||||||
info.finish(nymea.ThingErrorItemNotExecutable)
|
info.finish(nymea.ThingErrorItemNotExecutable)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def deinit():
|
def deinit():
|
||||||
global pollTimer
|
global pollTimer
|
||||||
# If we started a poll timer, cancel it on shutdown.
|
# If we started a poll timer, cancel it on shutdown.
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue