python-terminusgps 36.3.1__py3-none-any.whl → 36.4.1__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-terminusgps
3
- Version: 36.3.1
3
+ Version: 36.4.1
4
4
  Summary: Provides abstractions/utilities for working with Wialon API, Authorize.NET API, AWS API, and more.
5
5
  Project-URL: Documentation, https://docs.terminusgps.com
6
6
  Project-URL: Repository, https://github.com/terminusgps/python-terminusgps
@@ -35,13 +35,13 @@ terminusgps/django/tests/test_utils.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJ
35
35
  terminusgps/twilio/__init__.py,sha256=dYo41F2jft_eHDWSUtSpKGSRG1bewq_qClqilUJZkYM,33
36
36
  terminusgps/twilio/caller.py,sha256=RQax2iZ6SYHiuCvBxXkrooRWQ9J8DwKGAjxa8RYjrLI,5023
37
37
  terminusgps/wialon/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
38
- terminusgps/wialon/constants.py,sha256=Ju2XL2A4DPFD-w8NjYqEfnnqregl1luPT0XGhGSUnO8,6316
38
+ terminusgps/wialon/constants.py,sha256=05pLc_0S-x0tT87cQcxOmr8plesjOQxoXfUdjIHwI90,7732
39
39
  terminusgps/wialon/flags.py,sha256=M50EdhxQ8IMnJnU0mrHK7-h8Asc6tvNiTOOfd1dBW6A,12815
40
40
  terminusgps/wialon/session.py,sha256=BN8GBfYNIJcjvev9-qOam2Sbkf7EyCoQXTudRrmA3vc,10533
41
41
  terminusgps/wialon/utils.py,sha256=SwpcxLPBLy0u3AT84G-Co4wxmhRrPFyW3jo_9O6ICvk,11008
42
42
  terminusgps/wialon/validators.py,sha256=j5vrtcfClAzRdRkWTvRRAmrne1t0R6cKkmYdE7fAkSs,4247
43
43
  terminusgps/wialon/items/__init__.py,sha256=3BVthghekMvhMQSzQgBMlD_phxmKSmp3Zvmo-z0O8Bs,211
44
- terminusgps/wialon/items/base.py,sha256=YpOPxghLYDZmWQZRb64CjwCq_0rTmm83cIYZm2oN5LY,9344
44
+ terminusgps/wialon/items/base.py,sha256=ZhndkcVWTOjsEKe5L0NQsLvvXj2Fs0Xv-qBjjm1Xmpk,10421
45
45
  terminusgps/wialon/items/resource.py,sha256=DDnyL_Y5P3DxiirUkQb9y4cokMXZVq3xnfn16Vx8sxk,16992
46
46
  terminusgps/wialon/items/retranslator.py,sha256=sVEWrp8q1I-tO_rMTCH7TeQDDbZryIq8d9KVnhYyhH0,3795
47
47
  terminusgps/wialon/items/route.py,sha256=amNPKZqgl8pEzKA_XJudnvBPzEsfHTmrC7uF15sZVI4,1216
@@ -52,7 +52,7 @@ terminusgps/wialon/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZ
52
52
  terminusgps/wialon/tests/test_items.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
53
53
  terminusgps/wialon/tests/test_session.py,sha256=9mBlYchMo9NeqRIZsmxYzrM1zBHorqu4ooxqSNppLpI,1336
54
54
  terminusgps/wialon/tests/test_utils.py,sha256=SK4PxJQGECFnzx_EQeRAQfsQ5_3FLaVcis2W9u_ibuI,1730
55
- python_terminusgps-36.3.1.dist-info/METADATA,sha256=nT2MtI0nkBDU3LxZHkQ4WjAxpq_0q0bEEFe3gP4s3Cs,1616
56
- python_terminusgps-36.3.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
57
- python_terminusgps-36.3.1.dist-info/licenses/COPYING,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
58
- python_terminusgps-36.3.1.dist-info/RECORD,,
55
+ python_terminusgps-36.4.1.dist-info/METADATA,sha256=MoYb6Vwu-FQT8KvAoeNbClAfe1JI4MM5HwFTdfOLPIY,1616
56
+ python_terminusgps-36.4.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
57
+ python_terminusgps-36.4.1.dist-info/licenses/COPYING,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
58
+ python_terminusgps-36.4.1.dist-info/RECORD,,
@@ -4,6 +4,56 @@ from typing import override
4
4
  from . import flags
5
5
 
6
6
 
7
+ class WialonProfileField(enum.StrEnum):
8
+ """
9
+ Valid profile ids for Wialon objects.
10
+
11
+ `Profile field reference <https://sdk.wialon.com/wiki/en/sidebar/remoteapi/apiref/item/update_profile_field>`_.
12
+
13
+ """
14
+
15
+ VEHICLE_CLASS = "vehicle_class"
16
+ """`Vehicle Type <https://sdk.wialon.com/wiki/en/sidebar/remoteapi/apiref/file/type_library>`_."""
17
+ VIN = "vin"
18
+ """Vin number."""
19
+ REGISTRATION_PLATE = "registration_plate"
20
+ """Registration plate."""
21
+ BRAND = "brand"
22
+ """Brand."""
23
+ MODEL = "model"
24
+ """Model."""
25
+ YEAR = "year"
26
+ """Year."""
27
+ COLOR = "color"
28
+ """Color."""
29
+ ENGINE_MODEL = "engine_model"
30
+ """Engine model."""
31
+ ENGINE_POWER = "engine_power"
32
+ """Engine power, in kW."""
33
+ ENGINE_DISPLACEMENT = "engine_displacement"
34
+ """Engine displacement, in cm."""
35
+ PRIMARY_FUEL_TYPE = "primary_fuel_type"
36
+ """Primary fuel type."""
37
+ CARGO_TYPE = "cargo_type"
38
+ """Cargo type."""
39
+ CARRYING_CAPACITY = "carrying_capacity"
40
+ """Carrying capacity, in tons."""
41
+ WIDTH = "width"
42
+ """Width, in mm."""
43
+ HEIGHT = "height"
44
+ """Height, in mm."""
45
+ DEPTH = "depth"
46
+ """Depth, in mm."""
47
+ EFFECTIVE_CAPACITY = "effective_capacity"
48
+ """Effective capacity."""
49
+ GROSS_VEHICLE_WEIGHT = "gross_vehicle_weight"
50
+ """Gross vehicle weight."""
51
+ AXLES = "axles"
52
+ """Axles."""
53
+ VEHICLE_TYPE = "vehicle_type"
54
+ """Comment."""
55
+
56
+
7
57
  class WialonGeofenceType(enum.IntEnum):
8
58
  """
9
59
  A type of Wialon geofence.
@@ -212,6 +212,23 @@ class WialonBase:
212
212
  if field["n"] == key:
213
213
  return int(field["id"])
214
214
 
215
+ def update_pfield(self, key: constants.WialonProfileField, value: str) -> None:
216
+ """
217
+ Updates a profile field by key.
218
+
219
+ :param key: A profile field key (name).
220
+ :type key: :py:obj:`~terminusgps.wialon.constants.WialonProfileField`
221
+ :param value: A string.
222
+ :type value: :py:obj:`str`
223
+ :raises WialonError: If something goes wrong with Wialon.
224
+ :returns: Nothing.
225
+ :rtype: :py:obj:`None`
226
+
227
+ """
228
+ self.session.wialon_api.item_update_profile_field(
229
+ **{"itemId": self.id, "n": key.value, "v": value}
230
+ )
231
+
215
232
  def update_afield(self, key: str, value: str) -> None:
216
233
  """
217
234
  Updates an admin field by key.
@@ -299,3 +316,17 @@ class WialonBase:
299
316
  )
300
317
  fields = response.get("item", {}).get("aflds") if response is not None else {}
301
318
  return {field["n"]: field["v"] for field in fields.values()} if fields else {}
319
+
320
+ @property
321
+ def pfields(self) -> dict[str, str]:
322
+ """
323
+ Profile fields for the Wialon object.
324
+
325
+ :type: :py:obj:`dict`
326
+
327
+ """
328
+ response = self.session.wialon_api.core_search_item(
329
+ **{"id": self.id, "flags": flags.DataFlag.UNIT_PROFILE_FIELDS}
330
+ )
331
+ fields = response.get("item", {}).get("pflds") if response is not None else {}
332
+ return {field["n"]: field["v"] for field in fields.values()} if fields else {}