Skip to content

Commit 199084b

Browse files
edenhausnanomad
authored andcommitted
refactor
1 parent 4e3f527 commit 199084b

5 files changed

Lines changed: 6 additions & 7 deletions

File tree

deebot_client/capabilities.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ class CapabilityMap:
174174
changed: CapabilityEvent[MapChangedEvent]
175175
clear: CapabilityExecute[[]] | None = None
176176
major: CapabilityEvent[MajorMapEvent]
177-
minor: CapabilityExecute[[str, int]]
177+
minor: CapabilityExecute[[int, str]]
178178
multi_state: CapabilitySetEnable[MultimapStateEvent] | None = None
179179
position: CapabilityEvent[PositionsEvent]
180180
relocation: CapabilityExecute[[]] | None = None

deebot_client/commands/json/map.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ class GetMinorMap(JsonCommandWithMessageHandling, MessageBodyDataDict):
389389

390390
NAME = "getMinorMap"
391391

392-
def __init__(self, map_id: str, piece_index: int) -> None:
392+
def __init__(self, piece_index: int, map_id: str) -> None:
393393
super().__init__({"mid": map_id, "type": "ol", "pieceIndex": piece_index})
394394

395395
@classmethod

deebot_client/commands/xml/map.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,10 +241,9 @@ class PullMP(XmlCommandWithMessageHandling):
241241

242242
def __init__(
243243
self,
244-
map_id: str, # pylint: disable=unused-argument # noqa: ARG002
245244
piece_index: int,
245+
_: str | None = None,
246246
) -> None:
247-
"""Declare the map_id argument not to break compatibility with CapabilityMap."""
248247
self._piece_index = piece_index
249248
super().__init__({"pid": str(piece_index)})
250249

deebot_client/map.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ async def on_major_map(event: MajorMapEvent) -> None:
105105
):
106106
tg.create_task(
107107
self._execute_command(
108-
self._capabilities.minor.execute(event.map_id, idx)
108+
self._capabilities.minor.execute(idx, event.map_id)
109109
)
110110
)
111111

tests/commands/xml/test_map.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ async def test_PullM_error(xml: str) -> None:
219219
async def test_PullMP(xml: str, expected_event: MinorMapEvent) -> None:
220220
json = get_request_xml(xml)
221221
await assert_command(
222-
PullMP(map_id="unused", piece_index=1),
222+
PullMP(piece_index=1),
223223
json,
224224
expected_event,
225225
command_result=CommandResult(
@@ -239,7 +239,7 @@ async def test_PullMP(xml: str, expected_event: MinorMapEvent) -> None:
239239
async def test_PullMP_error(xml: str) -> None:
240240
json = get_request_xml(xml)
241241
await assert_command(
242-
PullMP(map_id="unused", piece_index=1),
242+
PullMP(piece_index=1),
243243
json,
244244
None,
245245
command_result=CommandResult(HandlingState.ANALYSE_LOGGED),

0 commit comments

Comments
 (0)