Skip to content

Commit efbe75e

Browse files
committed
Remove GetMapTrace V2 parsing and xmp9ds test
GetMapTrace V2 format is better handled by upstream PRs DeebotUniverse#1565 and DeebotUniverse#1567. The xmp9ds test duplicates existing coverage per maintainer feedback on DeebotUniverse#1564. https://claude.ai/code/session_01YFYjxwixRZrtjfv1aUfoVQ
1 parent 2709b04 commit efbe75e

2 files changed

Lines changed: 7 additions & 36 deletions

File tree

deebot_client/commands/json/map/__init__.py

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -331,21 +331,15 @@ def _handle_body_data_dict(
331331
332332
:return: A message response
333333
"""
334-
if "traceValue" in data:
335-
# V1 format: totalCount, traceStart, traceValue
336-
total = int(data["totalCount"])
337-
start = int(data["traceStart"])
338-
trace_data = data["traceValue"]
339-
elif "info" in data:
340-
# V2 format (mowers): serial, index, info, infoSize
341-
total = int(data.get("serial", 0))
342-
start = int(data.get("index", 0))
343-
trace_data = data["info"]
344-
else:
334+
total = int(data["totalCount"])
335+
start = int(data["traceStart"])
336+
337+
if "traceValue" not in data:
338+
# TODO verify that this is legit
345339
return HandlingResult.analyse()
346340

347341
event_bus.notify(
348-
MapTraceEvent(start=start, total=total, data=trace_data)
342+
MapTraceEvent(start=start, total=total, data=data["traceValue"])
349343
)
350344
return HandlingResult(HandlingState.SUCCESS, {"start": start, "total": total})
351345

tests/hardware/test_init.py

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -244,31 +244,8 @@ async def test_get_static_device_info(
244244
WaterAmountEvent: [GetWaterInfo()],
245245
},
246246
),
247-
(
248-
"xmp9ds",
249-
{
250-
AdvancedModeEvent: [GetAdvancedMode()],
251-
AvailabilityEvent: [GetBattery(is_available_check=True)],
252-
BatteryEvent: [GetBattery()],
253-
BorderSwitchEvent: [GetBorderSwitch()],
254-
ChildLockEvent: [GetChildLock()],
255-
CrossMapBorderWarningEvent: [GetCrossMapBorderWarning()],
256-
CustomCommandEvent: [],
257-
CutDirectionEvent: [GetCutDirection()],
258-
ErrorEvent: [GetError()],
259-
LifeSpanEvent: [GetLifeSpan([LifeSpan.BLADE, LifeSpan.LENS_BRUSH])],
260-
MoveUpWarningEvent: [GetMoveUpWarning()],
261-
NetworkInfoEvent: [GetNetInfo()],
262-
ReportStatsEvent: [],
263-
SafeProtectEvent: [GetSafeProtect()],
264-
StateEvent: [GetChargeState(), GetCleanInfo()],
265-
StatsEvent: [GetStats()],
266-
TotalStatsEvent: [GetTotalStats()],
267-
VolumeEvent: [GetVolume()],
268-
},
269-
),
270247
],
271-
ids=["5xu9h3", "itk04l", "yna5xi", "p95mgv", "xmp9ds"],
248+
ids=["5xu9h3", "itk04l", "yna5xi", "p95mgv"],
272249
)
273250
async def test_capabilities_event_extraction(
274251
class_: str, expected: dict[type[Event], list[Command]]

0 commit comments

Comments
 (0)