From d1b00de5423740861f0bd20fbf7272eb70125c7c Mon Sep 17 00:00:00 2001 From: loosrob <79396812+loosrob@users.noreply.github.com> Date: Thu, 25 Mar 2021 17:48:30 +0100 Subject: [PATCH] obtain map boundary info added code to display boundary info in log -- it doesn't "do" anything yet but displays the string rbtBoundData to analyse how to integrate this into the start cleaning operation --- neatobotvac/integrationpluginneatobotvac.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/neatobotvac/integrationpluginneatobotvac.py b/neatobotvac/integrationpluginneatobotvac.py index d12411b6..915ac221 100644 --- a/neatobotvac/integrationpluginneatobotvac.py +++ b/neatobotvac/integrationpluginneatobotvac.py @@ -88,11 +88,14 @@ def setupThing(info): logger.log("MapId type: ", type(mapId), " MapId contents: ", mapId) mapName = mapInfo2['name'] logger.log("MapName type: ", type(mapName), " MapName contents: ", mapName) - mapIDshort = mapId + rbtMapBound = robot.get_map_boundaries(mapId) + logger.log("rbtMapBound Type: ", type(rbtMapBound), "rbtMapBound Contents: ", rbtMapBound) + rbtBoundData = rbtMapBound.text + logger.log("rbtBoundData Type: ", type(rbtBoundData), "rbtBoundData Contents: ", rbtBoundData) thingDescriptor.params = [ nymea.Param(robotThingSerialParamTypeId, robot.serial), nymea.Param(robotThingSecretParamTypeId, robot.secret), - nymea.Param(robotThingMapIdParamTypeId, mapIDshort) + nymea.Param(robotThingMapIdParamTypeId, mapId) ] thingDescriptors.append(thingDescriptor) @@ -203,9 +206,11 @@ def executeAction(info): # To do: get available boundaries to use with start_cleaning action if info.actionTypeId == robotGetBoundariesActionTypeId: - # rbtMapBound = thingsAndRobots[info.thing].get_map_boundaries() - # rbtMapBoundJson = rbtMapBound.json() - # logger.log("Robot Map Boundaries", rbtMapBoundJson) + mapIDparam = info.thing.paramValue(robotThingMapIdParamTypeId) + rbtMapBound = thingsAndRobots[info.thing].get_map_boundaries(mapIDparam) + logger.log("rbtMapBound Type: ", type(rbtMapBound), "rbtMapBound Contents: ", rbtMapBound) + rbtBoundData = rbtMapBound.text + logger.log("rbtBoundData Type: ", type(rbtBoundData), "rbtBoundData Contents: ", rbtBoundData) threading.Timer(5, pollService).start() info.finish(nymea.ThingErrorNoError)