forked from DeebotUniverse/client.py
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path__init__.py
More file actions
95 lines (75 loc) · 1.75 KB
/
__init__.py
File metadata and controls
95 lines (75 loc) · 1.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
"""Xml commands module."""
from __future__ import annotations
from typing import TYPE_CHECKING
from deebot_client.command import Command, CommandMqttP2P
from .battery import GetBatteryInfo
from .charge import Charge
from .charge_state import GetChargeState
from .clean import Clean, CleanArea, GetCleanState
from .clean_logs import GetCleanLogs
from .clean_speed import GetCleanSpeed, SetCleanSpeed
from .error import GetError
from .life_span import GetLifeSpan, ResetLifeSpan
from .map import GetMapM, GetMapSet, GetMapSt, GetTrM, PullM, PullMP
from .play_sound import PlaySound
from .pos import GetChargerPos, GetPos
from .stats import GetCleanSum
if TYPE_CHECKING:
from .common import XmlCommand
__all__ = [
"Charge",
"Clean",
"CleanArea",
"GetBatteryInfo",
"GetChargeState",
"GetChargerPos",
"GetCleanLogs",
"GetCleanSpeed",
"GetCleanState",
"GetCleanSum",
"GetError",
"GetLifeSpan",
"GetMapM",
"GetMapSet",
"GetMapSt",
"GetPos",
"GetTrM",
"PlaySound",
"PullM",
"PullMP",
"ResetLifeSpan",
"SetCleanSpeed",
]
# fmt: off
# ordered by file asc
_COMMANDS: list[type[XmlCommand]] = [
GetBatteryInfo,
GetChargeState,
Charge,
Clean,
CleanArea,
GetCleanState,
GetCleanLogs,
GetCleanSpeed,
SetCleanSpeed,
GetError,
GetLifeSpan,
ResetLifeSpan,
GetMapM,
GetMapSet,
GetMapSt,
GetTrM,
PullM,
PullMP,
PlaySound,
GetChargerPos,
GetPos,
GetCleanSum,
]
# fmt: on
COMMANDS: dict[str, type[Command]] = {cmd.NAME: cmd for cmd in _COMMANDS}
COMMANDS_WITH_MQTT_P2P_HANDLING: dict[str, type[CommandMqttP2P]] = {
cmd_name: cmd
for (cmd_name, cmd) in COMMANDS.items()
if issubclass(cmd, CommandMqttP2P)
}