stianaske / pybotvac

Python module for interacting with Neato Botvac Connected vacuum robots.
MIT License
84 stars 44 forks source link

.maps response #38

Open Brutuss opened 5 years ago

Brutuss commented 5 years ago

Thanks for this great API!

Default commands like Start, Stop, Dock are now working great in my home automation Domoticz. Now I would like to go a little deeper and download de latest Map but I think something is wrong. I have a Botvac D5.

When running this command: from pybotvac import Account for robot in Account('sample@email.com', 'sample_password').robots: print(robot)

I get this reply: Name: , Serial: ****-****, Secret: ***** Traits: Brutus Bot

When running this command: from pybotvac import Account for map_info in Account('sample@email.com', 'sample_password').maps: print(map_info)

I only get the serial number of the D5 in return. So I can't get the "download_link" URL for the following command:

from pybotvac import Account map = Account('sample@email.com', 'sample_password').maps download_link = map['robot_serial']['maps'][0]['url'] Account('sample@email.com', 'sample_password').get_map_image('download_link')

Any Ideas?

Greetings.

Brutuss commented 5 years ago

No one?

stianaske commented 5 years ago

I don't have a D5, so I'm just guessing here, but is it possible that the D5 uses the 'persistent maps', and not the 'maps' that Botvac Connected is using?

You can check this by running

from pybotvac import Account
for map_info in Account('sample@email.com', 'sample_password').persistent_maps:
  print(map_info)
Brutuss commented 5 years ago

I don't have a D5, so I'm just guessing here, but is it possible that the D5 uses the 'persistent maps', and not the 'maps' that Botvac Connected is using?

You can check this by running

from pybotvac import Account
for map_info in Account('sample@email.com', 'sample_password').persistent_maps:
  print(map_info)

Thank you for your reply!

I have tested this but then the answer is blank and you get the command prompt back (>>>) So I get no output :(

I noticed that when I run the following command:

from pybotvac import Account for robot in Account('sample@email.com', 'sample_password').robots: print(robot)

I receive: Name: Bot Name Serial: xxxxxxxxx, Secret: xxxxxxxx Traits: ['maps', 'persistent_maps']

Before that was: Name: Bot Name Serial: xxxxxxxxx, Secret: xxxxxxxx Traits: ['maps']

When I ask: for map_info in Account('sample@email.com', 'sample_password').maps:

I still receive the serial number.

fermulator commented 4 years ago

Same on Botvac Connected. The maps trait only returns serial.

>>> for robot in Account('<snip_username>', '<snip_password>').robots:
...   print(robot)
... 
Your 'boyle-ORIGINAL' robot is offline.
Name: boyle, Serial: OPS26517-(SNIP), Secret: (SNIP) Traits: ['maps']

>>> for map_info in Account('<snip_username>', '<snip_password>').maps:
...   print(map_info)
... 
Your 'boyle-ORIGINAL' robot is offline.
OPS26517-(SNIP)

>>> for map_info in Account('<snip_username>', '<snip_password>').persistent_maps:
...   print(map_info)
... 
(empty)
fermulator commented 4 years ago

Is it because the nucleo API doesn't support maps?

https://github.com/stianaske/pybotvac/blob/master/pybotvac/account.py#L129 https://github.com/stianaske/pybotvac/blob/master/pybotvac/account.py#L96

Nucleo: https://developers.neatorobotics.com/api/nucleo (no mention of maps)

Compare w/ beehive: https://developers.neatorobotics.com/api/beehive (has maps ref)