pymammotion 0.5.40__py3-none-any.whl → 0.5.42__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.
Potentially problematic release.
This version of pymammotion might be problematic. Click here for more details.
- pymammotion/data/model/hash_list.py +8 -0
- pymammotion/homeassistant/mower_api.py +1 -1
- pymammotion/http/http.py +14 -4
- {pymammotion-0.5.40.dist-info → pymammotion-0.5.42.dist-info}/METADATA +1 -1
- {pymammotion-0.5.40.dist-info → pymammotion-0.5.42.dist-info}/RECORD +7 -7
- {pymammotion-0.5.40.dist-info → pymammotion-0.5.42.dist-info}/WHEEL +0 -0
- {pymammotion-0.5.40.dist-info → pymammotion-0.5.42.dist-info}/licenses/LICENSE +0 -0
|
@@ -218,6 +218,14 @@ class HashList(DataClassORJSONMixin):
|
|
|
218
218
|
self.obstacle = {hash_id: frames for hash_id, frames in self.obstacle.items() if hash_id in hashlist}
|
|
219
219
|
self.dump = {hash_id: frames for hash_id, frames in self.dump.items() if hash_id in hashlist}
|
|
220
220
|
self.svg = {hash_id: frames for hash_id, frames in self.svg.items() if hash_id in hashlist}
|
|
221
|
+
|
|
222
|
+
area_hashes = list(self.area.keys())
|
|
223
|
+
for hash_id, plan_task in self.plan.items():
|
|
224
|
+
for item in plan_task.zone_hashs:
|
|
225
|
+
if item not in area_hashes:
|
|
226
|
+
self.plan.pop(hash_id)
|
|
227
|
+
break
|
|
228
|
+
|
|
221
229
|
self.area_name = [
|
|
222
230
|
area_item
|
|
223
231
|
for area_item in self.area_name
|
|
@@ -371,7 +371,7 @@ class HomeAssistantMowerApi:
|
|
|
371
371
|
operation_settings.blade_height = -10
|
|
372
372
|
|
|
373
373
|
route_information = GenerateRouteInformation(
|
|
374
|
-
one_hashs=operation_settings.areas,
|
|
374
|
+
one_hashs=list(operation_settings.areas),
|
|
375
375
|
rain_tactics=operation_settings.rain_tactics,
|
|
376
376
|
speed=operation_settings.speed,
|
|
377
377
|
ultra_wave=operation_settings.ultra_wave, # touch no touch etc
|
pymammotion/http/http.py
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
1
3
|
import csv
|
|
2
4
|
import random
|
|
3
5
|
import time
|
|
@@ -33,7 +35,7 @@ class MammotionHTTP:
|
|
|
33
35
|
self.msg = None
|
|
34
36
|
self.account = account
|
|
35
37
|
self._password = password
|
|
36
|
-
self.
|
|
38
|
+
self._response: Response | None = None
|
|
37
39
|
self.login_info: LoginResponseData | None = None
|
|
38
40
|
self.jwt_info: JWTTokenInfo = JWTTokenInfo("", "")
|
|
39
41
|
self._headers = {"User-Agent": "okhttp/4.9.3", "App-Version": "Home Assistant,1.14.2.29"}
|
|
@@ -47,6 +49,17 @@ class MammotionHTTP:
|
|
|
47
49
|
# Replace the line in the __init__ method with:
|
|
48
50
|
self.client_id = f"{int(time.time() * 1000)}_{get_10_random()}_1"
|
|
49
51
|
|
|
52
|
+
@property
|
|
53
|
+
def response(self) -> Response | None:
|
|
54
|
+
return self._response
|
|
55
|
+
|
|
56
|
+
@response.setter
|
|
57
|
+
def response(self, response: Response) -> None:
|
|
58
|
+
self._response = response
|
|
59
|
+
decoded_token = jwt.decode(response.data.access_token, options={"verify_signature": False})
|
|
60
|
+
if isinstance(decoded_token, dict):
|
|
61
|
+
self.jwt_info = JWTTokenInfo(iot=decoded_token.get("iot", ""), robot=decoded_token.get("robot", ""))
|
|
62
|
+
|
|
50
63
|
@staticmethod
|
|
51
64
|
def generate_headers(token: str) -> dict:
|
|
52
65
|
return {"Authorization": f"Bearer {token}"}
|
|
@@ -416,9 +429,6 @@ class MammotionHTTP:
|
|
|
416
429
|
self.response = login_response
|
|
417
430
|
self.msg = login_response.msg
|
|
418
431
|
self.code = login_response.code
|
|
419
|
-
decoded_token = jwt.decode(self.response.data.access_token, options={"verify_signature": False})
|
|
420
|
-
if isinstance(decoded_token, dict):
|
|
421
|
-
self.jwt_info = JWTTokenInfo(iot=decoded_token.get("iot", ""), robot=decoded_token.get("robot", ""))
|
|
422
432
|
# TODO catch errors from mismatch user / password elsewhere
|
|
423
433
|
# Assuming the data format matches the expected structure
|
|
424
434
|
return login_response
|
|
@@ -37,7 +37,7 @@ pymammotion/data/model/errors.py,sha256=lBHq2cE8P5fc6Q4JXgrkJXzFKTWgxsoPOyMlTaJW
|
|
|
37
37
|
pymammotion/data/model/excute_boarder_params.py,sha256=9CpUqrygcle1C_1hDW-riLmm4map4ZbE842NXjcomEI,1394
|
|
38
38
|
pymammotion/data/model/execute_boarder.py,sha256=9rd_h4fbcsXxgnLOd2rO2hWyD1abnTGc47QTEpp8DD0,1103
|
|
39
39
|
pymammotion/data/model/generate_route_information.py,sha256=-_c8pk10zwRh-O2vJ0i3DDCOQbv9CRJ7YNWpfsIpajI,807
|
|
40
|
-
pymammotion/data/model/hash_list.py,sha256=
|
|
40
|
+
pymammotion/data/model/hash_list.py,sha256=5hXCSerL7EH6kmnfta8U6eJxpWumsFpzAukwECeJlf8,14810
|
|
41
41
|
pymammotion/data/model/location.py,sha256=PwmITejfI4pm7PI4rzqSuuHetwle6IJr_CV95435s2M,871
|
|
42
42
|
pymammotion/data/model/mowing_modes.py,sha256=4rMn1H8w2iU2aBwpmAhPh_sT81yqrocrWWUIaU7DCIc,1171
|
|
43
43
|
pymammotion/data/model/rapid_state.py,sha256=mIdhAG_LZXpVcybxqTLgLXkNOmVmDTn04B9PGIDA8Ls,1251
|
|
@@ -52,12 +52,12 @@ pymammotion/data/mqtt/status.py,sha256=qwZPevIzScePA_25nbRWMN7IhU-MhhtIl7fcZKAJf
|
|
|
52
52
|
pymammotion/event/__init__.py,sha256=mgATR6vPHACNQ-0zH5fi7NdzeTCDV1CZyaWPmtUusi8,115
|
|
53
53
|
pymammotion/event/event.py,sha256=Z8WYxv_-5khEqKjL1w4c_Et24G1Kdm8QFuIBylD3h3U,3021
|
|
54
54
|
pymammotion/homeassistant/__init__.py,sha256=j0aQZKWR41pCDR3g1y2p_zfp033pESECcqXiefRg1DQ,107
|
|
55
|
-
pymammotion/homeassistant/mower_api.py,sha256=
|
|
55
|
+
pymammotion/homeassistant/mower_api.py,sha256=bQPCAre0tD3dO4vr07vfKOENmnA8Fv0NVMMq_fkt0ik,19207
|
|
56
56
|
pymammotion/homeassistant/rtk_api.py,sha256=YyTF_14cWvvT31H-LYD715W82KsWfkV1nwXsJcHfQ7I,2445
|
|
57
57
|
pymammotion/http/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
58
58
|
pymammotion/http/_init_.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
59
59
|
pymammotion/http/encryption.py,sha256=lzXu3WwBdQlzjXxWnlJuRgkCrKdPbxx5drhMitVKIEk,8287
|
|
60
|
-
pymammotion/http/http.py,sha256=
|
|
60
|
+
pymammotion/http/http.py,sha256=bh1bYM9dJmc8Eh4jJ8J-IOVzJVThehHq633pqaaPv_E,20171
|
|
61
61
|
pymammotion/http/model/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
62
62
|
pymammotion/http/model/camera_stream.py,sha256=ilxQNny_w9Frwt-m8kbHinvyjDv4Bx8C2swfZ2lTEDE,600
|
|
63
63
|
pymammotion/http/model/http.py,sha256=GyWXIL4fNBssuE7WJR1IR89shWUEMbxRF3T9L24jGMM,6381
|
|
@@ -144,7 +144,7 @@ pymammotion/utility/periodic.py,sha256=MbeSb9cfhxzYmdT_RiE0dZe3H9IfbQW_zSqhmSX2R
|
|
|
144
144
|
pymammotion/utility/rocker_util.py,sha256=6tX7sS87qoQC_tsxbx3NLL-HgS08wtzXiZkhDiz7uo0,7179
|
|
145
145
|
pymammotion/utility/constant/__init__.py,sha256=tcY0LDeD-qDDHx2LKt55KOyv9ZI0UfCNM6fknLCmm8s,110
|
|
146
146
|
pymammotion/utility/constant/device_constant.py,sha256=MJE1DEOg86oWNSXYGx3xxJ542KEuSJNZ0VJLN4eHbUg,8237
|
|
147
|
-
pymammotion-0.5.
|
|
148
|
-
pymammotion-0.5.
|
|
149
|
-
pymammotion-0.5.
|
|
150
|
-
pymammotion-0.5.
|
|
147
|
+
pymammotion-0.5.42.dist-info/METADATA,sha256=Qc1EJVsa848is148yLnj19w84HLUYCm7QF15WURBsHU,3575
|
|
148
|
+
pymammotion-0.5.42.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
149
|
+
pymammotion-0.5.42.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
|
150
|
+
pymammotion-0.5.42.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|