layrz-sdk 4.0.24__py3-none-any.whl → 4.0.26__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 layrz-sdk might be problematic. Click here for more details.

@@ -68,6 +68,7 @@ from .function import Function
68
68
  from .geofence import Geofence
69
69
  from .geofence_category import GeofenceCategory
70
70
  from .last_message import LastMessage
71
+ from .locator import Locator, LocatorMqttConfig
71
72
  from .message import Message
72
73
  from .modbus import ModbusConfig, ModbusParameter, ModbusSchema, ModbusStatus, ModbusWait
73
74
  from .notification_type import TwilioNotificationType
@@ -92,6 +93,7 @@ from .request_type import HttpRequestType
92
93
  from .sensor import Sensor
93
94
  from .sensor_mask import SensorMask
94
95
  from .sound_effect import SoundEffect
96
+ from .static_position import StaticPosition
95
97
  from .telemetry import AssetMessage, DeviceMessage
96
98
  from .text_alignment import TextAlignment
97
99
  from .timezone import Timezone
@@ -155,6 +157,8 @@ __all__ = [
155
157
  'HttpRequestType',
156
158
  'LastMessage',
157
159
  'LineChart',
160
+ 'Locator',
161
+ 'LocatorMqttConfig',
158
162
  'MapCenterType',
159
163
  'MapChart',
160
164
  'MapPoint',
@@ -192,6 +196,7 @@ __all__ = [
192
196
  'Sensor',
193
197
  'SensorMask',
194
198
  'SoundEffect',
199
+ 'StaticPosition',
195
200
  'TableChart',
196
201
  'TableHeader',
197
202
  'TableRow',
@@ -0,0 +1,49 @@
1
+ from datetime import datetime
2
+
3
+ from pydantic import BaseModel, Field, field_serializer
4
+
5
+ from .asset import Asset
6
+ from .geofence import Geofence
7
+ from .trigger import Trigger
8
+
9
+
10
+ class LocatorMqttConfig(BaseModel):
11
+ host: str = Field(..., description='Defines the MQTT host of the locator')
12
+ port: int = Field(..., description='Defines the MQTT port of the locator')
13
+ username: str | None = Field(default=None, description='Defines the MQTT username of the locator')
14
+ password: str | None = Field(default=None, description='Defines the MQTT password of the locator')
15
+ topic: str = Field(..., description='Defines the MQTT topic of the locator')
16
+
17
+
18
+ class Locator(BaseModel):
19
+ pk: str = Field(..., description='Defines the primary key of the locator', alias='id')
20
+ token: str = Field(..., description='Defines the token of the locator')
21
+ mqtt_config: LocatorMqttConfig = Field(..., description='Defines the MQTT configuration of the locator')
22
+ assets: list[Asset] = Field(
23
+ default_factory=list,
24
+ description='Defines the list of assets associated with the locator',
25
+ )
26
+
27
+ geofences: list[Geofence] = Field(
28
+ default_factory=list,
29
+ description='Defines the list of geofences associated with the locator',
30
+ )
31
+
32
+ triggers: list[Trigger] = Field(
33
+ default_factory=list,
34
+ description='Defines the list of triggers associated with the locator',
35
+ )
36
+
37
+ is_expired: bool = Field(
38
+ default=False,
39
+ description='Indicates whether the locator is expired',
40
+ )
41
+
42
+ expires_at: datetime | None = Field(
43
+ default=None,
44
+ description='Defines the expiration date of the locator, if applicable',
45
+ )
46
+
47
+ @field_serializer('expires_at', when_used='always')
48
+ def serialize_expires_at(self, expires_at: datetime | None) -> float | None:
49
+ return expires_at.timestamp() if expires_at else None
@@ -207,3 +207,28 @@ class Trigger(BaseModel):
207
207
  default=False,
208
208
  description='Defines if the trigger is paused',
209
209
  )
210
+
211
+ should_generate_locator: bool = Field(
212
+ default=False,
213
+ description='Defines if the trigger should generate a locator',
214
+ )
215
+
216
+ locator_expires_delta: timedelta | None = Field(
217
+ default=None,
218
+ description='Defines the locator expires delta of the trigger',
219
+ )
220
+
221
+ @field_serializer('locator_expires_delta', when_used='always')
222
+ def serialize_locator_expires_delta(self, value: timedelta | None) -> float | None:
223
+ """Serialize locator_expires_delta to total seconds."""
224
+ return value.total_seconds() if value else None
225
+
226
+ locator_expires_triggers_ids: list[int] = Field(
227
+ default_factory=list,
228
+ description='Defines the locator expires triggers IDs of the trigger',
229
+ )
230
+
231
+ locator_geofences_ids: list[int] = Field(
232
+ default_factory=list,
233
+ description='Defines the locator geofences IDs of the trigger',
234
+ )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: layrz-sdk
3
- Version: 4.0.24
3
+ Version: 4.0.26
4
4
  Summary: Layrz SDK for Python
5
5
  Author-email: "Golden M, Inc." <software@goldenm.com>
6
6
  Maintainer-email: Kenny Mochizuki <kenny@goldenm.com>, Luis Reyes <lreyes@goldenm.com>, Kasen Li <kli@goldenm.com>, Miguel Zauzich <miguel@goldenm.com>, Angel Prieto <aprieto@goldenm.com>
@@ -3,7 +3,7 @@ layrz_sdk/constants.py,sha256=guXfIsVAcex76OEMv6DAJy1km1A_WUfWJuUO2Lo3kXE,344
3
3
  layrz_sdk/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
4
  layrz_sdk/decorators/__init__.py,sha256=btoa1egRuYFWggsnfXprvCnxBN9Oq8pbRGcRUR2lm10,82
5
5
  layrz_sdk/decorators/func_timing.py,sha256=xRZrWv13ppS8wDy8DeMSNwH21soXGg-i1lOkSzsJ0c8,2196
6
- layrz_sdk/entities/__init__.py,sha256=w9jHYfkuA9Wdv5Hksk7Q_3_9uvDHykiq8OzkKm7Aw3M,6465
6
+ layrz_sdk/entities/__init__.py,sha256=hvsAyhEmAbQ0WD0Z2x--ILnBG6qbamYAsI38WSopLE8,6613
7
7
  layrz_sdk/entities/action.py,sha256=cbyrfeBsUpdv5ipMtIDvFNJj-FE6whPt7I22BnEZ2sU,2020
8
8
  layrz_sdk/entities/action_geofence_ownership.py,sha256=xP_JG2qY7ogJtbCv-jE1xWAdc2oA0icoRIOAI6acicA,590
9
9
  layrz_sdk/entities/action_kind.py,sha256=2PR4MesAyKssdWAwOGE4hYfzyhGd9pW78H9rlyXu28Q,1189
@@ -35,6 +35,7 @@ layrz_sdk/entities/function.py,sha256=rmUkw0QxD9NpKb1eL42aSsvEa6zPN41MpD86aIKjyB
35
35
  layrz_sdk/entities/geofence.py,sha256=QLjJfMz8F180AMWVvld-SX22RBrmr46h4P66ATimFbY,681
36
36
  layrz_sdk/entities/geofence_category.py,sha256=h9elE_NqDXeOPGGjtwI2AQacl2ijCJP05_cXBnUXf_4,900
37
37
  layrz_sdk/entities/last_message.py,sha256=QNgF0xCQ6uLFDMmKQCjSRhGS1Bq7akw5pv6ZIiFlwfY,268
38
+ layrz_sdk/entities/locator.py,sha256=xtoV8NCuNCxtGNHPOFvaEt5meCFz7pHM3zUWtaltqxU,1809
38
39
  layrz_sdk/entities/message.py,sha256=UXXIdfJTmf2070_FsrHc2a_nQ5RcXMYQqvNyyKcaHMM,1415
39
40
  layrz_sdk/entities/notification_type.py,sha256=WTAFt8cOczXHsIk4RIDbakbtW_JqlvAg7PdW8EVqDew,669
40
41
  layrz_sdk/entities/operation.py,sha256=n2WM2hnvzFznXY5HZWRWQwCymQl9DCHrjUrDepDtf7k,6557
@@ -61,7 +62,7 @@ layrz_sdk/entities/sound_effect.py,sha256=4dy9BOUzzYAByr-ROwONJSFBXsFyrYsgBIAU1g
61
62
  layrz_sdk/entities/static_position.py,sha256=xTbTWRPQLZqTgPQnyIMOoMHiNi42AzmVRfgDMM4m03c,365
62
63
  layrz_sdk/entities/text_alignment.py,sha256=YX2iz6Tm5Qn2iFFD86mju-wFR3bia_auRJCK_MA6TuU,408
63
64
  layrz_sdk/entities/timezone.py,sha256=VhS3o9miktQmThz22KJfatjvqzSONHy73_eBUtjI8iA,375
64
- layrz_sdk/entities/trigger.py,sha256=2vBbDvjdfncT3XGXFGAR6MudcI9xoCzUPunpNBK_duw,6536
65
+ layrz_sdk/entities/trigger.py,sha256=-Q9xo41GxdGiOHgMSZsl6zHg55hGhmIFqwsI1QaE1K4,7375
65
66
  layrz_sdk/entities/trigger_kind.py,sha256=qbAhoS56X8-xh7cMxWhC7IJfocLaXmO53Yt-6f56lXw,1718
66
67
  layrz_sdk/entities/user.py,sha256=-j15Q3nDqd1eYEtkId_Cj5bjIRJAapt6et_ny8fW6xw,248
67
68
  layrz_sdk/entities/waypoint.py,sha256=ZZMIZet5y_cspEQp8ToIkrM0f1ljnkXgnReMB09DDvU,1736
@@ -114,8 +115,8 @@ layrz_sdk/helpers/__init__.py,sha256=5iW3z2m3jrYhvTfxX-p-QTkR9X9oTKfEsbtVOg9jFFY
114
115
  layrz_sdk/helpers/color.py,sha256=dlpMafbM-4Wd9D9hMbbnZJf4ALkpie_ZmBR2Vz_YCmM,1203
115
116
  layrz_sdk/lcl/__init__.py,sha256=U967AWANkL3u_YVxMNAYlh8jkZ6hqHfStacz7yz6sOA,89
116
117
  layrz_sdk/lcl/core.py,sha256=_3uK05I0iwJl63cVWKxt-qFkq0DWggCj5M680GHH5uQ,25161
117
- layrz_sdk-4.0.24.dist-info/licenses/LICENSE,sha256=d5ZrU--lIPER7QByXDKcrtOTOMk1JvN_9FdYDuoWi7Y,1057
118
- layrz_sdk-4.0.24.dist-info/METADATA,sha256=cSQaZogNpDgE4ei_hN-bZ4_raGfmMJe3LlzXgGDFrzk,2045
119
- layrz_sdk-4.0.24.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
120
- layrz_sdk-4.0.24.dist-info/top_level.txt,sha256=yUTMMzfdZ0HDWQH5TaSlFM4xtwmP1fSGxmlL1dmu4l4,10
121
- layrz_sdk-4.0.24.dist-info/RECORD,,
118
+ layrz_sdk-4.0.26.dist-info/licenses/LICENSE,sha256=d5ZrU--lIPER7QByXDKcrtOTOMk1JvN_9FdYDuoWi7Y,1057
119
+ layrz_sdk-4.0.26.dist-info/METADATA,sha256=mX3gbWTm886Z8Ag0ka5juQDtKCdIg3yIF8mdpWffELk,2045
120
+ layrz_sdk-4.0.26.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
121
+ layrz_sdk-4.0.26.dist-info/top_level.txt,sha256=yUTMMzfdZ0HDWQH5TaSlFM4xtwmP1fSGxmlL1dmu4l4,10
122
+ layrz_sdk-4.0.26.dist-info/RECORD,,