-
-
Notifications
You must be signed in to change notification settings - Fork 94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added room name information to Position object #397
base: dev
Are you sure you want to change the base?
Added room name information to Position object #397
Conversation
added room_id to Position obj current_room_id on device fix add room_id on PositionEvent removed current_room_id semplified get and set device rooms added room_name to position fix map property don't used yet expose room name in position object
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please make sure the CI is passing
if self.name == "getPos": | ||
response["resp"]["body"]["data"]["rooms"] = rooms |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this needed?
getPos
specific code should go into the GetPos
class and not in the general Command
class.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know how to pass rooms parameter to GetPos class. This is the only way I've found. Help me?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this code should be in map.py
and not in the command. The commands module is what we get from the API and we should not do calculations there.
Instead I think the calculation should be part of map.py
, where you already have the rooms and the position
@@ -80,6 +85,12 @@ async def on_pos(event: PositionsEvent) -> None: | |||
|
|||
self.events.subscribe(PositionsEvent, on_pos) | |||
|
|||
async def on_rooms(event: RoomsEvent) -> None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should go into map.py
deebot_client/map.py
Outdated
@@ -407,7 +408,10 @@ async def on_map_set(event: MapSetEvent) -> None: | |||
|
|||
async def on_map_subset(event: MapSubsetEvent) -> None: | |||
if event.type == MapSetType.ROOMS and event.name: | |||
room = Room(event.name, event.id, event.coordinates) | |||
decompressed_coords = _decompress_7z_base64_data(event.coordinates).decode('utf-8') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Compressed coordinates are Part of GetMapSubset_V2
but not the GetMapSubset
and therefore should be in the command class otherwise this code will break older bots
No description provided.