44
55from typing import TYPE_CHECKING
66
7- from deebot_client .events import FanSpeedEvent , FanSpeedLevel , StateEvent
7+ from deebot_client .events import (
8+ FanSpeedEvent ,
9+ FanSpeedLevel ,
10+ Position ,
11+ PositionsEvent ,
12+ StateEvent ,
13+ )
814from deebot_client .logging_filter import get_logger
915from deebot_client .message import HandlingResult
1016from deebot_client .messages .xml .common import XmlMessage
1117from deebot_client .models import CleanAction , State
18+ from deebot_client .rs .map import PositionType
1219
1320if TYPE_CHECKING :
1421 from xml .etree .ElementTree import Element
@@ -43,6 +50,8 @@ class CleanReport(XmlMessage):
4350 def _handle_xml (cls , event_bus : EventBus , xml : Element ) -> HandlingResult :
4451 """Handle xml message and notify the correct event subscribers.
4552
53+ b"<ctl ts='1744467249311' td='CleanReport'><clean type='auto' speed='standard' st='s' rsn='a' a='' l='' sts=''/></ctl>"
54+
4655 :return: A message response
4756 """
4857 if (clean := xml .find ("clean" )) is None :
@@ -64,3 +73,45 @@ def _handle_xml(cls, event_bus: EventBus, xml: Element) -> HandlingResult:
6473 _LOGGER .debug ("Ignored CleanState %s" , clean_action )
6574
6675 return HandlingResult .success ()
76+
77+
78+ class CleanReportServer (XmlMessage ):
79+ """CleanReportServer message."""
80+
81+ NAME = "CleanReportServer"
82+
83+ @classmethod
84+ def _handle_xml (cls , _event_bus : EventBus , _xml : Element ) -> HandlingResult :
85+ """Handle xml message and notify the correct event subscribers.
86+
87+ b"<ctl ts='1744467262312' td='CleanReportServer' act='s' type='auto' cs='1134230540'/>"
88+ b"<ctl ts='1744467393682' td='CleanReportServer' act='h' type='auto' sts='1744467262' cs='1134230540' area='1' last='76' mapCount='6'/>"
89+
90+ :return: A message response
91+ """
92+ return HandlingResult .analyse ()
93+
94+
95+ class CleanedPos (XmlMessage ):
96+ """CleanedPos message."""
97+
98+ NAME = "CleanedPos"
99+
100+ @classmethod
101+ def _handle_xml (cls , event_bus : EventBus , xml : Element ) -> HandlingResult :
102+ """Handle xml message and notify the correct event subscribers.
103+
104+ b"<ctl ts='1744467393682' td='CleanedPos' t='p' p='-2450,-996' a='-88' csid='1134230540'/>"
105+
106+ :return: A message response
107+ """
108+ if p := xml .attrib .get ("p" ):
109+ p_x , p_y = p .split ("," , 2 )
110+ p_a = xml .attrib .get ("a" , 0 )
111+ position = Position (
112+ type = PositionType .DEEBOT , x = int (p_x ), y = int (p_y ), a = int (p_a )
113+ )
114+ event_bus .notify (PositionsEvent (positions = [position ]))
115+ return HandlingResult .success ()
116+
117+ return HandlingResult .analyse ()
0 commit comments