pymammotion 0.5.69__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pymammotion/__init__.py +53 -0
- pymammotion/agora/__init__.py +0 -0
- pymammotion/agora/agora_api.py +755 -0
- pymammotion/agora/agora_rtc_capabilities.py +748 -0
- pymammotion/agora/agora_websockets.py +1175 -0
- pymammotion/aliyun/__init__.py +1 -0
- pymammotion/aliyun/client.py +235 -0
- pymammotion/aliyun/cloud_gateway.py +982 -0
- pymammotion/aliyun/model/aep_response.py +21 -0
- pymammotion/aliyun/model/connect_response.py +51 -0
- pymammotion/aliyun/model/dev_by_account_response.py +195 -0
- pymammotion/aliyun/model/login_by_oauth_response.py +64 -0
- pymammotion/aliyun/model/regions_response.py +29 -0
- pymammotion/aliyun/model/session_by_authcode_response.py +19 -0
- pymammotion/aliyun/model/thing_response.py +12 -0
- pymammotion/aliyun/regions.py +62 -0
- pymammotion/aliyun/tea/core.py +297 -0
- pymammotion/aliyun/tmp_constant.py +171 -0
- pymammotion/bluetooth/__init__.py +1 -0
- pymammotion/bluetooth/ble.py +62 -0
- pymammotion/bluetooth/ble_message.py +676 -0
- pymammotion/bluetooth/const.py +27 -0
- pymammotion/bluetooth/data/__init__.py +0 -0
- pymammotion/bluetooth/data/convert.py +25 -0
- pymammotion/bluetooth/data/framectrldata.py +40 -0
- pymammotion/bluetooth/data/notifydata.py +62 -0
- pymammotion/bluetooth/model/__init__.py +0 -0
- pymammotion/bluetooth/model/atomic_integer.py +54 -0
- pymammotion/const.py +13 -0
- pymammotion/data/__init__.py +0 -0
- pymammotion/data/model/__init__.py +8 -0
- pymammotion/data/model/account.py +8 -0
- pymammotion/data/model/device.py +192 -0
- pymammotion/data/model/device_config.py +72 -0
- pymammotion/data/model/device_info.py +60 -0
- pymammotion/data/model/device_limits.py +49 -0
- pymammotion/data/model/enums.py +77 -0
- pymammotion/data/model/errors.py +12 -0
- pymammotion/data/model/events.py +14 -0
- pymammotion/data/model/generate_geojson.py +565 -0
- pymammotion/data/model/generate_route_information.py +26 -0
- pymammotion/data/model/hash_list.py +475 -0
- pymammotion/data/model/location.py +36 -0
- pymammotion/data/model/mowing_modes.py +77 -0
- pymammotion/data/model/rapid_state.py +45 -0
- pymammotion/data/model/raw_data.py +215 -0
- pymammotion/data/model/region_data.py +102 -0
- pymammotion/data/model/report_info.py +182 -0
- pymammotion/data/model/work.py +27 -0
- pymammotion/data/mower_state_manager.py +369 -0
- pymammotion/data/mqtt/__init__.py +1 -0
- pymammotion/data/mqtt/event.py +227 -0
- pymammotion/data/mqtt/mammotion_properties.py +276 -0
- pymammotion/data/mqtt/properties.py +203 -0
- pymammotion/data/mqtt/status.py +57 -0
- pymammotion/event/__init__.py +6 -0
- pymammotion/event/event.py +96 -0
- pymammotion/homeassistant/__init__.py +3 -0
- pymammotion/homeassistant/mower_api.py +514 -0
- pymammotion/homeassistant/rtk_api.py +54 -0
- pymammotion/http/__init__.py +0 -0
- pymammotion/http/encryption.py +220 -0
- pymammotion/http/http.py +673 -0
- pymammotion/http/model/__init__.py +0 -0
- pymammotion/http/model/camera_stream.py +31 -0
- pymammotion/http/model/http.py +249 -0
- pymammotion/http/model/response_factory.py +61 -0
- pymammotion/http/model/rtk.py +16 -0
- pymammotion/mammotion/__init__.py +0 -0
- pymammotion/mammotion/commands/__init__.py +0 -0
- pymammotion/mammotion/commands/abstract_message.py +24 -0
- pymammotion/mammotion/commands/mammotion_command.py +81 -0
- pymammotion/mammotion/commands/messages/__init__.py +0 -0
- pymammotion/mammotion/commands/messages/basestation.py +43 -0
- pymammotion/mammotion/commands/messages/driver.py +122 -0
- pymammotion/mammotion/commands/messages/media.py +87 -0
- pymammotion/mammotion/commands/messages/navigation.py +564 -0
- pymammotion/mammotion/commands/messages/network.py +205 -0
- pymammotion/mammotion/commands/messages/ota.py +38 -0
- pymammotion/mammotion/commands/messages/system.py +330 -0
- pymammotion/mammotion/commands/messages/video.py +33 -0
- pymammotion/mammotion/control/__init__.py +0 -0
- pymammotion/mammotion/control/joystick.py +145 -0
- pymammotion/mammotion/devices/__init__.py +29 -0
- pymammotion/mammotion/devices/base.py +163 -0
- pymammotion/mammotion/devices/mammotion.py +571 -0
- pymammotion/mammotion/devices/mammotion_bluetooth.py +496 -0
- pymammotion/mammotion/devices/mammotion_cloud.py +355 -0
- pymammotion/mammotion/devices/mammotion_mower_ble.py +48 -0
- pymammotion/mammotion/devices/mammotion_mower_cloud.py +39 -0
- pymammotion/mammotion/devices/managers/managers.py +81 -0
- pymammotion/mammotion/devices/mower_device.py +120 -0
- pymammotion/mammotion/devices/mower_manager.py +107 -0
- pymammotion/mammotion/devices/rtk_ble.py +89 -0
- pymammotion/mammotion/devices/rtk_cloud.py +115 -0
- pymammotion/mammotion/devices/rtk_device.py +50 -0
- pymammotion/mammotion/devices/rtk_manager.py +125 -0
- pymammotion/mqtt/__init__.py +6 -0
- pymammotion/mqtt/aliyun_mqtt.py +237 -0
- pymammotion/mqtt/linkkit/__init__.py +5 -0
- pymammotion/mqtt/linkkit/h2client.py +585 -0
- pymammotion/mqtt/linkkit/linkkit.py +3025 -0
- pymammotion/mqtt/mammotion_future.py +26 -0
- pymammotion/mqtt/mammotion_mqtt.py +214 -0
- pymammotion/mqtt/mqtt_models.py +66 -0
- pymammotion/proto/__init__.py +4841 -0
- pymammotion/proto/basestation.proto +51 -0
- pymammotion/proto/basestation_pb2.py +35 -0
- pymammotion/proto/basestation_pb2.pyi +89 -0
- pymammotion/proto/common.proto +7 -0
- pymammotion/proto/common_pb2.py +25 -0
- pymammotion/proto/common_pb2.pyi +13 -0
- pymammotion/proto/dev_net.proto +321 -0
- pymammotion/proto/dev_net_pb2.py +111 -0
- pymammotion/proto/dev_net_pb2.pyi +515 -0
- pymammotion/proto/luba_msg.proto +76 -0
- pymammotion/proto/luba_msg_pb2.py +41 -0
- pymammotion/proto/luba_msg_pb2.pyi +97 -0
- pymammotion/proto/luba_mul.proto +129 -0
- pymammotion/proto/luba_mul_pb2.py +61 -0
- pymammotion/proto/luba_mul_pb2.pyi +178 -0
- pymammotion/proto/mctrl_driver.proto +107 -0
- pymammotion/proto/mctrl_driver_pb2.py +57 -0
- pymammotion/proto/mctrl_driver_pb2.pyi +167 -0
- pymammotion/proto/mctrl_nav.proto +591 -0
- pymammotion/proto/mctrl_nav_pb2.py +136 -0
- pymammotion/proto/mctrl_nav_pb2.pyi +1067 -0
- pymammotion/proto/mctrl_ota.proto +80 -0
- pymammotion/proto/mctrl_ota_pb2.py +45 -0
- pymammotion/proto/mctrl_ota_pb2.pyi +128 -0
- pymammotion/proto/mctrl_pept.proto +34 -0
- pymammotion/proto/mctrl_pept_pb2.py +33 -0
- pymammotion/proto/mctrl_pept_pb2.pyi +58 -0
- pymammotion/proto/mctrl_sys.proto +741 -0
- pymammotion/proto/mctrl_sys_pb2.py +206 -0
- pymammotion/proto/mctrl_sys_pb2.pyi +1213 -0
- pymammotion/proto/message_pool.py +3 -0
- pymammotion/proto/py.typed +0 -0
- pymammotion/py.typed +0 -0
- pymammotion/utility/constant/__init__.py +3 -0
- pymammotion/utility/constant/device_constant.py +315 -0
- pymammotion/utility/conversions.py +5 -0
- pymammotion/utility/datatype_converter.py +124 -0
- pymammotion/utility/device_config.py +755 -0
- pymammotion/utility/device_type.py +489 -0
- pymammotion/utility/map.py +259 -0
- pymammotion/utility/movement.py +18 -0
- pymammotion/utility/mur_mur_hash.py +159 -0
- pymammotion/utility/periodic.py +106 -0
- pymammotion/utility/rocker_util.py +194 -0
- pymammotion-0.5.69.dist-info/METADATA +93 -0
- pymammotion-0.5.69.dist-info/RECORD +154 -0
- pymammotion-0.5.69.dist-info/WHEEL +4 -0
- pymammotion-0.5.69.dist-info/licenses/LICENSE +674 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
from dataclasses import dataclass
|
|
2
|
+
|
|
3
|
+
from mashumaro.config import BaseConfig
|
|
4
|
+
from mashumaro.mixins.orjson import DataClassORJSONMixin
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
@dataclass
|
|
8
|
+
class DeviceData(DataClassORJSONMixin):
|
|
9
|
+
deviceSecret: str
|
|
10
|
+
productKey: str
|
|
11
|
+
deviceName: str
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
@dataclass
|
|
15
|
+
class AepResponse(DataClassORJSONMixin):
|
|
16
|
+
code: int
|
|
17
|
+
data: DeviceData
|
|
18
|
+
id: str | None = None
|
|
19
|
+
|
|
20
|
+
class Config(BaseConfig):
|
|
21
|
+
omit_default = True
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
from dataclasses import dataclass
|
|
2
|
+
|
|
3
|
+
from mashumaro.mixins.orjson import DataClassORJSONMixin
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
@dataclass
|
|
7
|
+
class DeviceData(DataClassORJSONMixin):
|
|
8
|
+
deviceId: str
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
@dataclass
|
|
12
|
+
class Device(DataClassORJSONMixin):
|
|
13
|
+
traceId: str
|
|
14
|
+
code: int
|
|
15
|
+
data: DeviceData
|
|
16
|
+
subCode: int
|
|
17
|
+
message: str
|
|
18
|
+
successful: str
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
@dataclass
|
|
22
|
+
class Config(DataClassORJSONMixin):
|
|
23
|
+
traceId: str
|
|
24
|
+
code: int
|
|
25
|
+
subCode: int
|
|
26
|
+
message: str
|
|
27
|
+
successful: str
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
@dataclass
|
|
31
|
+
class DataContent(DataClassORJSONMixin):
|
|
32
|
+
device: Device
|
|
33
|
+
config: Config
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
@dataclass
|
|
37
|
+
class InnerData(DataClassORJSONMixin):
|
|
38
|
+
traceId: str
|
|
39
|
+
vid: str
|
|
40
|
+
code: int
|
|
41
|
+
data: DataContent
|
|
42
|
+
subCode: int
|
|
43
|
+
message: str
|
|
44
|
+
successful: str
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
@dataclass
|
|
48
|
+
class ConnectResponse(DataClassORJSONMixin):
|
|
49
|
+
data: InnerData
|
|
50
|
+
success: str
|
|
51
|
+
api: str
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
from dataclasses import dataclass
|
|
2
|
+
from typing import Annotated, Optional
|
|
3
|
+
|
|
4
|
+
from mashumaro.config import BaseConfig
|
|
5
|
+
from mashumaro.mixins.orjson import DataClassORJSONMixin
|
|
6
|
+
from mashumaro.types import Alias
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
@dataclass
|
|
10
|
+
class Device(DataClassORJSONMixin):
|
|
11
|
+
"""Unified device model supporting both Device and ShareNotification data"""
|
|
12
|
+
|
|
13
|
+
# Core device fields (from Device model)
|
|
14
|
+
gmt_modified: Annotated[int, Alias("gmtModified")]
|
|
15
|
+
node_type: Annotated[str, Alias("nodeType")]
|
|
16
|
+
device_name: Annotated[str, Alias("deviceName")]
|
|
17
|
+
product_name: Annotated[str, Alias("productName")]
|
|
18
|
+
status: int
|
|
19
|
+
identity_id: Annotated[str, Alias("identityId")]
|
|
20
|
+
|
|
21
|
+
# Required fields from original Device model
|
|
22
|
+
net_type: Annotated[str, Alias("netType")]
|
|
23
|
+
category_key: Annotated[str, Alias("categoryKey")]
|
|
24
|
+
product_key: Annotated[str, Alias("productKey")]
|
|
25
|
+
is_edge_gateway: Annotated[bool, Alias("isEdgeGateway")]
|
|
26
|
+
category_name: Annotated[str, Alias("categoryName")]
|
|
27
|
+
identity_alias: Annotated[str, Alias("identityAlias")]
|
|
28
|
+
iot_id: Annotated[str, Alias("iotId")]
|
|
29
|
+
bind_time: Annotated[int, Alias("bindTime")]
|
|
30
|
+
owned: int
|
|
31
|
+
thing_type: Annotated[str, Alias("thingType")]
|
|
32
|
+
|
|
33
|
+
# Optional fields (common to both or nullable)
|
|
34
|
+
nick_name: Annotated[Optional[str], Alias("nickName")] = None
|
|
35
|
+
description: Optional[str] = None
|
|
36
|
+
product_image: Annotated[Optional[str], Alias("productImage")] = None
|
|
37
|
+
category_image: Annotated[Optional[str], Alias("categoryImage")] = None
|
|
38
|
+
product_model: Annotated[Optional[str], Alias("productModel")] = None
|
|
39
|
+
|
|
40
|
+
# Optional fields from ShareNotification only
|
|
41
|
+
target_id: Annotated[Optional[str], Alias("targetId")] = None
|
|
42
|
+
receiver_identity_id: Annotated[Optional[str], Alias("receiverIdentityId")] = None
|
|
43
|
+
target_type: Annotated[Optional[str], Alias("targetType")] = None
|
|
44
|
+
gmt_create: Annotated[Optional[int], Alias("gmtCreate")] = None
|
|
45
|
+
batch_id: Annotated[Optional[str], Alias("batchId")] = None
|
|
46
|
+
record_id: Annotated[Optional[str], Alias("recordId")] = None
|
|
47
|
+
initiator_identity_id: Annotated[Optional[str], Alias("initiatorIdentityId")] = None
|
|
48
|
+
is_receiver: Annotated[Optional[int], Alias("isReceiver")] = None
|
|
49
|
+
initiator_alias: Annotated[Optional[str], Alias("initiatorAlias")] = None
|
|
50
|
+
receiver_alias: Annotated[Optional[str], Alias("receiverAlias")] = None
|
|
51
|
+
|
|
52
|
+
class Config(BaseConfig):
|
|
53
|
+
omit_default = True
|
|
54
|
+
allow_deserialization_not_by_alias = True
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
# # Alternative: Keep them separate but with a common base class
|
|
58
|
+
# @dataclass
|
|
59
|
+
# class BaseDevice(DataClassORJSONMixin):
|
|
60
|
+
# """Base device model with common fields"""
|
|
61
|
+
#
|
|
62
|
+
# gmt_modified: int
|
|
63
|
+
# node_type: str
|
|
64
|
+
# device_name: str
|
|
65
|
+
# product_name: str
|
|
66
|
+
# status: int
|
|
67
|
+
# product_image: Optional[str] = None
|
|
68
|
+
# category_image: Optional[str] = None
|
|
69
|
+
# description: Optional[str] = None
|
|
70
|
+
#
|
|
71
|
+
# class Config(BaseConfig):
|
|
72
|
+
# omit_default = True
|
|
73
|
+
# serialize_by_alias = True
|
|
74
|
+
# aliases = {
|
|
75
|
+
# "gmt_modified": "gmtModified",
|
|
76
|
+
# "node_type": "nodeType",
|
|
77
|
+
# "device_name": "deviceName",
|
|
78
|
+
# "product_name": "productName",
|
|
79
|
+
# "product_image": "productImage",
|
|
80
|
+
# "category_image": "categoryImage",
|
|
81
|
+
# }
|
|
82
|
+
#
|
|
83
|
+
#
|
|
84
|
+
# @dataclass
|
|
85
|
+
# class Device(BaseDevice):
|
|
86
|
+
# """Full device model"""
|
|
87
|
+
#
|
|
88
|
+
# net_type: str
|
|
89
|
+
# category_key: str
|
|
90
|
+
# product_key: str
|
|
91
|
+
# is_edge_gateway: bool
|
|
92
|
+
# category_name: str
|
|
93
|
+
# identity_alias: str
|
|
94
|
+
# iot_id: str
|
|
95
|
+
# bind_time: int
|
|
96
|
+
# owned: int
|
|
97
|
+
# identity_id: str
|
|
98
|
+
# thing_type: str
|
|
99
|
+
# nick_name: Optional[str] = None
|
|
100
|
+
# product_model: Optional[str] = None
|
|
101
|
+
#
|
|
102
|
+
# class Config(BaseConfig):
|
|
103
|
+
# omit_default = True
|
|
104
|
+
# serialize_by_alias = True
|
|
105
|
+
# aliases = {
|
|
106
|
+
# **BaseDevice.Config.aliases,
|
|
107
|
+
# "net_type": "netType",
|
|
108
|
+
# "category_key": "categoryKey",
|
|
109
|
+
# "product_key": "productKey",
|
|
110
|
+
# "is_edge_gateway": "isEdgeGateway",
|
|
111
|
+
# "category_name": "categoryName",
|
|
112
|
+
# "identity_alias": "identityAlias",
|
|
113
|
+
# "iot_id": "iotId",
|
|
114
|
+
# "bind_time": "bindTime",
|
|
115
|
+
# "identity_id": "identityId",
|
|
116
|
+
# "thing_type": "thingType",
|
|
117
|
+
# "nick_name": "nickName",
|
|
118
|
+
# "product_model": "productModel",
|
|
119
|
+
# }
|
|
120
|
+
#
|
|
121
|
+
#
|
|
122
|
+
# @dataclass
|
|
123
|
+
# class ShareNotification(BaseDevice):
|
|
124
|
+
# """Share notification model extending base device"""
|
|
125
|
+
#
|
|
126
|
+
# target_id: str
|
|
127
|
+
# receiver_identity_id: str
|
|
128
|
+
# target_type: str
|
|
129
|
+
# gmt_create: int
|
|
130
|
+
# batch_id: str
|
|
131
|
+
# record_id: str
|
|
132
|
+
# initiator_identity_id: str
|
|
133
|
+
# is_receiver: int
|
|
134
|
+
# initiator_alias: str
|
|
135
|
+
# receiver_alias: str
|
|
136
|
+
#
|
|
137
|
+
# # Optional fields that Device has but ShareNotification might not
|
|
138
|
+
# net_type: Optional[str] = None
|
|
139
|
+
# category_key: Optional[str] = None
|
|
140
|
+
# product_key: Optional[str] = None
|
|
141
|
+
# is_edge_gateway: Optional[bool] = None
|
|
142
|
+
# category_name: Optional[str] = None
|
|
143
|
+
# identity_alias: Optional[str] = None
|
|
144
|
+
# iot_id: Optional[str] = None
|
|
145
|
+
# bind_time: Optional[int] = None
|
|
146
|
+
# owned: Optional[int] = None
|
|
147
|
+
# identity_id: Optional[str] = None
|
|
148
|
+
# thing_type: Optional[str] = None
|
|
149
|
+
# nick_name: Optional[str] = None
|
|
150
|
+
# product_model: Optional[str] = None
|
|
151
|
+
#
|
|
152
|
+
# class Config(BaseConfig):
|
|
153
|
+
# omit_default = True
|
|
154
|
+
# serialize_by_alias = True
|
|
155
|
+
# aliases = {
|
|
156
|
+
# **BaseDevice.Config.aliases,
|
|
157
|
+
# "target_id": "targetId",
|
|
158
|
+
# "receiver_identity_id": "receiverIdentityId",
|
|
159
|
+
# "target_type": "targetType",
|
|
160
|
+
# "gmt_create": "gmtCreate",
|
|
161
|
+
# "batch_id": "batchId",
|
|
162
|
+
# "record_id": "recordId",
|
|
163
|
+
# "initiator_identity_id": "initiatorIdentityId",
|
|
164
|
+
# "is_receiver": "isReceiver",
|
|
165
|
+
# "initiator_alias": "initiatorAlias",
|
|
166
|
+
# "receiver_alias": "receiverAlias",
|
|
167
|
+
# # Device fields that might be present
|
|
168
|
+
# "net_type": "netType",
|
|
169
|
+
# "category_key": "categoryKey",
|
|
170
|
+
# "product_key": "productKey",
|
|
171
|
+
# "is_edge_gateway": "isEdgeGateway",
|
|
172
|
+
# "category_name": "categoryName",
|
|
173
|
+
# "identity_alias": "identityAlias",
|
|
174
|
+
# "iot_id": "iotId",
|
|
175
|
+
# "bind_time": "bindTime",
|
|
176
|
+
# "identity_id": "identityId",
|
|
177
|
+
# "thing_type": "thingType",
|
|
178
|
+
# "nick_name": "nickName",
|
|
179
|
+
# "product_model": "productModel",
|
|
180
|
+
# }
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
@dataclass
|
|
184
|
+
class Data(DataClassORJSONMixin):
|
|
185
|
+
total: int
|
|
186
|
+
data: list[Device]
|
|
187
|
+
pageNo: int
|
|
188
|
+
pageSize: int
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
@dataclass
|
|
192
|
+
class ListingDevAccountResponse(DataClassORJSONMixin):
|
|
193
|
+
code: int
|
|
194
|
+
data: Data | None
|
|
195
|
+
id: str | None = None
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
from dataclasses import dataclass
|
|
2
|
+
|
|
3
|
+
from mashumaro.mixins.orjson import DataClassORJSONMixin
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
@dataclass
|
|
7
|
+
class OpenAccount(DataClassORJSONMixin):
|
|
8
|
+
displayName: str
|
|
9
|
+
openId: str
|
|
10
|
+
hasPassword: str
|
|
11
|
+
subAccount: str
|
|
12
|
+
pwdVersion: int
|
|
13
|
+
mobileConflictAccount: str
|
|
14
|
+
id: int
|
|
15
|
+
mobileLocationCode: str
|
|
16
|
+
avatarUrl: str
|
|
17
|
+
domainId: int
|
|
18
|
+
enableDevice: str
|
|
19
|
+
status: int
|
|
20
|
+
country: str | None = None
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
@dataclass
|
|
24
|
+
class OauthOtherInfo(DataClassORJSONMixin):
|
|
25
|
+
SidExpiredTime: int
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
@dataclass
|
|
29
|
+
class LoginSuccessResult(DataClassORJSONMixin):
|
|
30
|
+
reTokenExpireIn: int
|
|
31
|
+
uidToken: str
|
|
32
|
+
openAccount: OpenAccount
|
|
33
|
+
initPwd: str
|
|
34
|
+
sidExpireIn: int
|
|
35
|
+
oauthOtherInfo: OauthOtherInfo
|
|
36
|
+
refreshToken: str
|
|
37
|
+
sid: str
|
|
38
|
+
token: str
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
@dataclass
|
|
42
|
+
class InnerDataContent(DataClassORJSONMixin):
|
|
43
|
+
loginSuccessResult: LoginSuccessResult
|
|
44
|
+
mobileBindRequired: str
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
@dataclass
|
|
48
|
+
class InnerData(DataClassORJSONMixin):
|
|
49
|
+
traceId: str
|
|
50
|
+
vid: str
|
|
51
|
+
code: int
|
|
52
|
+
data: InnerDataContent
|
|
53
|
+
subCode: int
|
|
54
|
+
message: str
|
|
55
|
+
successful: str
|
|
56
|
+
deviceId: str | None = None
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
@dataclass
|
|
60
|
+
class LoginByOAuthResponse(DataClassORJSONMixin):
|
|
61
|
+
data: InnerData
|
|
62
|
+
success: str
|
|
63
|
+
api: str
|
|
64
|
+
errorMsg: str
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
from dataclasses import dataclass
|
|
2
|
+
from typing import TypeVar
|
|
3
|
+
|
|
4
|
+
from mashumaro.config import BaseConfig
|
|
5
|
+
from mashumaro.mixins.orjson import DataClassORJSONMixin
|
|
6
|
+
|
|
7
|
+
DataT = TypeVar("DataT")
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
@dataclass
|
|
11
|
+
class RegionResponseData(DataClassORJSONMixin):
|
|
12
|
+
shortRegionId: str
|
|
13
|
+
oaApiGatewayEndpoint: str
|
|
14
|
+
regionId: str
|
|
15
|
+
mqttEndpoint: str
|
|
16
|
+
pushChannelEndpoint: str
|
|
17
|
+
regionEnglishName: str
|
|
18
|
+
apiGatewayEndpoint: str
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
@dataclass
|
|
22
|
+
class RegionResponse(DataClassORJSONMixin):
|
|
23
|
+
data: RegionResponseData
|
|
24
|
+
code: int
|
|
25
|
+
id: str | None = None
|
|
26
|
+
msg: str | None = None
|
|
27
|
+
|
|
28
|
+
class Config(BaseConfig):
|
|
29
|
+
omit_default = True
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
from dataclasses import dataclass
|
|
2
|
+
|
|
3
|
+
from mashumaro.mixins.orjson import DataClassORJSONMixin
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
@dataclass
|
|
7
|
+
class SessionOauthToken(DataClassORJSONMixin):
|
|
8
|
+
identityId: str
|
|
9
|
+
refreshTokenExpire: int
|
|
10
|
+
iotToken: str
|
|
11
|
+
iotTokenExpire: int
|
|
12
|
+
refreshToken: str
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
@dataclass
|
|
16
|
+
class SessionByAuthCodeResponse(DataClassORJSONMixin):
|
|
17
|
+
code: int
|
|
18
|
+
data: SessionOauthToken | None = None
|
|
19
|
+
token_issued_at: int | None = None
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
from dataclasses import dataclass
|
|
2
|
+
|
|
3
|
+
from mashumaro.mixins.orjson import DataClassORJSONMixin
|
|
4
|
+
|
|
5
|
+
from pymammotion.data.mqtt.properties import Items
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
@dataclass
|
|
9
|
+
class ThingPropertiesResponse(DataClassORJSONMixin):
|
|
10
|
+
code: int
|
|
11
|
+
data: Items | None
|
|
12
|
+
id: str | None = None
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
region_mappings = {
|
|
2
|
+
# Asia Pacific
|
|
3
|
+
"CN": "cn-hongkong", # China -> Hong Kong
|
|
4
|
+
"HK": "cn-hongkong", # Hong Kong
|
|
5
|
+
"TW": "cn-hongkong", # Taiwan -> Hong Kong
|
|
6
|
+
"MO": "cn-hongkong", # Macau -> Hong Kong
|
|
7
|
+
# Southeast Asia
|
|
8
|
+
"SG": "ap-southeast-1", # Singapore
|
|
9
|
+
"MY": "ap-southeast-3", # Malaysia
|
|
10
|
+
"ID": "ap-southeast-5", # Indonesia
|
|
11
|
+
"TH": "ap-southeast-1", # Thailand -> Singapore
|
|
12
|
+
"VN": "ap-southeast-1", # Vietnam -> Singapore
|
|
13
|
+
"PH": "ap-southeast-1", # Philippines -> Singapore
|
|
14
|
+
"BN": "ap-southeast-1", # Brunei -> Singapore
|
|
15
|
+
"KH": "ap-southeast-1", # Cambodia -> Singapore
|
|
16
|
+
"LA": "ap-southeast-1", # Laos -> Singapore
|
|
17
|
+
"MM": "ap-southeast-1", # Myanmar -> Singapore
|
|
18
|
+
# Australia/Oceania
|
|
19
|
+
"AU": "ap-southeast-2", # Australia
|
|
20
|
+
"NZ": "ap-southeast-2", # New Zealand -> Australia
|
|
21
|
+
"FJ": "ap-southeast-2", # Fiji -> Australia
|
|
22
|
+
"PG": "ap-southeast-2", # Papua New Guinea -> Australia
|
|
23
|
+
# South Asia
|
|
24
|
+
"IN": "ap-south-1", # India
|
|
25
|
+
"LK": "ap-south-1", # Sri Lanka -> India
|
|
26
|
+
"PK": "ap-south-1", # Pakistan -> India
|
|
27
|
+
"BD": "ap-south-1", # Bangladesh -> India
|
|
28
|
+
"NP": "ap-south-1", # Nepal -> India
|
|
29
|
+
"BT": "ap-south-1", # Bhutan -> India
|
|
30
|
+
"MV": "ap-south-1", # Maldives -> India
|
|
31
|
+
# Middle East
|
|
32
|
+
"AE": "me-east-1", # UAE
|
|
33
|
+
"SA": "me-east-1", # Saudi Arabia -> UAE
|
|
34
|
+
"QA": "me-east-1", # Qatar -> UAE
|
|
35
|
+
"KW": "me-east-1", # Kuwait -> UAE
|
|
36
|
+
"BH": "me-east-1", # Bahrain -> UAE
|
|
37
|
+
"OM": "me-east-1", # Oman -> UAE
|
|
38
|
+
"IL": "me-east-1", # Israel -> UAE
|
|
39
|
+
"TR": "me-east-1", # Turkey -> UAE
|
|
40
|
+
# Europe
|
|
41
|
+
"DE": "eu-central-1", # Germany
|
|
42
|
+
"FR": "eu-central-1", # France -> Germany
|
|
43
|
+
"IT": "eu-central-1", # Italy -> Germany
|
|
44
|
+
"ES": "eu-central-1", # Spain -> Germany
|
|
45
|
+
"GB": "eu-central-1", # UK -> Germany
|
|
46
|
+
"IE": "eu-central-1", # Ireland -> Germany
|
|
47
|
+
"NL": "eu-central-1", # Netherlands -> Germany
|
|
48
|
+
"BE": "eu-central-1", # Belgium -> Germany
|
|
49
|
+
"CH": "eu-central-1", # Switzerland -> Germany
|
|
50
|
+
"AT": "eu-central-1", # Austria -> Germany
|
|
51
|
+
"PL": "eu-central-1", # poland -> Germany
|
|
52
|
+
# North America
|
|
53
|
+
"US": "us-east-1", # USA
|
|
54
|
+
"CA": "us-east-1", # Canada -> US East
|
|
55
|
+
"MX": "us-west-1", # Mexico -> US West
|
|
56
|
+
# South America
|
|
57
|
+
"BR": "us-east-1", # Brazil -> US East
|
|
58
|
+
"AR": "us-east-1", # Argentina -> US East
|
|
59
|
+
"CL": "us-east-1", # Chile -> US East
|
|
60
|
+
"CO": "us-east-1", # Colombia -> US East
|
|
61
|
+
"PE": "us-east-1", # Peru -> US East
|
|
62
|
+
}
|