koalazak / dorita980

Unofficial iRobot Roomba and Braava (i7/i7+, 980, 960, 900, e5, 690, 675, m6, etc) node.js library (SDK) to control your robot
MIT License
932 stars 147 forks source link

i7 Clean multiple Rooms in desired order #115

Closed warki closed 3 years ago

warki commented 4 years ago

I have an addition to cleanRoom. At least from Firmware Version 3.8.3 it is possible, to set the desired order in which rooms will be cleaned. Before, I was able to clean multiple rooms in one task, by adding them to the regions array. But unfortunatelly Roomba always started with the nearest room. Now, with the firmware 3.8.3, there is a new property "ordered", which can be set to "1".

A payload to clean three rooms in order foyer, family_room and kitchen in the desired order would be:

{
  "ordered": 1,
  "regions": [
    {
        "region_id": "11",
        "region_name": "Eingang",
        "region_type": "foyer",
    },
    {
        "region_id": "12",
         "region_name": "Wohnzimmer",
         "region_type": "family_room",
    },
    {
        "region_id": "8",
        "region_name": "Küche",
        "region_type": "kitchen",
    }
  ],
  "pmap_id": "S8v123456-1asd-1234567",
  "user_pmapv_id": "190113T132021"
}

This would be a good addition for the documentation.

warki commented 4 years ago

See Pull Request

binomialstew commented 3 years ago

Were you successful in getting cleanRooms to run with this arg format, @warki? I see in firmware 3.8.3, my regions do not have region_name or region_type. I don't know how I can get the name or region_type because these properties do not appear in my lastCommand state. I have been unsuccessful in using cleanRooms, and when I use "ordered": "1" it doesn't get a response from the m6 at all.

binomialstew commented 3 years ago

I now have ordered clean working with the new format, but only when using an integer for the "ordered" value rather than a string.

warki commented 3 years ago

I now have ordered clean working with the new format, but only when using an integer for the "ordered" value rather than a string.

Yes, you're right. I have used an integer value and not a string.

koalazak commented 3 years ago

nice! feel free to open a PR when you are done with the documentation. And please increase the patch part of the version in the package.json file so I can publish the new version to npm too. thank you@