pymammotion 0.5.15__py3-none-any.whl → 0.5.17__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.

@@ -19,6 +19,11 @@ class DeviceNonWorkingHours(DataClassORJSONMixin):
19
19
  start_time: str = ""
20
20
  end_time: str = ""
21
21
 
22
+ @dataclass
23
+ class LampInfo(DataClassORJSONMixin):
24
+ lamp_bright: int = 0
25
+ manual_light: bool = False
26
+ night_light: bool = False
22
27
 
23
28
  @dataclass
24
29
  class MowerInfo(DataClassORJSONMixin):
@@ -35,6 +40,7 @@ class MowerInfo(DataClassORJSONMixin):
35
40
  sub_model_id: str = ""
36
41
  ble_mac: str = ""
37
42
  wifi_mac: str = ""
43
+ lamp_info: LampInfo = field(default_factory=LampInfo)
38
44
 
39
45
 
40
46
  @dataclass
@@ -32,7 +32,7 @@ from pymammotion.proto import (
32
32
  NavUnableTimeSet,
33
33
  SvgMessageAckT,
34
34
  TimeCtrlLight,
35
- WifiIotStatusReport,
35
+ WifiIotStatusReport, Getlamprsp,
36
36
  )
37
37
 
38
38
  logger = logging.getLogger(__name__)
@@ -263,7 +263,14 @@ class StateManager:
263
263
  self._device.mower_state.wifi_mac = get_network_info_resp.wifi_mac
264
264
 
265
265
  def _update_mul_data(self, message) -> None:
266
- pass
266
+ """Media and video states."""
267
+ mul_msg = betterproto.which_one_of(message.net, "SubMul")
268
+ match mul_msg[0]:
269
+ case "Getlamprsp":
270
+ lamp_resp: Getlamprsp = mul_msg[1]
271
+ self._device.mower_state.lamp_info.lamp_bright = lamp_resp.lamp_bright
272
+ self._device.mower_state.lamp_info.night_light = True if lamp_resp.lamp_ctrl.value > 0 else False
273
+ self._device.mower_state.lamp_info.manual_light = True if lamp_resp.lamp_manual_ctrl.value > 0 else False
267
274
 
268
275
  def _update_ota_data(self, message) -> None:
269
276
  pass
@@ -0,0 +1,43 @@
1
+ """RTK protobuf commands."""
2
+
3
+ from abc import ABC
4
+ from logging import getLogger
5
+ import time
6
+
7
+ from pymammotion.mammotion.commands.abstract_message import AbstractMessage
8
+ from pymammotion.proto import (
9
+ AppToBaseMqttRtkT,
10
+ BaseStation,
11
+ LubaMsg,
12
+ MsgAttr,
13
+ MsgCmdType,
14
+ MsgDevice,
15
+ RequestBasestationInfoT,
16
+ )
17
+
18
+ logger = getLogger(__name__)
19
+
20
+
21
+ class MessageBasestation(AbstractMessage, ABC):
22
+ def send_order_msg_basestation(self, driver) -> bytes:
23
+ return LubaMsg(
24
+ msgtype=MsgCmdType.BASESTATION,
25
+ sender=MsgDevice.DEV_MOBILEAPP,
26
+ rcver=self.get_msg_device(MsgCmdType.BASESTATION, MsgDevice.DEV_MAINCTL),
27
+ msgattr=MsgAttr.REQ,
28
+ timestamp=round(time.time() * 1000),
29
+ seqs=self.seqs.increment_and_get() & 255,
30
+ version=1,
31
+ subtype=self.user_account,
32
+ driver=driver,
33
+ ).SerializeToString()
34
+
35
+ def basestation_info(self) -> bytes:
36
+ """Build and send a request to get basestation info (request_type=1)."""
37
+ base = BaseStation(to_dev=RequestBasestationInfoT(request_type=1))
38
+ return self.send_order_msg_basestation(base)
39
+
40
+ def set_base_net_rtk_switch(self, rtk_switch: int) -> bytes:
41
+ """Set RTK switch via app_to_base_mqtt_rtk_t."""
42
+ base = BaseStation(app_to_base_mqtt_rtk_msg=AppToBaseMqttRtkT(rtk_switch=rtk_switch))
43
+ return self.send_order_msg_basestation(base)
@@ -81,7 +81,7 @@ class MessageMedia(AbstractMessage, ABC):
81
81
  manual off: false, id=1127, power_ctrl=2
82
82
  """
83
83
  ids = 1125 if manual_ctrl else 1127
84
- manual_light_ctrl = LampManualCtrlSta.manual_power_off if manual_ctrl else LampManualCtrlSta.manual_power_on
84
+ manual_light_ctrl = LampManualCtrlSta.manual_power_on if manual_ctrl else LampManualCtrlSta.manual_power_off
85
85
  return self.send_order_msg_media(
86
86
  SocMul(set_lamp=SetHeadlamp(set_ids=ids, lamp_power_ctrl=2, lamp_manual_ctrl=manual_light_ctrl))
87
87
  )
@@ -235,6 +235,7 @@ class MsgCmdType(betterproto.Enum):
235
235
  ESP = 248
236
236
  MUL = 249
237
237
  PEPT = 250
238
+ BASESTATION = 251
238
239
 
239
240
 
240
241
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: pymammotion
3
- Version: 0.5.15
3
+ Version: 0.5.17
4
4
  Summary:
5
5
  License: GPL-3.0
6
6
  Author: Michael Arthur
@@ -28,7 +28,7 @@ pymammotion/data/model/__init__.py,sha256=UVRbSXGOjYnWv30ZEvzT5QRpdVqAbyeToo-t0Q
28
28
  pymammotion/data/model/account.py,sha256=vJM-KTf2q6eBfVC-UlNHBSmJvqHiCawZ40vnuhXhaz8,140
29
29
  pymammotion/data/model/device.py,sha256=4e5q3slI7fjpizr0DsZIFcJoiCnQtRv0ty_dliDScH8,8288
30
30
  pymammotion/data/model/device_config.py,sha256=DTnoePsMwJrKVXqGeKvbZQjs8Zab61U5T3b-c-w0WlM,2654
31
- pymammotion/data/model/device_info.py,sha256=Q5PbPdTfd948ZWc8EHjN5zwU6pha5MCr47ZEXzCYKNY,1148
31
+ pymammotion/data/model/device_info.py,sha256=Et7WtUnoDEUOGKvHSoPyJJHOWKoTYnKMsvak36Of_1w,1341
32
32
  pymammotion/data/model/device_limits.py,sha256=m8HdxD-RaAkPm7jHYb9GLxMEH9IfzBPz0ZypmsLnId4,1946
33
33
  pymammotion/data/model/enums.py,sha256=NLImBbeqwbwBLbABC_NbBzk4M8OxhUTcto6QcGZVNOc,1707
34
34
  pymammotion/data/model/errors.py,sha256=lBHq2cE8P5fc6Q4JXgrkJXzFKTWgxsoPOyMlTaJWbWk,396
@@ -47,7 +47,7 @@ pymammotion/data/mqtt/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdr
47
47
  pymammotion/data/mqtt/event.py,sha256=pj65y93ACcTzUIJkHZC6s_pRFBYaNMSU1wyYRhiGvw4,5571
48
48
  pymammotion/data/mqtt/properties.py,sha256=laud9rE-JqBHWKZ44Dov2yMkp3Ld8ghpBwlZ4_3g9uQ,4321
49
49
  pymammotion/data/mqtt/status.py,sha256=qwZPevIzScePA_25nbRWMN7IhU-MhhtIl7fcZKAJfIc,1102
50
- pymammotion/data/state_manager.py,sha256=AyrXwcU7SxliQ1r8b_QqFMkMoS6l0VE-XfxLq7NZ5go,12107
50
+ pymammotion/data/state_manager.py,sha256=ChT4k_Mjags7z3EMk4XWd1MZeL3Cvep_1aTdJpvWJFo,12641
51
51
  pymammotion/event/__init__.py,sha256=mgATR6vPHACNQ-0zH5fi7NdzeTCDV1CZyaWPmtUusi8,115
52
52
  pymammotion/event/event.py,sha256=Z8WYxv_-5khEqKjL1w4c_Et24G1Kdm8QFuIBylD3h3U,3021
53
53
  pymammotion/http/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -64,8 +64,9 @@ pymammotion/mammotion/commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5
64
64
  pymammotion/mammotion/commands/abstract_message.py,sha256=M4qL-Yw5g3fTgS9jB9LUSgJSAqpUf7MME-2mfv471Sk,808
65
65
  pymammotion/mammotion/commands/mammotion_command.py,sha256=AMOx6nEbPa0HijbENomPLLuJummS1q-23BzgetBAuOI,2991
66
66
  pymammotion/mammotion/commands/messages/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
67
+ pymammotion/mammotion/commands/messages/basestation.py,sha256=a1LEF4C25ynILeQLx-FOOU4d-N_vMkXSh_etojJjIDM,1442
67
68
  pymammotion/mammotion/commands/messages/driver.py,sha256=LAYGvAcDDXwwliQ1OfRwNBk1VpIdpURo1TlA64zpLA4,3701
68
- pymammotion/mammotion/commands/messages/media.py,sha256=X4LQG9SFNZXyqeaedjuEM10Jx9Bc6SN7kQFpKxrSFrQ,2934
69
+ pymammotion/mammotion/commands/messages/media.py,sha256=ZKATEvqSgjTGTPrVGjDWCAnI1aq_d4TMXyl4dFzgjhE,2934
69
70
  pymammotion/mammotion/commands/messages/navigation.py,sha256=yI-B5HHGuZJXn9iYrxhYZ5BArde6wB_j9bUc5IcSIJE,23261
70
71
  pymammotion/mammotion/commands/messages/network.py,sha256=OrmW4-BP_o3piBjwXZ12WY0HqbXHQqeDXC0YaDPeBM8,7409
71
72
  pymammotion/mammotion/commands/messages/ota.py,sha256=Nk3Tlp6n7hkbkuy355BlqbozHIHzsYnrH2cDO8QGaLk,1446
@@ -84,7 +85,7 @@ pymammotion/mqtt/linkkit/h2client.py,sha256=w9Nvi_nY4CLD_fw-pHtYChwQf7e2TiAGeqkY
84
85
  pymammotion/mqtt/linkkit/linkkit.py,sha256=SGWny2_LKa8qg8RD0Bgd3a4S_fMqpYxJ7a9eFRvgcN0,132923
85
86
  pymammotion/mqtt/mammotion_future.py,sha256=_OWqKOlUGl2yT1xOsXFQYpGd-1zQ63OxqXgy7KRQgYc,710
86
87
  pymammotion/mqtt/mammotion_mqtt.py,sha256=OtLyTxow8xJc1RK1tv3ZCUBleTLZ3QABKmVYIcynoxU,10208
87
- pymammotion/proto/__init__.py,sha256=dUl6HZ0NMRQUVOWe5Kf3fOJFVC5YJ98I9xEfd1R9Wdg,73487
88
+ pymammotion/proto/__init__.py,sha256=9WLHpBnpdJNWHBstuDpegq_O9KKOtxfSc0AfSd9hfmg,73509
88
89
  pymammotion/proto/basestation.proto,sha256=YiSsDmT0DY_ep6DHay13SbhxGMhentYt0BmJrVQrwLQ,1198
89
90
  pymammotion/proto/basestation_pb2.py,sha256=suenbpMz9JZCXdGJGdiPaapppRz9Cf4IDzAXUfdIG3w,3083
90
91
  pymammotion/proto/basestation_pb2.pyi,sha256=lGcTPlGaLdHEQ1A39YITbMG_vs1cVaqHAg5TsPvzexc,4652
@@ -127,7 +128,7 @@ pymammotion/utility/movement.py,sha256=N75oAoAgFydqoaOedYIxGUHmuTCtPzAOtb-d_29tp
127
128
  pymammotion/utility/mur_mur_hash.py,sha256=xEfOZVbqRawJj66eLgtnZ85OauDR47oIPr29OHelzPI,4468
128
129
  pymammotion/utility/periodic.py,sha256=MbeSb9cfhxzYmdT_RiE0dZe3H9IfbQW_zSqhmSX2RUc,3321
129
130
  pymammotion/utility/rocker_util.py,sha256=6tX7sS87qoQC_tsxbx3NLL-HgS08wtzXiZkhDiz7uo0,7179
130
- pymammotion-0.5.15.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
131
- pymammotion-0.5.15.dist-info/METADATA,sha256=LsO3ACCgRJjuuc8XSeSKCvphDUOilr5f9jCjKoAeuro,3871
132
- pymammotion-0.5.15.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
133
- pymammotion-0.5.15.dist-info/RECORD,,
131
+ pymammotion-0.5.17.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
132
+ pymammotion-0.5.17.dist-info/METADATA,sha256=xoN2mPqAqKJRmPYuPKqdLtcK7lx6ZMbDZBH-2cYxOmU,3871
133
+ pymammotion-0.5.17.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
134
+ pymammotion-0.5.17.dist-info/RECORD,,