python-terminusgps 20.2.0__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.2.0
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
@@ -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.2.0.dist-info/METADATA,sha256=vg1Atid3g22ZSAP-pLxwL0zrqxulClWPbgK22G0pMdc,912
33
- python_terminusgps-20.2.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
34
- python_terminusgps-20.2.0.dist-info/licenses/COPYING,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
35
- python_terminusgps-20.2.0.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,