DeebotUniverse / client.py

Deebot client library in python
https://deebot.readthedocs.io
GNU General Public License v3.0
27 stars 41 forks source link

Missing "angle" in Position #491

Closed lnx85 closed 3 months ago

lnx85 commented 3 months ago

Checks

The problem

The Position object is missing informations about the robot angle.

On which deebot device (vacuum) you have the issue?

Deebot N8

Which version of the deebot-client are you using?

7.2.0

Country

it

Continent

eu

Anything in the logs that might be useful for us?

Log for PositionsEvent (after a GetPos command).

Notify subscribers with PositionsEvent(positions=[Position(type=<PositionType.DEEBOT: 'deebotPos'>, x=-396, y=10), Position(type=<PositionType.CHARGER: 'chargePos'>, x=-396, y=10)])

The same request made with ecovacs-deebot.js (https://github.com/mrbungle64/ecovacs-deebot.js/blob/master/example/mapInfos.js) returns and object containg "x", "y" and "a" where "a" is bot orientation in degrees.

Additional information

The GetPos command is not documented but available in source code.

edenhaus commented 3 months ago

What would be a use-case for the angle?

lnx85 commented 3 months ago

I was using that parameter to show the direction of the robot while moving. image

edenhaus commented 3 months ago

Please feel free to add the angle via a PR :)

As I like your floorplan, can you share it?

lnx85 commented 3 months ago

Please feel free to add the angle via a PR :)

As I like your floorplan, can you share it?

Map has been created with Wondershare eDraw Max. In Home Assistant I have an automation that "translate" bot coordinates (x, y) to a float from 0 to 1 (used to position the Bot marker on the map with CSS left and top in percentage).

Angle (a) is used to rotate the bot image (0deg to 360deg)

lnx85 commented 3 months ago

Implemented in #499.