python-terminusgps 1.10.3__py3-none-any.whl → 1.11.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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-terminusgps
3
- Version: 1.10.3
3
+ Version: 1.11.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
@@ -21,13 +21,13 @@ terminusgps/wialon/utils.py,sha256=9xJq5eAWm-vu0nJVJ7eUcwhJhMCrGjS1p__4CIBXYm4,3
21
21
  terminusgps/wialon/items/__init__.py,sha256=3BVthghekMvhMQSzQgBMlD_phxmKSmp3Zvmo-z0O8Bs,211
22
22
  terminusgps/wialon/items/base.py,sha256=sWM8Kg3eJ008M51q42OREHmeifOrFbV1JS9ELqE7coA,6878
23
23
  terminusgps/wialon/items/notification.py,sha256=wC-KXxW4LhjSLJVzBGPfu5hz1vcIGKnYFMxQQ1JzX0g,1058
24
- terminusgps/wialon/items/resource.py,sha256=xElMYSMyKA5y8rIP0EeF429MBV2hbLZcS6SokftvrOs,5641
24
+ terminusgps/wialon/items/resource.py,sha256=KH5U9eizT6hpxC3r0JGhon-wbV_MiyU3eE57rCaznw8,5913
25
25
  terminusgps/wialon/items/retranslator.py,sha256=zsQXqOhH1zFe5_e8DROPu60z3v6xPWOEPyMCi2IqJAo,3861
26
26
  terminusgps/wialon/items/route.py,sha256=qOHPN_rejwiGqvwWzlwmUIAIyc3lKavCalf8ki66rx0,760
27
- terminusgps/wialon/items/unit.py,sha256=AUPoECgjzxnBxTAjPCbSVL_OzqCP7Oa4vjprFT3gJJ8,7275
27
+ terminusgps/wialon/items/unit.py,sha256=3fp9HXxW8e7PvMXwRBurNUrDstEmGyLBVRu3Q9kNcAM,7275
28
28
  terminusgps/wialon/items/unit_group.py,sha256=1yc7ldPIgGbtiTj0djRDWmt6Q9K_VT9sxOaioasbbLY,5212
29
29
  terminusgps/wialon/items/user.py,sha256=p_NA4iXLappr44RKwt9EHv_v0jc1XOQU_mJWe61s_qI,6077
30
- python_terminusgps-1.10.3.dist-info/METADATA,sha256=CY4t0bmdtp64bLgfSNzbQS2_lcc1HX7thHdSbRLK63U,912
31
- python_terminusgps-1.10.3.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
32
- python_terminusgps-1.10.3.dist-info/licenses/COPYING,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
33
- python_terminusgps-1.10.3.dist-info/RECORD,,
30
+ python_terminusgps-1.11.0.dist-info/METADATA,sha256=oLYm0XWa_83TL-87BxqWU1yvdRrc3JqzrshOxq7SQ98,912
31
+ python_terminusgps-1.11.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
32
+ python_terminusgps-1.11.0.dist-info/licenses/COPYING,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
33
+ python_terminusgps-1.11.0.dist-info/RECORD,,
@@ -27,6 +27,13 @@ class WialonResource(WialonBase):
27
27
  )
28
28
  return response.get("item", {}).get("bact") == self.id
29
29
 
30
+ def is_migrated(self, unit: WialonBase) -> bool:
31
+ response = self.session.wialon_api.account_list_change_accounts(
32
+ **{"units": [unit.id]}
33
+ )
34
+ results = [unit.id == int(item.get("id")) for item in response]
35
+ return any(results)
36
+
30
37
  def migrate_unit(self, unit: WialonBase) -> None:
31
38
  """
32
39
  Migrates a :py:obj:`WialonUnit` into the account.
@@ -133,15 +133,6 @@ class WialonUnit(WialonBase):
133
133
  **{"itemId": self.id, "phoneNumber": quote_plus(phone)}
134
134
  )
135
135
 
136
- def clean_phone_numbers(self, phones: list[str]) -> list[str]:
137
- cleaned_phones = []
138
- for num in phones:
139
- if "," in num:
140
- cleaned_phones.extend(num.split(","))
141
- else:
142
- cleaned_phones.append(num)
143
- return cleaned_phones
144
-
145
136
  def get_phone_numbers(self) -> list[str]:
146
137
  """
147
138
  Retrieves all phone numbers assigned to the unit.
@@ -167,6 +158,15 @@ class WialonUnit(WialonBase):
167
158
  phone_numbers.extend(phones_2)
168
159
  return list(dict.fromkeys(phone_numbers)) # Removes duplicate phone numbers
169
160
 
161
+ def clean_phone_numbers(self, phones: list[str]) -> list[str]:
162
+ cleaned_phones = []
163
+ for num in phones:
164
+ if "," in num:
165
+ cleaned_phones.extend(num.split(","))
166
+ else:
167
+ cleaned_phones.append(num)
168
+ return cleaned_phones
169
+
170
170
  def _get_afield_phone_numbers(self, key: str = "to_number") -> list[str] | None:
171
171
  """
172
172
  Retrives any phone numbers saved in an admin field by key.