pymammotion 0.4.50__py3-none-any.whl → 0.4.52__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/data/mqtt/event.py +9 -1
- pymammotion/mammotion/devices/base.py +1 -2
- pymammotion/mammotion/devices/mammotion.py +11 -11
- {pymammotion-0.4.50.dist-info → pymammotion-0.4.52.dist-info}/METADATA +1 -1
- {pymammotion-0.4.50.dist-info → pymammotion-0.4.52.dist-info}/RECORD +7 -7
- {pymammotion-0.4.50.dist-info → pymammotion-0.4.52.dist-info}/LICENSE +0 -0
- {pymammotion-0.4.50.dist-info → pymammotion-0.4.52.dist-info}/WHEEL +0 -0
pymammotion/data/mqtt/event.py
CHANGED
@@ -142,6 +142,13 @@ class DeviceConfigurationRequestEvent(GeneralParams):
|
|
142
142
|
value: DeviceConfigurationRequestValue
|
143
143
|
|
144
144
|
|
145
|
+
@dataclass
|
146
|
+
class DeviceLogProgressEventParams(GeneralParams):
|
147
|
+
identifier: Literal["device_log_progress_event"]
|
148
|
+
type: Literal["info"]
|
149
|
+
value: DeviceNotificationEventValue
|
150
|
+
|
151
|
+
|
145
152
|
@dataclass
|
146
153
|
class ThingEventMessage(DataClassORJSONMixin):
|
147
154
|
method: Literal["thing.events", "thing.properties"]
|
@@ -157,7 +164,6 @@ class ThingEventMessage(DataClassORJSONMixin):
|
|
157
164
|
params_dict = payload.get("params", {})
|
158
165
|
version = payload.get("version")
|
159
166
|
|
160
|
-
# Determina quale classe usare per i parametri
|
161
167
|
identifier = params_dict.get("identifier")
|
162
168
|
if identifier is None:
|
163
169
|
"""Request configuration event."""
|
@@ -168,6 +174,8 @@ class ThingEventMessage(DataClassORJSONMixin):
|
|
168
174
|
params_obj = DeviceWarningEventParams.from_dict(params_dict)
|
169
175
|
elif identifier == "device_biz_req_event":
|
170
176
|
params_obj = DeviceBizReqEventParams.from_dict(params_dict)
|
177
|
+
elif identifier == "device_log_progress_event":
|
178
|
+
params_obj = DeviceLogProgressEventParams.from_dict(params_dict)
|
171
179
|
elif identifier == "device_config_req_event":
|
172
180
|
params_obj = payload.get("params", {})
|
173
181
|
elif (
|
@@ -36,8 +36,6 @@ def find_next_integer(lst: list[int], current_hash: int) -> int | None:
|
|
36
36
|
class MammotionBaseDevice:
|
37
37
|
"""Base class for Mammotion devices."""
|
38
38
|
|
39
|
-
command_sent_time: datetime = time.time()
|
40
|
-
|
41
39
|
def __init__(self, state_manager: StateManager, cloud_device: Device) -> None:
|
42
40
|
"""Initialize MammotionBaseDevice."""
|
43
41
|
self.loop = asyncio.get_event_loop()
|
@@ -46,6 +44,7 @@ class MammotionBaseDevice:
|
|
46
44
|
self._raw_mower_data: RawMowerData = RawMowerData()
|
47
45
|
self._notify_future: asyncio.Future[bytes] | None = None
|
48
46
|
self._cloud_device = cloud_device
|
47
|
+
self.command_sent_time: datetime = time.time()
|
49
48
|
|
50
49
|
async def datahash_response(self, hash_ack: NavGetHashListAck) -> None:
|
51
50
|
"""Handle datahash responses for root level hashs."""
|
@@ -33,7 +33,7 @@ class MammotionMixedDeviceManager:
|
|
33
33
|
iot_id: str,
|
34
34
|
cloud_client: CloudIOTGateway,
|
35
35
|
mammotion_http: MammotionHTTP,
|
36
|
-
cloud_device: Device
|
36
|
+
cloud_device: Device,
|
37
37
|
ble_device: BLEDevice | None = None,
|
38
38
|
mqtt: MammotionCloud | None = None,
|
39
39
|
preference: ConnectionPreference = ConnectionPreference.BLUETOOTH,
|
@@ -45,8 +45,9 @@ class MammotionMixedDeviceManager:
|
|
45
45
|
self.cloud_client = cloud_client
|
46
46
|
self._state_manager = StateManager(MowingDevice())
|
47
47
|
self._state_manager.get_device().name = name
|
48
|
-
self.
|
49
|
-
self.
|
48
|
+
self._device: Device = cloud_device
|
49
|
+
self.add_ble(ble_device)
|
50
|
+
self.add_cloud(mqtt)
|
50
51
|
self.mammotion_http = mammotion_http
|
51
52
|
self.preference = preference
|
52
53
|
self._state_manager.preference = preference
|
@@ -71,17 +72,16 @@ class MammotionMixedDeviceManager:
|
|
71
72
|
else:
|
72
73
|
return not self.ble().command_queue.empty()
|
73
74
|
|
74
|
-
def add_ble(self,
|
75
|
+
def add_ble(self, ble_device: BLEDevice) -> None:
|
75
76
|
if ble_device is not None:
|
76
77
|
self._ble_device = MammotionBaseBLEDevice(
|
77
|
-
state_manager=self._state_manager, cloud_device=
|
78
|
+
state_manager=self._state_manager, cloud_device=self._device, device=ble_device
|
78
79
|
)
|
79
80
|
|
80
|
-
def add_cloud(self,
|
81
|
-
|
82
|
-
self.
|
83
|
-
|
84
|
-
)
|
81
|
+
def add_cloud(self, mqtt: MammotionCloud) -> None:
|
82
|
+
self._cloud_device = MammotionBaseCloudDevice(
|
83
|
+
mqtt, cloud_device=self._device, state_manager=self._state_manager
|
84
|
+
)
|
85
85
|
|
86
86
|
def replace_cloud(self, cloud_device: MammotionBaseCloudDevice) -> None:
|
87
87
|
self._cloud_device = cloud_device
|
@@ -231,7 +231,7 @@ class Mammotion:
|
|
231
231
|
self.device_manager.add_device(mixed_device)
|
232
232
|
elif device.deviceName.startswith(("Luba-", "Yuka-")) and mower_device:
|
233
233
|
if mower_device.cloud() is None:
|
234
|
-
mower_device.add_cloud(
|
234
|
+
mower_device.add_cloud(mqtt=mqtt_client)
|
235
235
|
else:
|
236
236
|
mower_device.replace_mqtt(mqtt_client)
|
237
237
|
|
@@ -42,7 +42,7 @@ pymammotion/data/model/region_data.py,sha256=VokMRqB_o4OFL1TWAM90Fvm-1z4jcYrw3X2
|
|
42
42
|
pymammotion/data/model/report_info.py,sha256=3nXBFRfdKWnZj4YfBcrPwhBRpq58ICMQlrESfI1tTMg,3808
|
43
43
|
pymammotion/data/model/work.py,sha256=AfKMItFqnRtAlVHzKCfYY-BQy-WFDYZBzdj-9Yc03bo,655
|
44
44
|
pymammotion/data/mqtt/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
45
|
-
pymammotion/data/mqtt/event.py,sha256=
|
45
|
+
pymammotion/data/mqtt/event.py,sha256=C8TGRJs9wNxwg9FFmr9qcsweDnl5v5kcVcwiHxtYzJw,5384
|
46
46
|
pymammotion/data/mqtt/properties.py,sha256=pX5JRVmmpVO04CSPm5xAGcSWA_OeLd0JnBagLsfiSEc,3755
|
47
47
|
pymammotion/data/mqtt/status.py,sha256=SgdrpE1Uldb01hybO6hYhgU1Sp1eILghC0UhMZMHrdQ,1091
|
48
48
|
pymammotion/data/state_manager.py,sha256=aRpxgIxWwlMV-36YCbnIUwdcQbTrWM7p0YrQFem0wCs,10842
|
@@ -70,8 +70,8 @@ pymammotion/mammotion/commands/messages/video.py,sha256=KN9Zj8h7EnVipVBOzHxWF4RX
|
|
70
70
|
pymammotion/mammotion/control/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
71
71
|
pymammotion/mammotion/control/joystick.py,sha256=QfBVxM_gxpWsZAGO90whtgxCI2tIZ3TTad9wHIPsU9s,5640
|
72
72
|
pymammotion/mammotion/devices/__init__.py,sha256=f2qQFPgLGmV85W2hSlMUh5BYuht9o_Ar_JEAAMD4fsE,102
|
73
|
-
pymammotion/mammotion/devices/base.py,sha256=
|
74
|
-
pymammotion/mammotion/devices/mammotion.py,sha256=
|
73
|
+
pymammotion/mammotion/devices/base.py,sha256=qDh7P7fnakDKgxTqjNLcQg8eE-6gHJaXAV0ONjhy_IU,12038
|
74
|
+
pymammotion/mammotion/devices/mammotion.py,sha256=SBisZ7zbLQmo8WpLQze5lI2gDawZpzLWZ9ANTkiLV8s,14451
|
75
75
|
pymammotion/mammotion/devices/mammotion_bluetooth.py,sha256=sgfL4sz6WkIlr2bvYplzxsudmzATNE-z3UGe0K1Csng,18919
|
76
76
|
pymammotion/mammotion/devices/mammotion_cloud.py,sha256=P352E-pcbG6wA-RXubI51EUJ3UUQcqJkxRDIqh3g-58,14217
|
77
77
|
pymammotion/mqtt/__init__.py,sha256=Ocs5e-HLJvTuDpVXyECEsWIvwsUaxzj7lZ9mSYutNDY,105
|
@@ -123,7 +123,7 @@ pymammotion/utility/movement.py,sha256=N75oAoAgFydqoaOedYIxGUHmuTCtPzAOtb-d_29tp
|
|
123
123
|
pymammotion/utility/mur_mur_hash.py,sha256=xEfOZVbqRawJj66eLgtnZ85OauDR47oIPr29OHelzPI,4468
|
124
124
|
pymammotion/utility/periodic.py,sha256=MbeSb9cfhxzYmdT_RiE0dZe3H9IfbQW_zSqhmSX2RUc,3321
|
125
125
|
pymammotion/utility/rocker_util.py,sha256=6tX7sS87qoQC_tsxbx3NLL-HgS08wtzXiZkhDiz7uo0,7179
|
126
|
-
pymammotion-0.4.
|
127
|
-
pymammotion-0.4.
|
128
|
-
pymammotion-0.4.
|
129
|
-
pymammotion-0.4.
|
126
|
+
pymammotion-0.4.52.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
127
|
+
pymammotion-0.4.52.dist-info/METADATA,sha256=x_e3b_Q7aNFN5jnivYyy49BKm52a0Zm7WrqK3u8SExc,3878
|
128
|
+
pymammotion-0.4.52.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
129
|
+
pymammotion-0.4.52.dist-info/RECORD,,
|
File without changes
|
File without changes
|