layrz-sdk 3.1.13__py3-none-any.whl → 3.1.14__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.
- layrz_sdk/__init__.py +1 -1
- layrz_sdk/constants.py +5 -5
- layrz_sdk/entities/__init__.py +129 -129
- layrz_sdk/entities/asset.py +60 -60
- layrz_sdk/entities/asset_operation_mode.py +31 -31
- layrz_sdk/entities/broadcast_request.py +12 -12
- layrz_sdk/entities/broadcast_response.py +12 -12
- layrz_sdk/entities/broadcast_result.py +20 -20
- layrz_sdk/entities/broadcast_status.py +28 -28
- layrz_sdk/entities/case.py +52 -48
- layrz_sdk/entities/case_ignored_status.py +26 -26
- layrz_sdk/entities/case_status.py +23 -23
- layrz_sdk/entities/charts/axis_config.py +15 -15
- layrz_sdk/entities/charts/bar_chart.py +175 -175
- layrz_sdk/entities/charts/chart_alignment.py +27 -27
- layrz_sdk/entities/charts/chart_color.py +44 -44
- layrz_sdk/entities/charts/chart_configuration.py +10 -10
- layrz_sdk/entities/charts/chart_data_serie.py +19 -19
- layrz_sdk/entities/charts/chart_data_serie_type.py +28 -28
- layrz_sdk/entities/charts/chart_data_type.py +27 -27
- layrz_sdk/entities/charts/chart_render_technology.py +30 -30
- layrz_sdk/entities/charts/column_chart.py +201 -201
- layrz_sdk/entities/charts/html_chart.py +38 -38
- layrz_sdk/entities/charts/line_chart.py +248 -248
- layrz_sdk/entities/charts/map_center_type.py +22 -22
- layrz_sdk/entities/charts/map_chart.py +108 -108
- layrz_sdk/entities/charts/map_point.py +22 -22
- layrz_sdk/entities/charts/number_chart.py +54 -54
- layrz_sdk/entities/charts/pie_chart.py +131 -131
- layrz_sdk/entities/charts/radar_chart.py +81 -81
- layrz_sdk/entities/charts/radial_bar_chart.py +131 -131
- layrz_sdk/entities/charts/scatter_chart.py +210 -210
- layrz_sdk/entities/charts/scatter_serie.py +13 -13
- layrz_sdk/entities/charts/scatter_serie_item.py +8 -8
- layrz_sdk/entities/charts/table_chart.py +54 -54
- layrz_sdk/entities/charts/table_header.py +8 -8
- layrz_sdk/entities/charts/table_row.py +9 -9
- layrz_sdk/entities/charts/timeline_chart.py +79 -79
- layrz_sdk/entities/charts/timeline_serie.py +10 -10
- layrz_sdk/entities/charts/timeline_serie_item.py +12 -12
- layrz_sdk/entities/checkpoint.py +17 -17
- layrz_sdk/entities/comment.py +16 -16
- layrz_sdk/entities/custom_field.py +10 -10
- layrz_sdk/entities/custom_report_page.py +40 -40
- layrz_sdk/entities/device.py +13 -13
- layrz_sdk/entities/event.py +23 -23
- layrz_sdk/entities/geofence.py +11 -11
- layrz_sdk/entities/last_message.py +12 -12
- layrz_sdk/entities/message.py +23 -23
- layrz_sdk/entities/outbound_service.py +10 -10
- layrz_sdk/entities/position.py +116 -116
- layrz_sdk/entities/presence_type.py +16 -16
- layrz_sdk/entities/report.py +289 -289
- layrz_sdk/entities/report_col.py +40 -40
- layrz_sdk/entities/report_configuration.py +8 -8
- layrz_sdk/entities/report_data_type.py +28 -28
- layrz_sdk/entities/report_format.py +27 -27
- layrz_sdk/entities/report_header.py +43 -43
- layrz_sdk/entities/report_page.py +15 -15
- layrz_sdk/entities/report_row.py +28 -28
- layrz_sdk/entities/sensor.py +11 -11
- layrz_sdk/entities/text_alignment.py +26 -26
- layrz_sdk/entities/trigger.py +11 -11
- layrz_sdk/entities/user.py +10 -10
- layrz_sdk/entities/waypoint.py +18 -18
- layrz_sdk/helpers/__init__.py +5 -5
- layrz_sdk/helpers/color.py +44 -44
- layrz_sdk/lcl/__init__.py +5 -5
- layrz_sdk/lcl/core.py +848 -848
- {layrz_sdk-3.1.13.dist-info → layrz_sdk-3.1.14.dist-info}/METADATA +49 -49
- layrz_sdk-3.1.14.dist-info/RECORD +75 -0
- {layrz_sdk-3.1.13.dist-info → layrz_sdk-3.1.14.dist-info}/WHEEL +1 -1
- {layrz_sdk-3.1.13.dist-info → layrz_sdk-3.1.14.dist-info}/licenses/LICENSE +6 -6
- layrz_sdk-3.1.13.dist-info/RECORD +0 -75
- {layrz_sdk-3.1.13.dist-info → layrz_sdk-3.1.14.dist-info}/top_level.txt +0 -0
layrz_sdk/entities/position.py
CHANGED
|
@@ -1,116 +1,116 @@
|
|
|
1
|
-
"""Position entity"""
|
|
2
|
-
|
|
3
|
-
import sys
|
|
4
|
-
from typing import Any, Optional
|
|
5
|
-
|
|
6
|
-
from pydantic import BaseModel, Field, field_validator
|
|
7
|
-
|
|
8
|
-
if sys.version_info >= (3, 11):
|
|
9
|
-
from typing import Self
|
|
10
|
-
else:
|
|
11
|
-
from typing_extensions import Self
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
class Position(BaseModel):
|
|
15
|
-
"""Geographic position definition"""
|
|
16
|
-
|
|
17
|
-
latitude: Optional[float] = Field(default=None, description='Defines the latitude of the position')
|
|
18
|
-
longitude: Optional[float] = Field(default=None, description='Defines the longitude of the position')
|
|
19
|
-
altitude: Optional[float] = Field(default=None, description='Defines the altitude of the position')
|
|
20
|
-
hdop: Optional[float] = Field(default=None, description='Defines the horizontal dilution of precision')
|
|
21
|
-
speed: Optional[float] = Field(default=None, description='Defines the speed of the position')
|
|
22
|
-
direction: Optional[float] = Field(default=None, description='Defines the direction of the position')
|
|
23
|
-
satellites: Optional[int] = Field(
|
|
24
|
-
default=None,
|
|
25
|
-
description='Defines the number of satellites used to calculate the position',
|
|
26
|
-
)
|
|
27
|
-
|
|
28
|
-
@field_validator('latitude', mode='before')
|
|
29
|
-
def _validate_latitude(cls: Self, value: Any) -> None | float:
|
|
30
|
-
"""Validate latitude"""
|
|
31
|
-
if value is None:
|
|
32
|
-
return None
|
|
33
|
-
|
|
34
|
-
if not isinstance(value, (int, float)):
|
|
35
|
-
return None
|
|
36
|
-
|
|
37
|
-
if isinstance(value, int):
|
|
38
|
-
value = float(value)
|
|
39
|
-
|
|
40
|
-
if -90 <= value <= 90:
|
|
41
|
-
return value
|
|
42
|
-
|
|
43
|
-
return None
|
|
44
|
-
|
|
45
|
-
@field_validator('longitude', mode='before')
|
|
46
|
-
def _validate_longitude(cls: Self, value: Any) -> None | float:
|
|
47
|
-
"""Validate longitude"""
|
|
48
|
-
if value is None:
|
|
49
|
-
return None
|
|
50
|
-
|
|
51
|
-
if not isinstance(value, (int, float)):
|
|
52
|
-
return None
|
|
53
|
-
|
|
54
|
-
if isinstance(value, int):
|
|
55
|
-
value = float(value)
|
|
56
|
-
|
|
57
|
-
if -180 <= value <= 180:
|
|
58
|
-
return value
|
|
59
|
-
|
|
60
|
-
return None
|
|
61
|
-
|
|
62
|
-
@field_validator('altitude', mode='before')
|
|
63
|
-
def _validate_altitude(cls: Self, value: Any) -> None | float:
|
|
64
|
-
"""Validate altitude"""
|
|
65
|
-
if value is None:
|
|
66
|
-
return None
|
|
67
|
-
|
|
68
|
-
if not isinstance(value, (float, int)):
|
|
69
|
-
return None
|
|
70
|
-
|
|
71
|
-
return value
|
|
72
|
-
|
|
73
|
-
@field_validator('hdop', mode='before')
|
|
74
|
-
def _validate_hdop(cls: Self, value: Any) -> None | float:
|
|
75
|
-
"""Validate hdop"""
|
|
76
|
-
if value is None:
|
|
77
|
-
return None
|
|
78
|
-
|
|
79
|
-
if not isinstance(value, (int, float)):
|
|
80
|
-
return None
|
|
81
|
-
|
|
82
|
-
if isinstance(value, int):
|
|
83
|
-
value = float(value)
|
|
84
|
-
|
|
85
|
-
return value
|
|
86
|
-
|
|
87
|
-
@field_validator('speed', mode='before')
|
|
88
|
-
def _validate_speed(cls: Self, value: Any) -> None | float:
|
|
89
|
-
"""Validate speed"""
|
|
90
|
-
if value is None:
|
|
91
|
-
return None
|
|
92
|
-
|
|
93
|
-
if not isinstance(value, (float, int)):
|
|
94
|
-
return None
|
|
95
|
-
|
|
96
|
-
if isinstance(value, int):
|
|
97
|
-
value = float(value)
|
|
98
|
-
|
|
99
|
-
return abs(value)
|
|
100
|
-
|
|
101
|
-
@field_validator('direction', mode='before')
|
|
102
|
-
def _validate_direction(cls: Self, value: Any) -> None | float:
|
|
103
|
-
"""Validate direction"""
|
|
104
|
-
if value is None:
|
|
105
|
-
return None
|
|
106
|
-
|
|
107
|
-
if not isinstance(value, (float, int)):
|
|
108
|
-
return None
|
|
109
|
-
|
|
110
|
-
if isinstance(value, int):
|
|
111
|
-
value = float(value)
|
|
112
|
-
|
|
113
|
-
if 0 <= value <= 360:
|
|
114
|
-
return value
|
|
115
|
-
|
|
116
|
-
return None
|
|
1
|
+
"""Position entity"""
|
|
2
|
+
|
|
3
|
+
import sys
|
|
4
|
+
from typing import Any, Optional
|
|
5
|
+
|
|
6
|
+
from pydantic import BaseModel, Field, field_validator
|
|
7
|
+
|
|
8
|
+
if sys.version_info >= (3, 11):
|
|
9
|
+
from typing import Self
|
|
10
|
+
else:
|
|
11
|
+
from typing_extensions import Self
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class Position(BaseModel):
|
|
15
|
+
"""Geographic position definition"""
|
|
16
|
+
|
|
17
|
+
latitude: Optional[float] = Field(default=None, description='Defines the latitude of the position')
|
|
18
|
+
longitude: Optional[float] = Field(default=None, description='Defines the longitude of the position')
|
|
19
|
+
altitude: Optional[float] = Field(default=None, description='Defines the altitude of the position')
|
|
20
|
+
hdop: Optional[float] = Field(default=None, description='Defines the horizontal dilution of precision')
|
|
21
|
+
speed: Optional[float] = Field(default=None, description='Defines the speed of the position')
|
|
22
|
+
direction: Optional[float] = Field(default=None, description='Defines the direction of the position')
|
|
23
|
+
satellites: Optional[int] = Field(
|
|
24
|
+
default=None,
|
|
25
|
+
description='Defines the number of satellites used to calculate the position',
|
|
26
|
+
)
|
|
27
|
+
|
|
28
|
+
@field_validator('latitude', mode='before')
|
|
29
|
+
def _validate_latitude(cls: Self, value: Any) -> None | float:
|
|
30
|
+
"""Validate latitude"""
|
|
31
|
+
if value is None:
|
|
32
|
+
return None
|
|
33
|
+
|
|
34
|
+
if not isinstance(value, (int, float)):
|
|
35
|
+
return None
|
|
36
|
+
|
|
37
|
+
if isinstance(value, int):
|
|
38
|
+
value = float(value)
|
|
39
|
+
|
|
40
|
+
if -90 <= value <= 90:
|
|
41
|
+
return value
|
|
42
|
+
|
|
43
|
+
return None
|
|
44
|
+
|
|
45
|
+
@field_validator('longitude', mode='before')
|
|
46
|
+
def _validate_longitude(cls: Self, value: Any) -> None | float:
|
|
47
|
+
"""Validate longitude"""
|
|
48
|
+
if value is None:
|
|
49
|
+
return None
|
|
50
|
+
|
|
51
|
+
if not isinstance(value, (int, float)):
|
|
52
|
+
return None
|
|
53
|
+
|
|
54
|
+
if isinstance(value, int):
|
|
55
|
+
value = float(value)
|
|
56
|
+
|
|
57
|
+
if -180 <= value <= 180:
|
|
58
|
+
return value
|
|
59
|
+
|
|
60
|
+
return None
|
|
61
|
+
|
|
62
|
+
@field_validator('altitude', mode='before')
|
|
63
|
+
def _validate_altitude(cls: Self, value: Any) -> None | float:
|
|
64
|
+
"""Validate altitude"""
|
|
65
|
+
if value is None:
|
|
66
|
+
return None
|
|
67
|
+
|
|
68
|
+
if not isinstance(value, (float, int)):
|
|
69
|
+
return None
|
|
70
|
+
|
|
71
|
+
return value
|
|
72
|
+
|
|
73
|
+
@field_validator('hdop', mode='before')
|
|
74
|
+
def _validate_hdop(cls: Self, value: Any) -> None | float:
|
|
75
|
+
"""Validate hdop"""
|
|
76
|
+
if value is None:
|
|
77
|
+
return None
|
|
78
|
+
|
|
79
|
+
if not isinstance(value, (int, float)):
|
|
80
|
+
return None
|
|
81
|
+
|
|
82
|
+
if isinstance(value, int):
|
|
83
|
+
value = float(value)
|
|
84
|
+
|
|
85
|
+
return value
|
|
86
|
+
|
|
87
|
+
@field_validator('speed', mode='before')
|
|
88
|
+
def _validate_speed(cls: Self, value: Any) -> None | float:
|
|
89
|
+
"""Validate speed"""
|
|
90
|
+
if value is None:
|
|
91
|
+
return None
|
|
92
|
+
|
|
93
|
+
if not isinstance(value, (float, int)):
|
|
94
|
+
return None
|
|
95
|
+
|
|
96
|
+
if isinstance(value, int):
|
|
97
|
+
value = float(value)
|
|
98
|
+
|
|
99
|
+
return abs(value)
|
|
100
|
+
|
|
101
|
+
@field_validator('direction', mode='before')
|
|
102
|
+
def _validate_direction(cls: Self, value: Any) -> None | float:
|
|
103
|
+
"""Validate direction"""
|
|
104
|
+
if value is None:
|
|
105
|
+
return None
|
|
106
|
+
|
|
107
|
+
if not isinstance(value, (float, int)):
|
|
108
|
+
return None
|
|
109
|
+
|
|
110
|
+
if isinstance(value, int):
|
|
111
|
+
value = float(value)
|
|
112
|
+
|
|
113
|
+
if 0 <= value <= 360:
|
|
114
|
+
return value
|
|
115
|
+
|
|
116
|
+
return None
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
from enum import Enum
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
class PresenceType(Enum):
|
|
5
|
-
"""Presence type enum"""
|
|
6
|
-
|
|
7
|
-
ENTRANCE = 'ENTRANCE'
|
|
8
|
-
EXIT = 'EXIT'
|
|
9
|
-
|
|
10
|
-
def __str__(self) -> str:
|
|
11
|
-
"""Readable property"""
|
|
12
|
-
return self.name
|
|
13
|
-
|
|
14
|
-
def __repr__(self) -> str:
|
|
15
|
-
"""Readable property"""
|
|
16
|
-
return f'PresenceType.{self.name}'
|
|
1
|
+
from enum import Enum
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class PresenceType(Enum):
|
|
5
|
+
"""Presence type enum"""
|
|
6
|
+
|
|
7
|
+
ENTRANCE = 'ENTRANCE'
|
|
8
|
+
EXIT = 'EXIT'
|
|
9
|
+
|
|
10
|
+
def __str__(self) -> str:
|
|
11
|
+
"""Readable property"""
|
|
12
|
+
return self.name
|
|
13
|
+
|
|
14
|
+
def __repr__(self) -> str:
|
|
15
|
+
"""Readable property"""
|
|
16
|
+
return f'PresenceType.{self.name}'
|