layrz-sdk 3.1.14__py3-none-any.whl → 3.1.15__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 +19 -5
- layrz_sdk/entities/__init__.py +138 -129
- layrz_sdk/entities/asset.py +71 -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 -52
- 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 +18 -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/modbus/__init__.py +9 -0
- layrz_sdk/entities/modbus/config.py +19 -0
- layrz_sdk/entities/modbus/parameter.py +110 -0
- layrz_sdk/entities/modbus/schema.py +10 -0
- layrz_sdk/entities/modbus/status.py +16 -0
- layrz_sdk/entities/modbus/wait.py +134 -0
- 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/static_position.py +17 -0
- layrz_sdk/entities/telemetry/__init__.py +6 -0
- layrz_sdk/entities/telemetry/assetmessage.py +159 -0
- layrz_sdk/entities/telemetry/devicemessage.py +122 -0
- 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.14.dist-info → layrz_sdk-3.1.15.dist-info}/METADATA +51 -49
- layrz_sdk-3.1.15.dist-info/RECORD +85 -0
- {layrz_sdk-3.1.14.dist-info → layrz_sdk-3.1.15.dist-info}/licenses/LICENSE +6 -6
- layrz_sdk-3.1.14.dist-info/RECORD +0 -75
- {layrz_sdk-3.1.14.dist-info → layrz_sdk-3.1.15.dist-info}/WHEEL +0 -0
- {layrz_sdk-3.1.14.dist-info → layrz_sdk-3.1.15.dist-info}/top_level.txt +0 -0
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
"""Text alignment"""
|
|
2
|
-
|
|
3
|
-
import sys
|
|
4
|
-
from enum import Enum
|
|
5
|
-
|
|
6
|
-
if sys.version_info >= (3, 11):
|
|
7
|
-
from typing import Self
|
|
8
|
-
else:
|
|
9
|
-
from typing_extensions import Self
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
class TextAlignment(Enum):
|
|
13
|
-
"""Text alignment enum definition"""
|
|
14
|
-
|
|
15
|
-
CENTER = 'center'
|
|
16
|
-
LEFT = 'left'
|
|
17
|
-
RIGHT = 'right'
|
|
18
|
-
JUSTIFY = 'justify'
|
|
19
|
-
|
|
20
|
-
def __str__(self: Self) -> str:
|
|
21
|
-
"""Readable property"""
|
|
22
|
-
return self.name
|
|
23
|
-
|
|
24
|
-
def __repr__(self: Self) -> str:
|
|
25
|
-
"""Readable property"""
|
|
26
|
-
return f'TextAlignment.{self.value}'
|
|
1
|
+
"""Text alignment"""
|
|
2
|
+
|
|
3
|
+
import sys
|
|
4
|
+
from enum import Enum
|
|
5
|
+
|
|
6
|
+
if sys.version_info >= (3, 11):
|
|
7
|
+
from typing import Self
|
|
8
|
+
else:
|
|
9
|
+
from typing_extensions import Self
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class TextAlignment(Enum):
|
|
13
|
+
"""Text alignment enum definition"""
|
|
14
|
+
|
|
15
|
+
CENTER = 'center'
|
|
16
|
+
LEFT = 'left'
|
|
17
|
+
RIGHT = 'right'
|
|
18
|
+
JUSTIFY = 'justify'
|
|
19
|
+
|
|
20
|
+
def __str__(self: Self) -> str:
|
|
21
|
+
"""Readable property"""
|
|
22
|
+
return self.name
|
|
23
|
+
|
|
24
|
+
def __repr__(self: Self) -> str:
|
|
25
|
+
"""Readable property"""
|
|
26
|
+
return f'TextAlignment.{self.value}'
|
layrz_sdk/entities/trigger.py
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
"""Trigger entity"""
|
|
2
|
-
|
|
3
|
-
from pydantic import BaseModel, Field
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
class Trigger(BaseModel):
|
|
7
|
-
"""Trigger entity"""
|
|
8
|
-
|
|
9
|
-
pk: int = Field(description='Defines the primary key of the trigger')
|
|
10
|
-
name: str = Field(description='Defines the name of the trigger')
|
|
11
|
-
code: str = Field(description='Defines the code of the trigger')
|
|
1
|
+
"""Trigger entity"""
|
|
2
|
+
|
|
3
|
+
from pydantic import BaseModel, Field
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class Trigger(BaseModel):
|
|
7
|
+
"""Trigger entity"""
|
|
8
|
+
|
|
9
|
+
pk: int = Field(description='Defines the primary key of the trigger')
|
|
10
|
+
name: str = Field(description='Defines the name of the trigger')
|
|
11
|
+
code: str = Field(description='Defines the code of the trigger')
|
layrz_sdk/entities/user.py
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
"""User entity"""
|
|
2
|
-
|
|
3
|
-
from pydantic import BaseModel, Field
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
class User(BaseModel):
|
|
7
|
-
"""User entity"""
|
|
8
|
-
|
|
9
|
-
pk: int = Field(description='Defines the primary key of the user')
|
|
10
|
-
name: str = Field(description='Defines the name of the user')
|
|
1
|
+
"""User entity"""
|
|
2
|
+
|
|
3
|
+
from pydantic import BaseModel, Field
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class User(BaseModel):
|
|
7
|
+
"""User entity"""
|
|
8
|
+
|
|
9
|
+
pk: int = Field(description='Defines the primary key of the user')
|
|
10
|
+
name: str = Field(description='Defines the name of the user')
|
layrz_sdk/entities/waypoint.py
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
"""Waypoint entity"""
|
|
2
|
-
|
|
3
|
-
from datetime import datetime
|
|
4
|
-
|
|
5
|
-
from pydantic import BaseModel, Field
|
|
6
|
-
|
|
7
|
-
from .geofence import Geofence
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
class Waypoint(BaseModel):
|
|
11
|
-
"""Waypoint entity definition"""
|
|
12
|
-
|
|
13
|
-
pk: int = Field(description='Waypoint ID')
|
|
14
|
-
geofence: Geofence = Field(description='Geofence object')
|
|
15
|
-
start_at: datetime = Field(description='Waypoint start date')
|
|
16
|
-
end_at: datetime = Field(description='Waypoint end date')
|
|
17
|
-
sequence_real: int = Field(description='Real sequence number')
|
|
18
|
-
sequence_ideal: int = Field(description='Ideal sequence number')
|
|
1
|
+
"""Waypoint entity"""
|
|
2
|
+
|
|
3
|
+
from datetime import datetime
|
|
4
|
+
|
|
5
|
+
from pydantic import BaseModel, Field
|
|
6
|
+
|
|
7
|
+
from .geofence import Geofence
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class Waypoint(BaseModel):
|
|
11
|
+
"""Waypoint entity definition"""
|
|
12
|
+
|
|
13
|
+
pk: int = Field(description='Waypoint ID')
|
|
14
|
+
geofence: Geofence = Field(description='Geofence object')
|
|
15
|
+
start_at: datetime = Field(description='Waypoint start date')
|
|
16
|
+
end_at: datetime = Field(description='Waypoint end date')
|
|
17
|
+
sequence_real: int = Field(description='Real sequence number')
|
|
18
|
+
sequence_ideal: int = Field(description='Ideal sequence number')
|
layrz_sdk/helpers/__init__.py
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
"""Layrz SDK Helpers"""
|
|
2
|
-
|
|
3
|
-
from .color import convert_to_rgba, use_black
|
|
4
|
-
|
|
5
|
-
__all__ = ['convert_to_rgba', 'use_black']
|
|
1
|
+
"""Layrz SDK Helpers"""
|
|
2
|
+
|
|
3
|
+
from .color import convert_to_rgba, use_black
|
|
4
|
+
|
|
5
|
+
__all__ = ['convert_to_rgba', 'use_black']
|
layrz_sdk/helpers/color.py
CHANGED
|
@@ -1,44 +1,44 @@
|
|
|
1
|
-
"""Color helpers"""
|
|
2
|
-
|
|
3
|
-
from typing import TypeAlias, cast
|
|
4
|
-
|
|
5
|
-
Color: TypeAlias = tuple[int, int, int, int]
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
def convert_to_rgba(hex_color: str) -> Color:
|
|
9
|
-
"""
|
|
10
|
-
Convert Hex (or Hexa) color to RGB (or RGBA) color
|
|
11
|
-
|
|
12
|
-
:param hex_color: Hex color
|
|
13
|
-
:type hex_color: str
|
|
14
|
-
|
|
15
|
-
:return: RGB or RGBA color
|
|
16
|
-
:rtype: tuple
|
|
17
|
-
|
|
18
|
-
:raises ValueError: If the color is invalid
|
|
19
|
-
"""
|
|
20
|
-
|
|
21
|
-
if not hex_color.startswith('#'):
|
|
22
|
-
raise ValueError('Invalid color, must starts with #')
|
|
23
|
-
|
|
24
|
-
hex_color = hex_color.replace('#', '')
|
|
25
|
-
if len(hex_color) == 6:
|
|
26
|
-
return cast(Color, tuple(int(hex_color[i : i + 2], 16) for i in (0, 2, 4)) + (1,))
|
|
27
|
-
|
|
28
|
-
return cast(Color, tuple(int(hex_color[i : i + 2], 16) for i in (0, 2, 4, 6)))
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
def use_black(color: str) -> bool:
|
|
32
|
-
"""
|
|
33
|
-
Use black
|
|
34
|
-
Will return when the background color works well with black text color.
|
|
35
|
-
Note: This method is not 100% accurate and will not work with alpha channel (Hexa color)
|
|
36
|
-
:param color: Hex color
|
|
37
|
-
:type color: str
|
|
38
|
-
:return: True if the color works well with black text color
|
|
39
|
-
:rtype: bool
|
|
40
|
-
:raises ValueError: If the color is invalid
|
|
41
|
-
"""
|
|
42
|
-
rgb = convert_to_rgba(color)
|
|
43
|
-
a = 1 - (0.299 * rgb[0] + 0.587 * rgb[1] + 0.114 * rgb[2]) / 255
|
|
44
|
-
return a < 0.5
|
|
1
|
+
"""Color helpers"""
|
|
2
|
+
|
|
3
|
+
from typing import TypeAlias, cast
|
|
4
|
+
|
|
5
|
+
Color: TypeAlias = tuple[int, int, int, int]
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def convert_to_rgba(hex_color: str) -> Color:
|
|
9
|
+
"""
|
|
10
|
+
Convert Hex (or Hexa) color to RGB (or RGBA) color
|
|
11
|
+
|
|
12
|
+
:param hex_color: Hex color
|
|
13
|
+
:type hex_color: str
|
|
14
|
+
|
|
15
|
+
:return: RGB or RGBA color
|
|
16
|
+
:rtype: tuple
|
|
17
|
+
|
|
18
|
+
:raises ValueError: If the color is invalid
|
|
19
|
+
"""
|
|
20
|
+
|
|
21
|
+
if not hex_color.startswith('#'):
|
|
22
|
+
raise ValueError('Invalid color, must starts with #')
|
|
23
|
+
|
|
24
|
+
hex_color = hex_color.replace('#', '')
|
|
25
|
+
if len(hex_color) == 6:
|
|
26
|
+
return cast(Color, tuple(int(hex_color[i : i + 2], 16) for i in (0, 2, 4)) + (1,))
|
|
27
|
+
|
|
28
|
+
return cast(Color, tuple(int(hex_color[i : i + 2], 16) for i in (0, 2, 4, 6)))
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
def use_black(color: str) -> bool:
|
|
32
|
+
"""
|
|
33
|
+
Use black
|
|
34
|
+
Will return when the background color works well with black text color.
|
|
35
|
+
Note: This method is not 100% accurate and will not work with alpha channel (Hexa color)
|
|
36
|
+
:param color: Hex color
|
|
37
|
+
:type color: str
|
|
38
|
+
:return: True if the color works well with black text color
|
|
39
|
+
:rtype: bool
|
|
40
|
+
:raises ValueError: If the color is invalid
|
|
41
|
+
"""
|
|
42
|
+
rgb = convert_to_rgba(color)
|
|
43
|
+
a = 1 - (0.299 * rgb[0] + 0.587 * rgb[1] + 0.114 * rgb[2]) / 255
|
|
44
|
+
return a < 0.5
|
layrz_sdk/lcl/__init__.py
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
"""Layrz Compute Language (LCL) SDK"""
|
|
2
|
-
|
|
3
|
-
from .core import LclCore
|
|
4
|
-
|
|
5
|
-
__all__ = ['LclCore']
|
|
1
|
+
"""Layrz Compute Language (LCL) SDK"""
|
|
2
|
+
|
|
3
|
+
from .core import LclCore
|
|
4
|
+
|
|
5
|
+
__all__ = ['LclCore']
|