python-terminusgps 20.1.1__py3-none-any.whl → 20.3.0__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 python-terminusgps might be problematic. Click here for more details.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-terminusgps
3
- Version: 20.1.1
3
+ Version: 20.3.0
4
4
  Summary: Provides abstractions/utilities for working with Wialon API, Authorize.NET API, AWS API, and more.
5
5
  Project-URL: Documentation, https://app.terminusgps.com/docs/apps/python-terminusgps/index.html
6
6
  Project-URL: Repository, https://github.com/terminusgps/python-terminusgps
@@ -18,7 +18,7 @@ terminusgps/wialon/constants.py,sha256=u7y9MsA5LYvjPjxJnCMQdprTF3QhPPR9j4MvzoSNB
18
18
  terminusgps/wialon/flags.py,sha256=-OoH-eZM54yjRqxsAXL8VImdQu_7C0OAxCrFqaCEuko,13510
19
19
  terminusgps/wialon/logger.py,sha256=nUBsaLMaffSaAHGHAM6mFXDzix9hbNecVtA3INVtii8,968
20
20
  terminusgps/wialon/session.py,sha256=47Cq3cM4sF-lySPtafzizKHeHbfuDuK1CnR0Jrmwk-Q,10634
21
- terminusgps/wialon/utils.py,sha256=KeZmV-MEdGOHXrsyn6IIoyX0EgVYiWYjvacXyZVr1u8,6501
21
+ terminusgps/wialon/utils.py,sha256=KhRgLcD4q2EXAGhi_OOdpo3Azvu65NAEQIvzClj9tbc,6494
22
22
  terminusgps/wialon/items/__init__.py,sha256=cfUC5sfVsTwmpgsR-w9wA4ay6_EZYAPgEeuw2k06RJM,256
23
23
  terminusgps/wialon/items/base.py,sha256=EAtzlnCvB7WTu3iX1bV1-S9TvwXc-Eez7e0X4TMiK9U,6943
24
24
  terminusgps/wialon/items/geofence.py,sha256=LOjWWtRpAFMhE_16SU4sqNEZphmswpeTNtiFCZBB5Ig,1740
@@ -26,10 +26,10 @@ terminusgps/wialon/items/notification.py,sha256=6IrswN6fdEkJErIqtMq45bTl9xVARQw8
26
26
  terminusgps/wialon/items/resource.py,sha256=79SwbCyE1zlaoeBfU0erEqvqBAYUC4KAKs8AOLJqflU,9652
27
27
  terminusgps/wialon/items/retranslator.py,sha256=8q9EDc92w92MElnHIeEzH3Ra4kiPXrx4t9V5nPDZuRU,3728
28
28
  terminusgps/wialon/items/route.py,sha256=PTJx1gmT_PGz7nlSSUS2VzjYD-aAuvkEOIdIFneUSSQ,1148
29
- terminusgps/wialon/items/unit.py,sha256=PwF7xlpDWI5MpM_u6TmYZjNHWk6TSKM4rJ4OB9CIn4A,7533
29
+ terminusgps/wialon/items/unit.py,sha256=m--ZQp5qZ3LggLM0BFndFZIIw5ZlikOxPtGLzuC7HX0,8115
30
30
  terminusgps/wialon/items/unit_group.py,sha256=vGVJMBY1BrKK0tP-C1DCIz4Bh6P-HKRnKY1g8g95UIs,5031
31
31
  terminusgps/wialon/items/user.py,sha256=INwAibQVmjNNelepQXMfDevgJqMvIjHHgEjAMLRvhB0,7082
32
- python_terminusgps-20.1.1.dist-info/METADATA,sha256=h4LJfP4yrxrMf5VzFlyg_ArG_GvkRXoD3JkR35FZIWk,912
33
- python_terminusgps-20.1.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
34
- python_terminusgps-20.1.1.dist-info/licenses/COPYING,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
35
- python_terminusgps-20.1.1.dist-info/RECORD,,
32
+ python_terminusgps-20.3.0.dist-info/METADATA,sha256=rondTaGLahN7lf0Xuz339CfVKv0gp5_7BgertPu9AZQ,912
33
+ python_terminusgps-20.3.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
34
+ python_terminusgps-20.3.0.dist-info/licenses/COPYING,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
35
+ python_terminusgps-20.3.0.dist-info/RECORD,,
@@ -36,12 +36,31 @@ class WialonUnit(WialonBase):
36
36
  )
37
37
  return int(response.get("item", {}).get("id")) if response.get("item") else None
38
38
 
39
+ def populate(self) -> None:
40
+ super().populate()
41
+ response = self.session.wialon_api.core_search_item(
42
+ **{"id": self.id, "flags": flags.DATAFLAG_UNIT_ADVANCED_PROPERTIES}
43
+ ).get("item", {})
44
+ self._imei_number = response.get("uid")
45
+ self._active = response.get("act", False)
46
+
39
47
  @property
40
48
  def available_commands(self) -> dict:
41
49
  return self.session.wialon_api.core_get_hw_cmds(
42
50
  **{"deviceTypeId": 0, "unitId": self.id}
43
51
  )
44
52
 
53
+ @property
54
+ def imei_number(self) -> int | None:
55
+ if self._imei_number:
56
+ return int(self._imei_number)
57
+
58
+ @property
59
+ def active(self) -> bool:
60
+ if self._active:
61
+ return bool(self._active)
62
+ return False
63
+
45
64
  def execute_command(
46
65
  self,
47
66
  name: str,
@@ -50,10 +50,10 @@ def get_id_from_iccid(iccid: str, session: WialonSession) -> str | None:
50
50
  **{
51
51
  "spec": {
52
52
  "itemsType": "avl_unit",
53
- "propName": "rel_admin_field_value",
54
- "propValueMask": str(iccid),
55
- "sortType": "admin_fields",
56
- "propType": "adminfield",
53
+ "propName": "sys_unique_id",
54
+ "propValueMask": f"*{iccid}*",
55
+ "sortType": "sys_unique_id",
56
+ "propType": "property",
57
57
  "or_logic": 0,
58
58
  },
59
59
  "force": 0,