File tree Expand file tree Collapse file tree
deebot_client/messages/xml Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44
55from typing import TYPE_CHECKING
66
7- from deebot_client .events .map import MapTraceEvent
7+ from deebot_client .events .map import MapTraceEvent , MinorMapEvent
88from deebot_client .message import HandlingResult
99from deebot_client .messages .xml .common import XmlMessage
1010
@@ -23,15 +23,17 @@ class MapP(XmlMessage):
2323 NAME = "MapP"
2424
2525 @classmethod
26- def _handle_xml (cls , _event_bus : EventBus , _xml : Element ) -> HandlingResult :
26+ def _handle_xml (cls , event_bus : EventBus , xml : Element ) -> HandlingResult :
2727 """Handle xml message and notify the correct event subscribers.
2828
2929 b"<ctl td='MapP' i='1245233875' pid='27' p='XQAABAAQJwAAAABv/f//o7f/Rz5IFXI5YVG4kYRDU5g6Z4W8UflplyVyfWyHmYdt2YVgA/k3ENxVye1lEM...fqEp3pept9Re5qT0lZFDWpoFg4D51VXQopPSDLSo2ZpM/zQ4IAhvgWIKnp7zlwcd6Ekj7U2FnOTTAQeWq3DPT+MTrAVO2wL/6mmGODzk4hBtA/wjZzOujPgEA=='/>"
3030
31- This is currently ignored as we prefer to pull map pieces
3231 :return: A message response
3332 """
34- return HandlingResult .success ()
33+ if (pid := xml .attrib .get ("pid" )) and (piece := xml .attrib .get ("p" )):
34+ event_bus .notify (MinorMapEvent (index = int (pid ), value = piece ))
35+ return HandlingResult .success ()
36+ return HandlingResult .analyse ()
3537
3638
3739class Trace (XmlMessage ):
You can’t perform that action at this time.
0 commit comments