pymammotion 0.2.26__py3-none-any.whl → 0.2.27__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.
@@ -112,11 +112,11 @@ class BleMessage:
112
112
  type = self.messageNavigation.getTypeValue(0, 5)
113
113
  try:
114
114
  request = await self.messageNavigation.post(BleMessage.mEncrypted, BleMessage.mChecksum, False, type, None)
115
- # print(request)
115
+ # _LOGGER.debug(request)
116
116
  except Exception as err:
117
117
  # Log.w(TAG, "post requestDeviceStatus interrupted")
118
118
  request = False
119
- print(err)
119
+ _LOGGER.error(err)
120
120
 
121
121
  # if not request:
122
122
  # onStatusResponse(BlufiCallback.CODE_WRITE_DATA_FAILED, null)
@@ -126,11 +126,11 @@ class BleMessage:
126
126
  type = self.messageNavigation.getTypeValue(0, 7)
127
127
  try:
128
128
  request = await self.messageNavigation.post(BleMessage.mEncrypted, BleMessage.mChecksum, False, type, None)
129
- # print(request)
129
+ # _LOGGER.debug(request)
130
130
  except Exception as err:
131
131
  # Log.w(TAG, "post requestDeviceStatus interrupted")
132
132
  request = False
133
- print(err)
133
+ _LOGGER.error(err)
134
134
 
135
135
  async def sendBorderPackage(self, executeBorder: ExecuteBorder):
136
136
  await self.messageNavigation.post_custom_data(serialize(executeBorder))
@@ -150,7 +150,7 @@ class BleMessage:
150
150
  if len(response) >= 4:
151
151
  sequence = int(response[2]) # toInt
152
152
  if sequence != next(self.mReadSequence):
153
- print(
153
+ _LOGGER.debug(
154
154
  "parseNotification read sequence wrong",
155
155
  sequence,
156
156
  self.mReadSequence,
@@ -168,10 +168,10 @@ class BleMessage:
168
168
  self.notification.setPkgType(pkgType)
169
169
  self.notification.setSubType(subType)
170
170
  frameCtrl = int(response[1]) # toInt
171
- # print("frame ctrl")
172
- # print(frameCtrl)
173
- # print(response)
174
- # print(f"pktType {pkt_type} pkgType {pkgType} subType {subType}")
171
+ # _LOGGER.debug("frame ctrl")
172
+ # _LOGGER.debug(frameCtrl)
173
+ # _LOGGER.debug(response)
174
+ # _LOGGER.debug(f"pktType {pkt_type} pkgType {pkgType} subType {subType}")
175
175
  self.notification.setFrameCtrl(frameCtrl)
176
176
  frameCtrlData = FrameCtrlData(frameCtrl)
177
177
  dataLen = int(response[3]) # toInt specifies length of data
@@ -179,12 +179,12 @@ class BleMessage:
179
179
  try:
180
180
  dataBytes = response[4 : 4 + dataLen]
181
181
  if frameCtrlData.isEncrypted():
182
- print("is encrypted")
182
+ _LOGGER.debug("is encrypted")
183
183
  # BlufiAES aes = new BlufiAES(self.mAESKey, AES_TRANSFORMATION, generateAESIV(sequence));
184
184
  # dataBytes = aes.decrypt(dataBytes);
185
185
  # }
186
186
  if frameCtrlData.isChecksum():
187
- print("checksum")
187
+ _LOGGER.debug("checksum")
188
188
  # int respChecksum1 = toInt(response[response.length - 1]);
189
189
  # int respChecksum2 = toInt(response[response.length - 2]);
190
190
  # int crc = BlufiCRC.calcCRC(BlufiCRC.calcCRC(0, new byte[]{(byte) sequence, (byte) dataLen}), dataBytes);
@@ -208,7 +208,7 @@ class BleMessage:
208
208
  self.notification.addData(dataBytes, dataOffset)
209
209
  return 1 if frameCtrlData.hasFrag() else 0
210
210
  except Exception as e:
211
- print(e)
211
+ _LOGGER.debug(e)
212
212
  return -100
213
213
 
214
214
  # Log.w(TAG, "parseNotification data length less than 4");
@@ -235,7 +235,7 @@ class BleMessage:
235
235
  # this.mSecurityCallback.onReceiveDevicePublicKey(data);
236
236
  # return;
237
237
  # }
238
- print(subType)
238
+ _LOGGER.debug(subType)
239
239
  match subType:
240
240
  # case 15:
241
241
  # parseWifiState(data);
@@ -257,7 +257,7 @@ class BleMessage:
257
257
  if luba_msg.HasField("net"):
258
258
  if luba_msg.net.HasField("toapp_wifi_iot_status"):
259
259
  # await sleep(1.5)
260
- print("sending ble sync")
260
+ _LOGGER.debug("sending ble sync")
261
261
  # await self.send_todev_ble_sync(2)
262
262
  return luba_msg
263
263
 
@@ -297,7 +297,7 @@ class BleMessage:
297
297
  ack = next(self.mAck)
298
298
  return ack == expectAck
299
299
  except Exception as err:
300
- print(err)
300
+ _LOGGER.debug(err)
301
301
  return False
302
302
 
303
303
  def generateSendSequence(self):
@@ -311,9 +311,9 @@ class BleMessage:
311
311
  suc = await self.post(self.mEncrypted, self.mChecksum, self.mRequireAck, type_val, data)
312
312
  # int status = suc ? 0 : BlufiCallback.CODE_WRITE_DATA_FAILED
313
313
  # onPostCustomDataResult(status, data)
314
- # print(suc)
314
+ # _LOGGER.debug(suc)
315
315
  except Exception as err:
316
- print(err)
316
+ _LOGGER.debug(err)
317
317
 
318
318
  async def post_custom_data(self, data_str: str):
319
319
  data = data_str.encode()
@@ -325,7 +325,7 @@ class BleMessage:
325
325
  # int status = suc ? 0 : BlufiCallback.CODE_WRITE_DATA_FAILED
326
326
  # onPostCustomDataResult(status, data)
327
327
  except Exception as err:
328
- print(err)
328
+ _LOGGER.debug(err)
329
329
 
330
330
  async def post(
331
331
  self,
@@ -366,8 +366,8 @@ class BleMessage:
366
366
  frag = index != len(chunks) - 1
367
367
  sequence = self.generateSendSequence()
368
368
  postBytes = self.getPostBytes(type_of, encrypt, checksum, require_ack, frag, sequence, chunk)
369
- # print("sequence")
370
- # print(sequence)
369
+ # _LOGGER.debug("sequence")
370
+ # _LOGGER.debug(sequence)
371
371
  posted = await self.gatt_write(postBytes)
372
372
  if posted != None:
373
373
  return False
@@ -378,7 +378,7 @@ class BleMessage:
378
378
  if require_ack and not self.receiveAck(sequence):
379
379
  return False
380
380
  else:
381
- print("sleeping 0.01")
381
+ _LOGGER.debug("sleeping 0.01")
382
382
  await sleep(0.01)
383
383
 
384
384
  def getPostBytes(
@@ -402,5 +402,5 @@ class BleMessage:
402
402
  if data != None:
403
403
  byteOS.write(data)
404
404
 
405
- print(byteOS.getvalue())
405
+ _LOGGER.debug(byteOS.getvalue())
406
406
  return byteOS.getvalue()
@@ -199,7 +199,7 @@ async def create_devices(ble_device: BLEDevice,
199
199
  preference: ConnectionPreference = ConnectionPreference.BLUETOOTH):
200
200
  mammotion = Mammotion(ble_device, preference)
201
201
 
202
- if cloud_credentials:
202
+ if cloud_credentials and preference == ConnectionPreference.EITHER or preference == ConnectionPreference.WIFI:
203
203
  cloud_client = await Mammotion.login(cloud_credentials.account_id or cloud_credentials.email,
204
204
  cloud_credentials.password)
205
205
  await mammotion.initiate_cloud_connection(cloud_client)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pymammotion
3
- Version: 0.2.26
3
+ Version: 0.2.27
4
4
  Summary:
5
5
  License: GNU-3.0
6
6
  Author: Michael Arthur
@@ -11,7 +11,7 @@ pymammotion/aliyun/dataclass/session_by_authcode_response.py,sha256=_5vsyIxocoec
11
11
  pymammotion/aliyun/tmp_constant.py,sha256=M4Hq_lrGB3LZdX6R2XohRPFoK1NDnNV-pTJwJcJ9838,6650
12
12
  pymammotion/bluetooth/__init__.py,sha256=LAl8jqZ1fPh-3mLmViNQsP3s814C1vsocYUa6oSaXt0,36
13
13
  pymammotion/bluetooth/ble.py,sha256=9fA8yw5xXNJRSbC68SdOMf2QJnHoD7RhhCjLFoF0c0I,2404
14
- pymammotion/bluetooth/ble_message.py,sha256=75jaOgUiPoCt33c9OLyCpfN9Pp1QfINTUAFZVF3zoM8,15487
14
+ pymammotion/bluetooth/ble_message.py,sha256=byibcxZ5b_hE3UzHAImyTcxdBOcya9rdswdtuLV8_hY,15663
15
15
  pymammotion/bluetooth/const.py,sha256=CCqyHsYbB0BAYjwdhXt_n6eWWxmhlUrAFjvVv57mbvE,1749
16
16
  pymammotion/bluetooth/data/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
17
17
  pymammotion/bluetooth/data/convert.py,sha256=tlctvRODoYypy4FpMD_UBwB1bIn5hG0QdQQdNI0e1R8,792
@@ -58,7 +58,7 @@ pymammotion/mammotion/commands/messages/video.py,sha256=_8lJsU4sLm2CGnc7RDkueA0A
58
58
  pymammotion/mammotion/control/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
59
59
  pymammotion/mammotion/control/joystick.py,sha256=mresPubTlWCuLQBOFD9KTyYJz5BjZgqt52BaRodemhM,5557
60
60
  pymammotion/mammotion/devices/__init__.py,sha256=T72jt0ejtMjo1rPmn_FeMF3pmp0LLeRRpc9WcDKEYYY,126
61
- pymammotion/mammotion/devices/mammotion.py,sha256=BVbBNnZPmeybc825cPe6_jVT990XSIKngzVPPfPaRO8,49389
61
+ pymammotion/mammotion/devices/mammotion.py,sha256=Cu6N_zq93TsOnvpd-nH7StopmkKTrzBOQsDKv_RYKEE,49478
62
62
  pymammotion/mqtt/__init__.py,sha256=Ocs5e-HLJvTuDpVXyECEsWIvwsUaxzj7lZ9mSYutNDY,105
63
63
  pymammotion/mqtt/mammotion_future.py,sha256=WKnHqeHiS2Ut-SaDBNOxqh1jDLeTiyLTsJ7PNUexrjk,687
64
64
  pymammotion/mqtt/mammotion_mqtt.py,sha256=X012f5RvmZI52FlgchLSWbngvPnkv9M_gTYvJHakYaM,8127
@@ -113,7 +113,7 @@ pymammotion/utility/map.py,sha256=aoi-Luzuph02hKynTofMoq3mnPstanx75MDAVv49CuY,22
113
113
  pymammotion/utility/movement.py,sha256=JISPBWCOe4MqHbhmkewhV5aWykr1p6f01DzJfvOF-J8,613
114
114
  pymammotion/utility/periodic.py,sha256=9wJMfwXPlx6Mbp3Fws7LLTI34ZDKphH1bva_Ggyk32g,3281
115
115
  pymammotion/utility/rocker_util.py,sha256=syPL0QN4zMzHiTIkUKS7RXBBptjdbkfNlPddwUD5V3A,7171
116
- pymammotion-0.2.26.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
117
- pymammotion-0.2.26.dist-info/METADATA,sha256=jgySr-dJ6A7bczMdRHMbWc1Q9cHpvf1jM5BLNeQMgIM,3969
118
- pymammotion-0.2.26.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
119
- pymammotion-0.2.26.dist-info/RECORD,,
116
+ pymammotion-0.2.27.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
117
+ pymammotion-0.2.27.dist-info/METADATA,sha256=5ks2LDgNm-FfMrx3bda29NSW3pyW1s8h50iSj9p1pQQ,3969
118
+ pymammotion-0.2.27.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
119
+ pymammotion-0.2.27.dist-info/RECORD,,